Thread (8 messages) flat view 8 messages, 2 authors, 2016-06-15

Re: [PATCH v2 5/6] status: do not depend on rebase reflog messages

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:47

Ramkumar Ramachandra [off-list ref] writes:
quoted hunk ↗ jump to hunk
diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index bf08d4e..739624e 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -188,10 +188,9 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short HEAD~2) &&
-	TGT=$(git rev-parse --short two_rebase_i) &&
 	git rebase -i HEAD~2 &&
 	cat >expected <<-EOF &&
-	# HEAD detached from $TGT
+	# rebase in progress; onto $ONTO
 	# You are currently editing a commit while rebasing branch '\''rebase_i_edit'\'' on '\''$ONTO'\''.
 	#   (use "git commit --amend" to amend the current commit)
 	#   (use "git rebase --continue" once you are satisfied with your changes)
This hunk (and others that used to use $TGT) shows that the original
test was depending too much on the implementation detail (i.e. that
rebase/rebase-i internally uses checkout to affect the reflog, making
the info shown as "detached from/at" not useful during "rebase").
This step may have started as a workaround against the fallout from 6/6,
but I think this is a good change by itself independent of "checkut -"
fix, which is the main topic of this series.
quoted hunk ↗ jump to hunk
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;
The part after "||" is what I missed in the "how about an approach
along this line" patch.

Good job.
+			} else if (state.detached_from) {
 				unsigned char sha1[20];
 				branch_name = state.detached_from;
 				if (!get_sha1("HEAD", sha1) &&
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help