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

[PATCH 1/5] git-cherry-pick.txt: do not use 'ORIG_HEAD' in example

From
Philippe Blain via GitGitGadget <gitgitgadget@gmail.com>
Date
Jan 7, 2023, 19:39 UTC
Message-ID
<74b2d5a9144e4893311d9acfb0b5e8268da6f0f0.1673120359.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1456.git.1673120359.gitgitgadget@gmail.com>
From: Philippe Blain <levraiphilippeblain@gmail.com>

Commit 67ac1e1d57 (cherry-pick/revert: add support for -X/--strategy-option, 2010-12-10) added an example to the documentation of 'git cherry-pick'. This example mentions how to abort a failed cherry-pick and retry with an additional merge strategy option.

The command used in the example to abort the cherry-pick is 'git reset --merge ORIG_HEAD', but cherry-pick does not write 'ORIG_HEAD' before starting its operation. So this command would checkout a commit unrelated to what was at HEAD when the user invoked cherry-pick.

Use 'git cherry-pick --abort' instead.
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/git-cherry-pick.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index 1e8ac9df602..fdcad3d2006 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -219,7 +219,7 @@ again, this time exercising more care about matching up context lines.
 ------------
 $ git cherry-pick topic^             <1>
 $ git diff                           <2>
-$ git reset --merge ORIG_HEAD        <3>
+$ git cherry-pick --abort            <3>
 $ git cherry-pick -Xpatience topic^  <4>
 ------------
 <1> apply the change that would be shown by `git show topic^`.
-- 
gitgitgadget
Previous: Philippe Blain via GitGitGadgetNext: Junio C Hamano
Message 2 of 20 in “Documentation: updates and a correction around 'ORIG_HEAD'”
  1. 0/5 Documentation: updates and a correction around 'ORIG_HEAD'Philippe Blain via GitGitGadget, Jan 7, 2023
  2. 1/5 git-cherry-pick.txt: do not use 'ORIG_HEAD' in examplePhilippe Blain via GitGitGadget, Jan 7, 2023
  3. Junio C HamanoJan 8, 2023
  4. Philippe BlainJan 9, 2023
  5. 2/5 git-reset.txt: mention 'ORIG_HEAD' in the DescriptionPhilippe Blain via GitGitGadget, Jan 7, 2023
  6. 3/5 git-merge.txt: mention 'ORIG_HEAD' in the DescriptionPhilippe Blain via GitGitGadget, Jan 7, 2023
  7. 4/5 revisions.txt: be explicit about commands writing 'ORIG_HEAD'Philippe Blain via GitGitGadget, Jan 7, 2023
  8. Junio C HamanoJan 8, 2023
  9. Philippe BlainJan 9, 2023
  10. 5/5 git-rebase.txt: add a note about 'ORIG_HEAD' being overwrittenPhilippe Blain via GitGitGadget, Jan 7, 2023
  11. Junio C HamanoJan 8, 2023
  12. Philippe BlainJan 9, 2023
  13. 0/5 Documentation: updates and a correction around 'ORIG_HEAD'Philippe Blain via GitGitGadget, Jan 10, 2023
  14. 1/5 git-cherry-pick.txt: do not use 'ORIG_HEAD' in examplePhilippe Blain via GitGitGadget, Jan 10, 2023
  15. 2/5 git-reset.txt: mention 'ORIG_HEAD' in the DescriptionPhilippe Blain via GitGitGadget, Jan 10, 2023
  16. 3/5 git-merge.txt: mention 'ORIG_HEAD' in the DescriptionPhilippe Blain via GitGitGadget, Jan 10, 2023
  17. 4/5 revisions.txt: be explicit about commands writing 'ORIG_HEAD'Philippe Blain via GitGitGadget, Jan 10, 2023
  18. 5/5 git-rebase.txt: add a note about 'ORIG_HEAD' being overwrittenPhilippe Blain via GitGitGadget, Jan 10, 2023
  19. Phillip WoodJan 10, 2023
  20. Junio C HamanoJan 13, 2023

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.