Skip to content

CHERRY_HEAD

Jay Soffian git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Introduce CHERRY_HEADbranch.c builtin/commit.c builtin/revert.c+22 -38 replies
2/2Teach commit to handle CHERRY_HEAD automaticallyDocumentation/git-commit.txt builtin/commit.c builtin/revert.c +1 more+37 -129 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJonathan Nieder
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC/PATCH 0/2] CHERRY_HEAD

The user-experience after a cherry-pick conflicts is suboptimal. The user has two choices for committing the resolved state:

1. To retain the original authorship and commit message, the user can 'git commit -c <original commit id>'. This is what cherry-pick itself advises. In this case MERGE_MSG (generated during the cherry-pick) is ignored. That's bad since MERGE_MSG contains the list of conflicts which is nice to have in the new commit. If 'cherry pick -x' was used, the -x annotation is lost. Asking the user to remember the original commit id is also a bit harsh.

2. To reset the authorship, the user can 'git commit'. This will use the MERGE_MSG, but the original authorship is lost.

We fix both of these issues by recording the original commit in CHERRY_HEAD if a conflict occurs during cherr-pick. We teach commit to use CHERRY_HEAD to retrieve the original authorship (unless --reset-author is used), but take the commit message from MERGE_MSG.

A further improvement would be to teach cherry-pick --continue and --abort options a la rebase, but I think that should be prototyped in shell-script.

Jay Soffian (2):
Introduce CHERRY_HEAD
Teach commit to handle CHERRY_HEAD automatically

 Documentation/git-commit.txt           |    7 +++--
 branch.c                               |    1 +
 builtin/commit.c                       |   36 ++++++++++++++++++++++++++-----
 builtin/revert.c                       |   20 ++++++++++++++++-
 contrib/completion/git-completion.bash |    2 +
 5 files changed, 55 insertions(+), 11 deletions(-)
Signature · 1 line
1.7.4.5.g9affb