author | Jonathan Nieder <jrnieder@gmail.com> | |
Tue, 22 Nov 2011 11:17:36 +0000 (05:17 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 22 Nov 2011 21:34:44 +0000 (13:34 -0800) | ||
commit | 82433cdf4d888639cecddeca162d619cf370417e | |
tree | f079ee84d7364d734bfeb24ffc17b1451a26893c | tree | snapshot |
parent | b8c74690b20b7c4dd405f71d63bab325447356da | commit | diff |
revert: write REVERT_HEAD pseudoref during conflicted revert
When conflicts are encountered while reverting a commit, it can be
handy to have the name of that commit easily available. For example,
to produce a copy of the patch to refer to while resolving conflicts:
$ git revert 2eceb2a8
error: could not revert 2eceb2a8... awesome, buggy feature
$ git show -R REVERT_HEAD >the-patch
$ edit $(git diff --name-only)
Set a REVERT_HEAD pseudoref when "git revert" does not make a commit,
for cases like this. This also makes it possible for scripts to
distinguish between a revert that encountered conflicts and other
sources of an unmerged index.
After successfully committing, resetting with "git reset", or moving
to another commit with "git checkout" or "git reset", the pseudoref is
no longer useful, so remove it.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When conflicts are encountered while reverting a commit, it can be
handy to have the name of that commit easily available. For example,
to produce a copy of the patch to refer to while resolving conflicts:
$ git revert 2eceb2a8
error: could not revert 2eceb2a8... awesome, buggy feature
$ git show -R REVERT_HEAD >the-patch
$ edit $(git diff --name-only)
Set a REVERT_HEAD pseudoref when "git revert" does not make a commit,
for cases like this. This also makes it possible for scripts to
distinguish between a revert that encountered conflicts and other
sources of an unmerged index.
After successfully committing, resetting with "git reset", or moving
to another commit with "git checkout" or "git reset", the pseudoref is
no longer useful, so remove it.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c | diff | blob | history | |
builtin/commit.c | diff | blob | history | |
builtin/revert.c | diff | blob | history | |
t/t3507-cherry-pick-conflict.sh | diff | blob | history |