Created attachment 1777 [details] iceland.hg If I use histedit's fold capability to merge changesets, the new changeset that it creates lists me as the author, losing the authorship of the base commit that a change is being folded into. I'm having a hard time reproducing this in a small test repo, so I'll add a repro that I know works in a minute.
Repro: hg clone -r 20cbbab58e51 https://bitbucket.org/bos/text bug4296 curl curl http://bug4296.bz.selenic.com/attachment.cgi?id=1777 > bug4296.hg cat > bug4296.histedit <<EOF pick edf96f1147fa fold 202c1188e5ad fold df6d16ea4341 EOF cd bug4296 hg unbundle ../bug4296.hg hg update tip hg histedit edf96f1147fa --commands ../bug4296.histedit Once you're dropped into the editor for the first edited commit, you'll notice that the author has changed from baldurpet@gmail.com to you.
Interesting. When you observe this behavior, do the two patches not have the same author? I think there's explicit logic right now to keep the original author if the folded-together changes have the same author, otherwise to use ui.author. Does that feel wrong? I didn't put significant thought into the current behavior, I just had to pick something at the time, so a change might be welcome if there's any measure of consensus about the sensible behavior. If anyone knows what 'git rebase --interactive' does in this case, that might be useful as a datapoint as well. (I can see a fairly strong argument for keeping the author of the oldest change in the fold set. I suspect that's what you expected?)
The author of the commits I'm amending has the same email for each commit, but not the same name. I think that preserving the first author makes sense – it's certainly what I actually expected to happen :-)
Fixed by http://selenic.com/repo/hg/rev/9ac98c2aa95c Martin von Zweigbergk <martinvonz@gmail.com> histedit: preserve initial author on fold (issue4296) When the authorship of the changeset folded in does not match that of the base changeset, we currently use the configured ui.username instead. This is especially surprising when the user is not the author of either of the changesets. In such cases, the resulting authorship (the user's) is clearly incorrect. Even when the user is folding in a patch they authored themselves, it's not clear whether they should take over the authorship. Let's instead keep it simple and always preserve the base changeset's authorship. This is also how "git rebase -i" handles folding/squashing. (please test the fix)