i fear to add such a feature additional information would need to be stored in the git repo itself which would require a change to git
Jujutsu – A Git-compatible DVCS that is both simple and powerful
91–100 of 233 posts
Re: Jujutsu – A Git-compatible DVCS that is both simple and powerful
#92> A Git-compatible DVCS that is both simple and powerful We all know the dig here - Git is not simple. Like many tools, Git has evolved significantly over the years. Git today was not like Git 10 years ago. Also, like many replacements to existing tools and software, they always start out simple and beautiful. Then they grow in complexity to serve the domain. The reason Git is complicated - not "simple" - is mostly b…
> I feel like Git is sufficiently complex - no more than it needs to be and certainly not less. Perhaps the biggest mistake (IMO) was to expose the index to the user. I happened to just watch https://www.youtube.com/watch?v=31XZYMjg93o (by the person behind Gitless). They explain the issues well there.
Shots fired.
Re: Jujutsu – A Git-compatible DVCS that is both simple and powerful
#93This seems really nice. git got the data model really right, and the user space really wrong. The data model is more important than the user space. This is the first project I've seen which appears to understand and respect /how/ and /why/ the git data model is so elegant.
> The data model is more important than the user space. For those interested in the different perspectives on how to weigh those priorities, I recommend starting here: https://en.wikipedia.org/wiki/Worse_is_better
Re: Jujutsu – A Git-compatible DVCS that is both simple and powerful
#94> A Git-compatible DVCS that is both simple and powerful We all know the dig here - Git is not simple. Like many tools, Git has evolved significantly over the years. Git today was not like Git 10 years ago. Also, like many replacements to existing tools and software, they always start out simple and beautiful. Then they grow in complexity to serve the domain. The reason Git is complicated - not "simple" - is mostly b…
After using git for 6 years git still terrifies me. After 9 months of svn I performed open heart surgery to remove a 1GB zip file that some dummy merged before anyone thought to stop him. It was at least 18 months before I tried something similar with git and I made copies of my copies to make sure I didn't fuck it up. And I still almost needed a do-over.
The level of dread I have using git is pretty close to how I feel when using a newly sharpened chef's knife - hypervigilance. And that feeling gets stronger when I hand that knife to someone else. Be very careful, that's super sharp... hold still, I'll get you a bandaid. Now you get a mini lecture on how to hold a knife without cutting yourself next time.
Re: Jujutsu – A Git-compatible DVCS that is both simple and powerful
#95Wow, this scratches a lot of my itches about Git. I teach a Git course at my alma mater, and the things that confuses people the most (the index, how to undo mistakes etc etc) all seem addressed head-on. At first glance, this seems substantially easier to teach than Git. The Git compat seems like a great idea for this to really take off. My team is totally PR based though so if/when doing (Git compatible) feature bra…
I honestly wish git forced `-p` for operations that support it. I’ve worked on too many teams where people would just commit everything in their working directory, and it would inevitably make reviewing their PRs a nightmare. Particularly with times where changes were accidentally committed wholesale that shouldn’t have been part of that set of changes.
Re: Jujutsu – A Git-compatible DVCS that is both simple and powerful
#96I wonder how this works out for large files and cleaning them up.
Re: Jujutsu – A Git-compatible DVCS that is both simple and powerful
#97The basis for it is the read-tree command.
In git, every commit is a snapshot and not a delta. (Repeat that three times.)
Any arbitrary snapshots of files can be arranged into a git history. They don't even have to be related. We could take a tarball of GCC, and make that the first commit. Then a tarball of Clang and make that the second commit.
The read-tree command will read any commit's state into the index, and from there you can make a commit out of it.
To reorder some N commits you're looking at, save all of their hashes somewhere, and then rewind the branch: git reset --hard HEAD~N. Then use git read-tree to read those hashes in whatever order you want, committing them one by one. To reuse their commit messages you have to use commit -C , though most them likely don't make any sense, because the text of commit messages usually talks about changes between a commit and its main parent.
What will happen is that your history now as N commits which represent the same states as the N you had there before, in a different order. For instance if you reverse them, then the oldest commit has all the features (is the same code baseline) as what the newest HEAD was previously. And then the subsequent child commits basically remove all the changes that were made, so the latest now looks like what the N-th looked like.
How I sometimes use this:
Suppose I made a fairly complex change that I would like to break up so that it is presented as a sequence of two or more states of the code.
There are cases when the following workflow is easy: first I make a commit out of the changes. One commit with everything. That commit is what I want the final state to look like. Then I revert some of the changes to produce the state before that state. If I have mostly been adding things, this might consist of just deleting them. Or I can do a git reset --patch HEAD^ to selectively revert. I commit this penultimate state. Then repeat the process: revert some more changes from that one, commit and so on, as many times as I see fit.
So what I end up with is the states of the code I want to present as a history, but exactly in the wrong order. Using "git rebase -i" doesn't work nicely; there are ugly conflicts, and some of them have to be encountered twice. Here is where the git read-tree trick comes into play: I simply reverse those exact states of the code to put them in the right order on the branch. After that I might do a rebase -i just to reword the commit messages to frame the code states from the POV of being changes from their parents.
You might think: why not just "git commit --patch" from the original working state to produce commits in order. The reason is that doesn't always make sense. For that you had to remember to make the commit as you were working. Because say you refactored something and then made a change. You can't easily do a "git commit --patch" which separates the refactoring from the change. Sure, if you do the refactoring and then a commit, and then make the change, you are good. But suppose you've conflated them already; now what? You can commit everything and then back out the changes that were done on top of the refactoring, and commit that. Then reorder the two states.
Re: Jujutsu – A Git-compatible DVCS that is both simple and powerful
#98Wow, this scratches a lot of my itches about Git. I teach a Git course at my alma mater, and the things that confuses people the most (the index, how to undo mistakes etc etc) all seem addressed head-on. At first glance, this seems substantially easier to teach than Git. The Git compat seems like a great idea for this to really take off. My team is totally PR based though so if/when doing (Git compatible) feature bra…
While I agree that git could use a rethink from a user tooling perspective, I really appreciate the existence of the index. I’m not tied necessarily to this specific implementation of it, but having a staging area where chunks are added piecemeal is an enormous benefit. I honestly wish git forced `-p` for operations that support it. I’ve worked on too many teams where people would just commit everything in their work…
JJ seems to workaround this in the other direction, by making the concept of commits and rebases much more lightweight, which i think is a refreshing enough take that I'd like to try it.
Re: Jujutsu – A Git-compatible DVCS that is both simple and powerful
#99" It also means that you can always check out a different commit without first explicitly committing the working copy changes (you can even check out a different commit while resolving merge conflicts)." That's really interesting. Having to manage stashes is annoying.
Try using git worktrees: https://geekmonkey.org/rethink-your-git-workflow-with-git-wo...
Re: Jujutsu – A Git-compatible DVCS that is both simple and powerful
#100Earlier quoted context omitted.
If you can rewrite the history that actually got committed, do you really need a temporary pre-commit staging area?
Yes, I do. I often do this (usually in detached HEAD mode!): : ; $EDITOR some-file ... : ; $build : ; git add -e # take a few chunks, maybe change them : ; git diff --staged; git status -uno : ; # lather, rinse, repeat : ; git commit -m '...' -ev : ; : ; git status -uno; git diff : ; git add -e # .. : ; # lather, rinse, repeat until happy : ; : ; git fetch origin : ; git rebase origin/master : ; # fix any conflicts :…
> detached HEAD mode
Ah, I see, not anymore...