3 ms·
jujutsu looks interesting, but one thing that i find missing from git is historical branch tracking. once two branches are merged, git does not tell me which se
by em-bee 5y ago
jujutsu looks interesting, but one thing that i find missing from git is historical branch tracking. once two branches are merged, git does not tell me which series of commits used to belong to which branch. i can't check out main from two weeks ago if a merge happened in the meantime because that information is lost.
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
- Too 5y agoGit has the concept and knowledge of which side a merge came from. A commit having multiple parents (a merge commit) maintains the order of those parents within the commit. The branch names are famously lost, but by convention you can say that the first parent should always be the main branch. As with all other git things, the ux for this feature isn’t the best and it’s use varies wildly across tools and organizations. To view the main branch log only you have to pass arcane -—left-only flags into git log. Some people don’t know the difference of merging from branch to main vs the other way around, end result looks the same right. One such mistake messes up the history.
- em-bee 5y agothat's the problem with git. it is powerful, but some things are just not practical. if i have to be careful how i merge then that's not user friendly. on the other hand, adding a field that stores the name of the branch at commit time would be almost trivial programmatically. and it would enable a much more user friendly interface.
- joseph8th 5y agoI don't need to repeat that Git has terrible UI, but you can get this "history" with `git merge --no-ff <MYBRANCH>` (no fast-forward). In fact, it's a pretty common branch-based flow. Our team pushes feature branches to remote, where they are vetted by QA, and we have a chance for review. When pulling changes into any branch, we always `git pull --rebase`. When merging feature branches, we always `--no-ff`. For small, local merges, we don't use `--no-ff` because it's useless noise. But if someone forgets out of habit... Oh well. I spend on average 0.000000001% of my time going through git log. And when I do, I tell it to show as a tree