summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-06-16 08:45:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-17 16:59:47 (GMT)
commitec5063106449aa8c6623abbdcca862dd1516c920 (patch)
treec3d168ffae1476844b9b0b97d83e1a69091d4f7e /wt-status.c
parent89f2fea49a246e9ac4fa94cb43a7e992a8a4a144 (diff)
downloadgit-ec5063106449aa8c6623abbdcca862dd1516c920.zip
git-ec5063106449aa8c6623abbdcca862dd1516c920.tar.gz
git-ec5063106449aa8c6623abbdcca862dd1516c920.tar.bz2
status: do not depend on rebase reflog messages
b397ea4 (status: show more info than "currently not on any branch", 2013-03-13) attempted to make the output of 'git status' richer in the case of a detached HEAD. Before this patch, with a detached HEAD, we saw: $ git status # Not currently on any branch. But after the patch, we see: $ git checkout v1.8.2 $ git status # HEAD detached at v1.8.2. It works by digging the reflog for the most recent message of the form "checkout: moving from xxxx to yyyy". It then asserts that HEAD and "yyyy" are the same, and displays this message. When they aren't equal, it displays: $ git status # HEAD detached from fe11db. so that the user can see where the HEAD was first detached. In case of a rebase [-i] operation in progress, this message depends on the implementation of rebase writing "checkout: " messages to the reflog, but that is an implementation detail of "rebase". To remove this dependency so that rebase can be updated to write better reflog messages, replace this "HEAD detached from" message with: # rebase in progress; onto $ONTO Changes to the commit object name in the expected output for some of the tests shows that what the test expected "status" to show during "rebase -i" was not consistent with the output during a vanilla "rebase", which showed on top of what commit the series is being replayed. Now we consistently expect something meaningful to the end user. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/wt-status.c b/wt-status.c
index 2511270..85a00f1 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1174,7 +1174,10 @@ void wt_status_print(struct wt_status *s)
branch_name += 11;
else if (!strcmp(branch_name, "HEAD")) {
branch_status_color = color(WT_STATUS_NOBRANCH, s);
- if (state.detached_from) {
+ if (state.rebase_in_progress || state.rebase_interactive_in_progress) {
+ on_what = _("rebase in progress; onto ");
+ branch_name = state.onto;
+ } else if (state.detached_from) {
unsigned char sha1[20];
branch_name = state.detached_from;
if (!get_sha1("HEAD", sha1) &&