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

[PATCH v2] doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD

From
Aleksei Sviridkin <f@lex.la>
Date
Sep 4, 2026, 12:44 UTC
Message-ID
<20260904124435.12865-1-f@lex.la>
In-Reply-To
<20260903125524.67889-1-f@lex.la>

The list of what happens when a change is hard to apply states without qualification that CHERRY_PICK_HEAD is set. Under --no-commit it is not: d7e5c0cbfb (Introduce CHERRY_PICK_HEAD, 2011-02-19) skips the ref on purpose there, expecting the user to pick further commits and edit the result before committing.

The option's own description says nothing about the ref or about authorship. "git commit" reads the author of a cherry-pick from CHERRY_PICK_HEAD, so without it a plain commit records you, not the original author, as the author. Picking a single commit this way still leaves its log message in MERGE_MSG, so the result reads like a faithful pick apart from the author.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
---
Changes since v1:
  - dropped the t3507 test patch: the shared !opts->no_commit guard
    is already exercised by the existing clean-pick test, so it added
    no real coverage
  - keep only the doc clarification, and make the --no-commit entry
    self-contained
 Documentation/git-cherry-pick.adoc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-cherry-pick.adoc b/Documentation/git-cherry-pick.adoc
index 42b41923d5..24a28d4e65 100644
--- a/Documentation/git-cherry-pick.adoc
+++ b/Documentation/git-cherry-pick.adoc
@@ -25,7 +25,8 @@ happens:
 1. The current branch and `HEAD` pointer stay at the last commit
    successfully made.
 2. The `CHERRY_PICK_HEAD` ref is set to point at the commit that
-   introduced the change that is difficult to apply.
+   introduced the change that is difficult to apply, unless the
+   `--no-commit` option was given.
 3. Paths in which the change applied cleanly are updated both
    in the index file and in your working tree.
 4. For conflicting paths, the index file records up to three
@@ -101,6 +102,11 @@ OPTIONS
 +
 This is useful when cherry-picking more than one commits'
 effect to your index in a row.
++
+This option does not record `CHERRY_PICK_HEAD`, so a plain `git commit`
+afterwards records you, not the original author, as the author.  When a
+single commit is picked this way, `git commit -c <commit>` keeps the
+original authorship and log message.
 
 -s::
 --signoff::

base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc
-- 
2.55.0
Previous: Aleksei SviridkinNext: Junio C Hamano
Message 17 of 21 in “t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commit”
  1. 1/2 t3507: pin CHERRY_PICK_HEAD absence for a conflicting --no-commitAleksei Sviridkin, Sep 3, 2026
  2. 2/2 doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEADAleksei Sviridkin, Sep 3, 2026
  3. Junio C HamanoSep 3, 2026
  4. Aleksei SviridkinSep 3, 2026
  5. Patrick SteinhardtSep 4, 2026
  6. Aleksei SviridkinSep 4, 2026
  7. Phillip WoodSep 4, 2026
  8. Aleksei SviridkinSep 5, 2026
  9. Junio C HamanoSep 4, 2026
  10. Aleksei SviridkinSep 5, 2026
  11. Phillip WoodSep 4, 2026
  12. Junio C HamanoSep 4, 2026
  13. Phillip WoodSep 4, 2026
  14. Aleksei SviridkinSep 4, 2026
  15. Phillip WoodSep 4, 2026
  16. Aleksei SviridkinSep 5, 2026
  17. doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEADAleksei Sviridkin, Sep 4, 2026
  18. Junio C HamanoSep 5, 2026
  19. 0/2 cherry-pick: document that --no-commit skips CHERRY_PICK_HEADAleksei Sviridkin, Sep 5, 2026
  20. 1/2 t3507: check no CHERRY_PICK_HEAD after conflicting --no-commitAleksei Sviridkin, Sep 5, 2026
  21. 2/2 doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEADAleksei Sviridkin, Sep 5, 2026

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.