git-imerge icon indicating copy to clipboard operation
git-imerge copied to clipboard

git-imerge continue fails with "Commit <SHA> is not usable; it is an octopus merge" when log.showSignature is set in config

Open cscutcher opened this issue 6 years ago • 2 comments

Casual investigation suggests that this is because get_commit_parents runs git log and is not expecting to see the signature in the output.

Unfortunately there doesn't seem to be an inverse of --show-signature and specifying --pretty doesn't seem to prevent the sig showing up in the output of git log. Perhaps imerge could disable this option in local config for the duration of the imerge? or use a more sophisticated way to query parents?

cscutcher avatar Feb 13 '19 13:02 cscutcher

Thanks for the report.

The core of the problem is that git-imerge uses the "porcelain" command, git log, rather than the corresponding "plumbing" command, git rev-list. (That, in turn, is because git rev-list is broken when used with --pretty.) The output of git log, being "porcelain", is not guaranteed to be stable across Git versions.

That being said, I think we can fix this particular problem by always invoking git log with an additional option to disable signature display:

git -c log.showsignature=false log [...]

NB: the new option has to come between git and log, not after log.

Do you want to try to figure out where in git-imerge that option needs to be added and submit a pull request?

mhagger avatar Mar 04 '19 09:03 mhagger

I'll try and do that when I get the chance. Cheers for the info.

cscutcher avatar Mar 06 '19 17:03 cscutcher