git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Use nice names in conflict markers during cherry-pick/revert.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 15, 2007, 06:41 UTC
Message-ID
<20070115064122.GA12372@spearce.org>

Always call the current HEAD 'HEAD', and name the patch being cherry-picked or reverted by its oneline subject rather than its SHA1. This matches git am's behavior and is done because users most commonly are cherry-picking by SHA1 rather than by ref name.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 This is on top of your prior patch "Use merge-recursive in
 git-revert/git-cherry-pick".
 git-revert.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/git-revert.sh b/git-revert.sh
index c74af99..bb8f1ca 100755
--- a/git-revert.sh
+++ b/git-revert.sh
@@ -146,6 +146,12 @@ cherry-pick)
 
 esac >.msg
 
+eval GITHEAD_$head=HEAD
+eval GITHEAD_$next='`git show -s \
+	--pretty=oneline --encoding="$encoding" "$commit" |
+	sed -e "s/^[^ ]* //"`'
+export GITHEAD_$head GITHEAD_$next
+
 # This three way merge is an interesting one.  We are at
 # $head, and would want to apply the change between $commit
 # and $prev on top of us (when reverting), or the change between
-- 
1.5.0.rc1.g4494
Message 1 of 1 in “Use nice names in conflict markers during cherry-pick/revert.”
  1. Use nice names in conflict markers during cherry-pick/revert.Shawn O. Pearce, Jan 15, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.