summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorRalf Thielow <ralf.thielow@gmail.com>2013-10-11 17:58:37 +0200
committerJonathan Nieder <jrnieder@gmail.com>2013-10-11 10:42:45 -0700
commitbffd8098705ffcfeb267951dcdd4e49dd188a7bb (patch)
treed8b107469d52e44ae8fffd0fd2b8125fc35c390b /wt-status.c
parent59c222052801a55bb40a78378ea19c6b7c4ec45d (diff)
downloadgit-bffd8098705ffcfeb267951dcdd4e49dd188a7bb.tar.gz
status: show commit sha1 in "You are currently cherry-picking" messagert/cherry-pick-status
Especially helpful when cherry-picking multiple commits. Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/wt-status.c b/wt-status.c
index cbdce72651..b4e44baa29 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -996,7 +996,8 @@ static void show_cherry_pick_in_progress(struct wt_status *s,
struct wt_status_state *state,
const char *color)
{
- status_printf_ln(s, color, _("You are currently cherry-picking."));
+ status_printf_ln(s, color, _("You are currently cherry-picking commit %s."),
+ find_unique_abbrev(state->cherry_pick_head_sha1, DEFAULT_ABBREV));
if (s->hints) {
if (has_unmerged(s))
status_printf_ln(s, color,
@@ -1169,8 +1170,10 @@ void wt_status_get_state(struct wt_status_state *state,
state->rebase_in_progress = 1;
state->branch = read_and_strip_branch("rebase-merge/head-name");
state->onto = read_and_strip_branch("rebase-merge/onto");
- } else if (!stat(git_path("CHERRY_PICK_HEAD"), &st)) {
+ } else if (!stat(git_path("CHERRY_PICK_HEAD"), &st) &&
+ !get_sha1("CHERRY_PICK_HEAD", sha1)) {
state->cherry_pick_in_progress = 1;
+ hashcpy(state->cherry_pick_head_sha1, sha1);
}
if (!stat(git_path("BISECT_LOG"), &st)) {
state->bisect_in_progress = 1;