Commit
81c1e0b397da27b8763bae83939c1e8c56258b49
doc: cherry-pick: note --no-commit skips CHERRY_PICK_HEAD
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, presuming the user intends to further edit the result and possibly pick more commits on top. 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 as the author. Say so where the option is described, and say that this is the point of the option rather than a wrinkle: what is being built is the user's own work, not a reproduction of the original commit. Signed-off-by: Aleksei Sviridkin <f@lex.la> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Aleksei Sviridkin <f@lex.la> · 2026-09-05 17:13 UTC · committed by Junio C Hamano
1 file changed,
+7
−1
modified Documentation/git-cherry-pick.adoc
| @@ -25,7 +25,8 @@ happens: | |||
| 25 | 25 | 1. The current branch and `HEAD` pointer stay at the last commit | |
| 26 | 26 | successfully made. | |
| 27 | 27 | 2. The `CHERRY_PICK_HEAD` ref is set to point at the commit that | |
| 28 | - | introduced the change that is difficult to apply. | |
| 28 | + | introduced the change that is difficult to apply, unless the | |
| 29 | + | `--no-commit` option was given. | |
| 29 | 30 | 3. Paths in which the change applied cleanly are updated both | |
| 30 | 31 | in the index file and in your working tree. | |
| 31 | 32 | 4. For conflicting paths, the index file records up to three | |
| @@ -101,6 +102,11 @@ OPTIONS | |||
| 101 | 102 | + | |
| 102 | 103 | This is useful when cherry-picking more than one commits' | |
| 103 | 104 | effect to your index in a row. | |
| 105 | + | + | |
| 106 | + | This option does not record `CHERRY_PICK_HEAD`, so a plain `git commit` | |
| 107 | + | afterwards records you as the author. That is by design: what you are | |
| 108 | + | building is your own work, which you keep changing before committing, | |
| 109 | + | rather than a reproduction of the original commit. | |
| 104 | 110 | ||
| 105 | 111 | -s:: | |
| 106 | 112 | --signoff:: | |