threads / discuss / 32098

Commit message problem of reverting multiple commits

Subject: Commit message problem of reverting multiple commits

## tl;dr

2 messages between Nov 13, 2012 and Nov 13, 2012.

replies: 1people: 2as markdown or json

乙酸鋰· Nov 13, 2012, 15:15 UTC · lore
Hi,
I ran git 1.8.0 command line
git revert --no-commit rev1 rev2
I see a prepared commit message like

Revert "<description from one commit>" This reverts commit <SHA1 of one commit>.

The actual revert content is correct - it is all the relevant commits that were selected. I expect the message to reflect this:

Revert "<description from commit1>", "<description from commit2>" This reverts commits <SHA1 of commit1>, <SHA1 of commit2>.

Regards, ch3cooli

Junio C Hamano· Nov 13, 2012, 16:34 UTC · re: 乙酸鋰 · lore

Re: Commit message problem of reverting multiple commits

乙酸鋰 <ch3cooli@gmail.com> writes:
Show 15 quoted lines
> I ran git 1.8.0 command line
>
> git revert --no-commit rev1 rev2
>
> I see a prepared commit message like
>
> Revert "<description from one commit>"
> This reverts commit <SHA1 of one commit>.
>
>
> The actual revert content is correct - it is all the relevant commits
> that were selected. I expect the message to reflect this:
>
> Revert "<description from commit1>", "<description from commit2>"
> This reverts commits <SHA1 of commit1>, <SHA1 of commit2>.
Hrmph.  I actually think the revert-content is not correct.

I think the command should not take more than one commit on the command line when --no-commit is in use in the first place (the same thing can be said for cherry-pick). After all, "git revert rev1 rev2" is to revert rev1 and then rev2 independently, so unless that option is spelled "--squash", the resulting history should have two commits that reverts rev1 and rev2 independently.

← back to recent threads