February 24th, 2008
So I have been learning about Git this weekend. It has some really nice-looking features for sure — some things Mercurial doesn’t have.
I was getting interested in switching, until I found what I consider a big problem.
Many projects that use git require you to submit things using git-format-patch instead of pushing/pulling from you. They don’t want your merge history.
git-format-patch, though, doesn’t preserve SHA1s, nor does it preserve merges.
Now, say we started from a common base where line 10 of file X said “hi”, I locally changed it to “foo”, upstream changed it to “bar”, and at merge time I decide that we were both wrong and change it to “baz”. I don’t want to lose the fact that I once had it at “foo”, in case it turns out later that really was the right decision.
When we track upstream changes, and submit with git format-patch, the canonical way to merge upstream appears to be:
git fetch; get rebase origin/master
Now, problem with that is it loses your original pre-conflict code on a case like this.
There appears to be no clean way around that whatsoever. I tried a separate “submission” branch, that rebases a local development-with-merge branch, but it requires a ton of git rebase –skip during the rebase process.