git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v4 0/4] More helpful 'git status' during 'rebase -i'
@ 2015-06-30 13:01 Matthieu Moy
  2015-06-30 13:01 ` [PATCH v4 1/4] status: factor two rebase-related messages together Matthieu Moy
                   ` (4 more replies)
  0 siblings, 5 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-06-30 13:01 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

This series makes "git status" provide an output like

  interactive rebase in progress; onto $ONTO
  Last commands done (2 commands done):
     pick $COMMIT2 two_commit
     exec exit 15
  Next commands to do (2 remaining commands):
     pick $COMMIT3 three_commit
     pick $COMMIT4 four_commit
    (use "git rebase --edit-todo" to view and edit)

in addition to the existing output, when ran during an interactive
rebase.

Previous version here:

  http://thread.gmane.org/gmane.comp.version-control.git/271184

I just fixed the missing newline I noticed, and squashed Junio's
indentation fix. These were the only two remarks on the last
iteration.

Guillaume Pagès (4):
  status: factor two rebase-related messages together
  status: differentiate interactive from non-interactive rebases
  status: give more information during rebase -i
  status: add new tests for status during rebase -i

 t/t7512-status-help.sh | 226 ++++++++++++++++++++++++++++++++++++++++++++++---
 wt-status.c            | 100 ++++++++++++++++++----
 2 files changed, 295 insertions(+), 31 deletions(-)

-- 
2.5.0.rc0.10.g7792c2a

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v4 1/4] status: factor two rebase-related messages together
  2015-06-30 13:01 [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Matthieu Moy
@ 2015-06-30 13:01 ` Matthieu Moy
  2015-06-30 13:01 ` [PATCH v4 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-06-30 13:01 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 wt-status.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index eaed4fe..8c4b806 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1027,6 +1027,20 @@ static int split_commit_in_progress(struct wt_status *s)
 	return split_in_progress;
 }
 
+static void print_rebase_state(struct wt_status *s,
+				struct wt_status_state *state,
+				const char *color)
+{
+	if (state->branch)
+		status_printf_ln(s, color,
+				 _("You are currently rebasing branch '%s' on '%s'."),
+				 state->branch,
+				 state->onto);
+	else
+		status_printf_ln(s, color,
+				 _("You are currently rebasing."));
+}
+
 static void show_rebase_in_progress(struct wt_status *s,
 				struct wt_status_state *state,
 				const char *color)
@@ -1034,14 +1048,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 	struct stat st;
 
 	if (has_unmerged(s)) {
-		if (state->branch)
-			status_printf_ln(s, color,
-					 _("You are currently rebasing branch '%s' on '%s'."),
-					 state->branch,
-					 state->onto);
-		else
-			status_printf_ln(s, color,
-					 _("You are currently rebasing."));
+		print_rebase_state(s, state, color);
 		if (s->hints) {
 			status_printf_ln(s, color,
 				_("  (fix conflicts and then run \"git rebase --continue\")"));
@@ -1051,14 +1058,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 				_("  (use \"git rebase --abort\" to check out the original branch)"));
 		}
 	} else if (state->rebase_in_progress || !stat(git_path("MERGE_MSG"), &st)) {
-		if (state->branch)
-			status_printf_ln(s, color,
-					 _("You are currently rebasing branch '%s' on '%s'."),
-					 state->branch,
-					 state->onto);
-		else
-			status_printf_ln(s, color,
-					 _("You are currently rebasing."));
+		print_rebase_state(s, state, color);
 		if (s->hints)
 			status_printf_ln(s, color,
 				_("  (all conflicts fixed: run \"git rebase --continue\")"));
-- 
2.5.0.rc0.10.g7792c2a

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v4 2/4] status: differentiate interactive from non-interactive rebases
  2015-06-30 13:01 [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Matthieu Moy
  2015-06-30 13:01 ` [PATCH v4 1/4] status: factor two rebase-related messages together Matthieu Moy
@ 2015-06-30 13:01 ` Matthieu Moy
  2015-06-30 13:01 ` [PATCH v4 3/4] status: give more information during rebase -i Matthieu Moy
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-06-30 13:01 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 t/t7512-status-help.sh | 28 ++++++++++++++--------------
 wt-status.c            |  5 ++++-
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 68ad2d7..190656d 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -136,7 +136,7 @@ test_expect_success 'status during rebase -i when conflicts unresolved' '
 	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (fix conflicts and then run "git rebase --continue")
   (use "git rebase --skip" to skip this patch)
@@ -162,7 +162,7 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	git add main.txt &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (all conflicts fixed: run "git rebase --continue")
 
@@ -190,7 +190,7 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	ONTO=$(git rev-parse --short HEAD~2) &&
 	git rebase -i HEAD~2 &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive 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)
@@ -216,7 +216,7 @@ test_expect_success 'status when splitting a commit' '
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -247,7 +247,7 @@ test_expect_success 'status after editing the last commit with --amend during a
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -277,7 +277,7 @@ test_expect_success 'status: (continue first edit) second edit' '
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -299,7 +299,7 @@ test_expect_success 'status: (continue first edit) second edit and split' '
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -326,7 +326,7 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
 	git rebase --continue &&
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -348,7 +348,7 @@ test_expect_success 'status: (amend first edit) second edit' '
 	git commit --amend -m "a" &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -371,7 +371,7 @@ test_expect_success 'status: (amend first edit) second edit and split' '
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -399,7 +399,7 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
 	git rebase --continue &&
 	git commit --amend -m "d" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -423,7 +423,7 @@ test_expect_success 'status: (split first edit) second edit' '
 	git commit -m "e" &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -448,7 +448,7 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -478,7 +478,7 @@ test_expect_success 'status: (split first edit) second edit and amend' '
 	git rebase --continue &&
 	git commit --amend -m "h" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
diff --git a/wt-status.c b/wt-status.c
index 8c4b806..81610dc 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1328,7 +1328,10 @@ void wt_status_print(struct wt_status *s)
 		else if (!strcmp(branch_name, "HEAD")) {
 			branch_status_color = color(WT_STATUS_NOBRANCH, s);
 			if (state.rebase_in_progress || state.rebase_interactive_in_progress) {
-				on_what = _("rebase in progress; onto ");
+				if (state.rebase_interactive_in_progress)
+					on_what = _("interactive rebase in progress; onto ");
+				else
+					on_what = _("rebase in progress; onto ");
 				branch_name = state.onto;
 			} else if (state.detached_from) {
 				branch_name = state.detached_from;
-- 
2.5.0.rc0.10.g7792c2a

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v4 3/4] status: give more information during rebase -i
  2015-06-30 13:01 [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Matthieu Moy
  2015-06-30 13:01 ` [PATCH v4 1/4] status: factor two rebase-related messages together Matthieu Moy
  2015-06-30 13:01 ` [PATCH v4 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
@ 2015-06-30 13:01 ` Matthieu Moy
  2015-06-30 13:01 ` [PATCH v4 4/4] status: add new tests for status " Matthieu Moy
  2015-06-30 23:03 ` [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Junio C Hamano
  4 siblings, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-06-30 13:01 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

git status gives more information during rebase -i, about the list of
command that are done during the rebase. It displays the two last
commands executed and the two next lines to be executed. It also gives
hints to find the whole files in .git directory.

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 t/t7512-status-help.sh | 111 +++++++++++++++++++++++++++++++++++++++++++++++++
 wt-status.c            |  63 ++++++++++++++++++++++++++++
 2 files changed, 174 insertions(+)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 190656d..0c889fa 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -134,9 +134,13 @@ test_expect_success 'prepare for rebase_i_conflicts' '
 test_expect_success 'status during rebase -i when conflicts unresolved' '
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
+	LAST_COMMIT=$(git rev-parse rebase_i_conflicts_second) &&
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last command done (1 command done):
+   pick $LAST_COMMIT one_second
+No commands remaining.
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (fix conflicts and then run "git rebase --continue")
   (use "git rebase --skip" to skip this patch)
@@ -159,10 +163,14 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
 	git reset --hard rebase_i_conflicts_second &&
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
+	LAST_COMMIT=$(git rev-parse rebase_i_conflicts_second) &&
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	git add main.txt &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last command done (1 command done):
+   pick $LAST_COMMIT one_second
+No commands remaining.
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (all conflicts fixed: run "git rebase --continue")
 
@@ -183,7 +191,9 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	git checkout -b rebase_i_edit &&
 	test_commit one_rebase_i main.txt one &&
 	test_commit two_rebase_i main.txt two &&
+	COMMIT2=$(git rev-parse rebase_i_edit) &&
 	test_commit three_rebase_i main.txt three &&
+	COMMIT3=$(git rev-parse rebase_i_edit) &&
 	FAKE_LINES="1 edit 2" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
@@ -191,6 +201,10 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	git rebase -i HEAD~2 &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   pick $COMMIT2 two_rebase_i
+   edit $COMMIT3 three_rebase_i
+No commands remaining.
 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)
@@ -207,8 +221,11 @@ test_expect_success 'status when splitting a commit' '
 	git checkout -b split_commit &&
 	test_commit one_split main.txt one &&
 	test_commit two_split main.txt two &&
+	COMMIT2=$(git rev-parse split_commit) &&
 	test_commit three_split main.txt three &&
+	COMMIT3=$(git rev-parse split_commit) &&
 	test_commit four_split main.txt four &&
+	COMMIT4=$(git rev-parse split_commit) &&
 	FAKE_LINES="1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
@@ -217,6 +234,12 @@ test_expect_success 'status when splitting a commit' '
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   pick $COMMIT2 two_split
+   edit $COMMIT3 three_split
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_split
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -239,7 +262,9 @@ test_expect_success 'status after editing the last commit with --amend during a
 	test_commit one_amend main.txt one &&
 	test_commit two_amend main.txt two &&
 	test_commit three_amend main.txt three &&
+	COMMIT3=$(git rev-parse amend_last) &&
 	test_commit four_amend main.txt four &&
+	COMMIT4=$(git rev-parse amend_last) &&
 	FAKE_LINES="1 2 edit 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
@@ -248,6 +273,11 @@ test_expect_success 'status after editing the last commit with --amend during a
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (3 commands done):
+   pick $COMMIT3 three_amend
+   edit $COMMIT4 four_amend
+  (see more in file .git/rebase-merge/done)
+No commands remaining.
 You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -273,11 +303,20 @@ test_expect_success 'status: (continue first edit) second edit' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse several_edits^^) &&
+	COMMIT3=$(git rev-parse several_edits^) &&
+	COMMIT4=$(git rev-parse several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -294,12 +333,21 @@ test_expect_success 'status: (continue first edit) second edit and split' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse several_edits^^) &&
+	COMMIT3=$(git rev-parse several_edits^) &&
+	COMMIT4=$(git rev-parse several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -321,12 +369,21 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse several_edits^^) &&
+	COMMIT3=$(git rev-parse several_edits^) &&
+	COMMIT4=$(git rev-parse several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -343,12 +400,21 @@ test_expect_success 'status: (amend first edit) second edit' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse several_edits^^) &&
+	COMMIT3=$(git rev-parse several_edits^) &&
+	COMMIT4=$(git rev-parse several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "a" &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -366,12 +432,21 @@ test_expect_success 'status: (amend first edit) second edit and split' '
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
+	COMMIT2=$(git rev-parse several_edits^^) &&
+	COMMIT3=$(git rev-parse several_edits^) &&
+	COMMIT4=$(git rev-parse several_edits) &&
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "b" &&
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -393,6 +468,9 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse several_edits^^) &&
+	COMMIT3=$(git rev-parse several_edits^) &&
+	COMMIT4=$(git rev-parse several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "c" &&
@@ -400,6 +478,12 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
 	git commit --amend -m "d" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -416,6 +500,9 @@ test_expect_success 'status: (split first edit) second edit' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse several_edits^^) &&
+	COMMIT3=$(git rev-parse several_edits^) &&
+	COMMIT4=$(git rev-parse several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
@@ -424,6 +511,12 @@ test_expect_success 'status: (split first edit) second edit' '
 	git rebase --continue &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -440,6 +533,9 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse several_edits^^) &&
+	COMMIT3=$(git rev-parse several_edits^) &&
+	COMMIT4=$(git rev-parse several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
@@ -449,6 +545,12 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -470,6 +572,9 @@ test_expect_success 'status: (split first edit) second edit and amend' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse several_edits^^) &&
+	COMMIT3=$(git rev-parse several_edits^) &&
+	COMMIT4=$(git rev-parse several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
@@ -479,6 +584,12 @@ test_expect_success 'status: (split first edit) second edit and amend' '
 	git commit --amend -m "h" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
diff --git a/wt-status.c b/wt-status.c
index 81610dc..9c686e6 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1027,6 +1027,68 @@ static int split_commit_in_progress(struct wt_status *s)
 	return split_in_progress;
 }
 
+static void show_rebase_information(struct wt_status *s,
+					struct wt_status_state *state,
+					const char *color)
+{
+	if (state->rebase_interactive_in_progress) {
+		int i;
+		int nr_lines_to_show = 2;
+
+		struct strbuf buf = STRBUF_INIT;
+		struct string_list have_done = STRING_LIST_INIT_DUP;
+		struct string_list yet_to_do = STRING_LIST_INIT_DUP;
+
+		strbuf_read_file(&buf, git_path("rebase-merge/done"), 0);
+		stripspace(&buf, 1);
+		string_list_split(&have_done, buf.buf, '\n', -1);
+		string_list_remove_empty_items(&have_done, 1);
+		strbuf_release(&buf);
+
+		strbuf_read_file(&buf, git_path("rebase-merge/git-rebase-todo"), 0);
+		stripspace(&buf, 1);
+		string_list_split(&yet_to_do, buf.buf, '\n', -1);
+		string_list_remove_empty_items(&yet_to_do, 1);
+		strbuf_release(&buf);
+
+		if (have_done.nr == 0)
+			status_printf_ln(s, color, _("No commands done."));
+		else {
+			status_printf_ln(s, color,
+				Q_("Last command done (%d command done):",
+					"Last commands done (%d commands done):",
+					have_done.nr),
+				have_done.nr);
+			for (i = (have_done.nr > nr_lines_to_show)
+				? have_done.nr - nr_lines_to_show : 0;
+				i < have_done.nr;
+				i++)
+				status_printf_ln(s, color, "   %s", have_done.items[i].string);
+			if (have_done.nr > nr_lines_to_show && s->hints)
+				status_printf_ln(s, color,
+					_("  (see more in file %s)"), git_path("rebase-merge/done"));
+		}
+
+		if (yet_to_do.nr == 0)
+			status_printf_ln(s, color,
+					 _("No commands remaining."));
+		else {
+			status_printf_ln(s, color,
+				Q_("Next command to do (%d remaining command):",
+					"Next commands to do (%d remaining commands):",
+					yet_to_do.nr),
+				yet_to_do.nr);
+			for (i = 0; i < nr_lines_to_show && i < yet_to_do.nr; i++)
+				status_printf_ln(s, color, "   %s", yet_to_do.items[i].string);
+			if (s->hints)
+				status_printf_ln(s, color,
+					_("  (use \"git rebase --edit-todo\" to view and edit)"));
+		}
+		string_list_clear(&yet_to_do, 0);
+		string_list_clear(&have_done, 0);
+	}
+}
+
 static void print_rebase_state(struct wt_status *s,
 				struct wt_status_state *state,
 				const char *color)
@@ -1047,6 +1109,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 {
 	struct stat st;
 
+	show_rebase_information(s, state, color);
 	if (has_unmerged(s)) {
 		print_rebase_state(s, state, color);
 		if (s->hints) {
-- 
2.5.0.rc0.10.g7792c2a

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v4 4/4] status: add new tests for status during rebase -i
  2015-06-30 13:01 [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Matthieu Moy
                   ` (2 preceding siblings ...)
  2015-06-30 13:01 ` [PATCH v4 3/4] status: give more information during rebase -i Matthieu Moy
@ 2015-06-30 13:01 ` Matthieu Moy
  2015-06-30 23:03 ` [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Junio C Hamano
  4 siblings, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-06-30 13:01 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Expand test coverage with one or more than two commands done
and with zero, one or more than two commands remaining.

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 t/t7512-status-help.sh | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 0c889fa..cbe27f9 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -856,4 +856,91 @@ EOF
 	test_i18ncmp expected actual
 '
 
+test_expect_success 'prepare for different number of commits rebased' '
+	git reset --hard master &&
+	git checkout -b several_commits &&
+	test_commit one_commit main.txt one &&
+	test_commit two_commit main.txt two &&
+	test_commit three_commit main.txt three &&
+	test_commit four_commit main.txt four
+'
+
+test_expect_success 'status: one command done nothing remaining' '
+	FAKE_LINES="exec_exit_15" &&
+	export FAKE_LINES &&
+	test_when_finished "git rebase --abort" &&
+	ONTO=$(git rev-parse --short HEAD~3) &&
+	test_must_fail git rebase -i HEAD~3 &&
+	cat >expected <<EOF &&
+interactive rebase in progress; onto $ONTO
+Last command done (1 command done):
+   exec exit 15
+No commands remaining.
+You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
+  (use "git commit --amend" to amend the current commit)
+  (use "git rebase --continue" once you are satisfied with your changes)
+
+nothing to commit (use -u to show untracked files)
+EOF
+	git status --untracked-files=no >actual &&
+	test_i18ncmp expected actual
+'
+
+test_expect_success 'status: two commands done with some white lines in done file' '
+	FAKE_LINES="1 > exec_exit_15  2 3" &&
+	export FAKE_LINES &&
+	test_when_finished "git rebase --abort" &&
+	ONTO=$(git rev-parse --short HEAD~3) &&
+	COMMIT4=$(git rev-parse HEAD) &&
+	COMMIT3=$(git rev-parse HEAD^) &&
+	COMMIT2=$(git rev-parse HEAD^^) &&
+	test_must_fail git rebase -i HEAD~3 &&
+	cat >expected <<EOF &&
+interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   pick $COMMIT2 two_commit
+   exec exit 15
+Next commands to do (2 remaining commands):
+   pick $COMMIT3 three_commit
+   pick $COMMIT4 four_commit
+  (use "git rebase --edit-todo" to view and edit)
+You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
+  (use "git commit --amend" to amend the current commit)
+  (use "git rebase --continue" once you are satisfied with your changes)
+
+nothing to commit (use -u to show untracked files)
+EOF
+	git status --untracked-files=no >actual &&
+	test_i18ncmp expected actual
+'
+
+test_expect_success 'status: two remaining commands with some white lines in todo file' '
+	FAKE_LINES="1 2 exec_exit_15 3 > 4" &&
+	export FAKE_LINES &&
+	test_when_finished "git rebase --abort" &&
+	ONTO=$(git rev-parse --short HEAD~4) &&
+	COMMIT4=$(git rev-parse HEAD) &&
+	COMMIT3=$(git rev-parse HEAD^) &&
+	COMMIT2=$(git rev-parse HEAD^^) &&
+	test_must_fail git rebase -i HEAD~4 &&
+	cat >expected <<EOF &&
+interactive rebase in progress; onto $ONTO
+Last commands done (3 commands done):
+   pick $COMMIT2 two_commit
+   exec exit 15
+  (see more in file .git/rebase-merge/done)
+Next commands to do (2 remaining commands):
+   pick $COMMIT3 three_commit
+   pick $COMMIT4 four_commit
+  (use "git rebase --edit-todo" to view and edit)
+You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
+  (use "git commit --amend" to amend the current commit)
+  (use "git rebase --continue" once you are satisfied with your changes)
+
+nothing to commit (use -u to show untracked files)
+EOF
+	git status --untracked-files=no >actual &&
+	test_i18ncmp expected actual
+'
+
 test_done
-- 
2.5.0.rc0.10.g7792c2a

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v4 0/4] More helpful 'git status' during 'rebase -i'
  2015-06-30 13:01 [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Matthieu Moy
                   ` (3 preceding siblings ...)
  2015-06-30 13:01 ` [PATCH v4 4/4] status: add new tests for status " Matthieu Moy
@ 2015-06-30 23:03 ` Junio C Hamano
  2015-07-01  8:12   ` Matthieu Moy
  4 siblings, 1 reply; 26+ messages in thread
From: Junio C Hamano @ 2015-06-30 23:03 UTC (permalink / raw)
  To: Matthieu Moy
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

Matthieu Moy <Matthieu.Moy@imag.fr> writes:

> This series makes "git status" provide an output like
>
>   interactive rebase in progress; onto $ONTO
>   Last commands done (2 commands done):
>      pick $COMMIT2 two_commit
>      exec exit 15
>   Next commands to do (2 remaining commands):
>      pick $COMMIT3 three_commit
>      pick $COMMIT4 four_commit
>     (use "git rebase --edit-todo" to view and edit)
>
> in addition to the existing output, when ran during an interactive
> rebase.

I'd prefer to see these $COMMITn abbreviated, just like $ONTO.  Look
what I just got while squashing two adjacent patches ;-)

# interactive rebase in progress; onto a04bfc2
# Last commands done (2 commands done):
#    pick c186b073f46a3298f2e6f63a8c1becb07bedc4f0 rerere: explain what 'want_sp' does to is_cmarker
#    squash 17c5b40b46c0e171ed49907e6cb91c2a1d7f7113 rerere: drop want_sp parameter from is_cmarker()
# Next commands to do (3 remaining commands):
#    pick 8fc64c4c1024006e71cf0b6c2e3d0ad403f263f8 t4200: rerere a merge with two identical conflicts
#    pick 094950cdc51599f6fec1b1c0098816888a648bf8 rerere: document internal I/O abstraction
# You are currently editing a commit while rebasing branch 'jc/rerere' on 'a04bfc2'.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v4 0/4] More helpful 'git status' during 'rebase -i'
  2015-06-30 23:03 ` [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Junio C Hamano
@ 2015-07-01  8:12   ` Matthieu Moy
  2015-07-01  8:30     ` [PATCH v5 1/4] status: factor two rebase-related messages together Matthieu Moy
  0 siblings, 1 reply; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01  8:12 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

Junio C Hamano <gitster@pobox.com> writes:

> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> This series makes "git status" provide an output like
>>
>>   interactive rebase in progress; onto $ONTO
>>   Last commands done (2 commands done):
>>      pick $COMMIT2 two_commit
>>      exec exit 15
>>   Next commands to do (2 remaining commands):
>>      pick $COMMIT3 three_commit
>>      pick $COMMIT4 four_commit
>>     (use "git rebase --edit-todo" to view and edit)
>>
>> in addition to the existing output, when ran during an interactive
>> rebase.
>
> I'd prefer to see these $COMMITn abbreviated, just like $ONTO.

Indeed. It's not as easy as it would seem because we're in wt-status.c
and can't call a shell function like collapse_todo_ids directly, but
I've re-implemented it in C, it's not that bad.

Patch follows. The first two patches are unchanged. wt-status.c now
abbreviates the sha1, and the tests are adapted (rev-parse -> rev-parse
--short) where needed in patch 3 and 4.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v5 1/4] status: factor two rebase-related messages together
  2015-07-01  8:12   ` Matthieu Moy
@ 2015-07-01  8:30     ` Matthieu Moy
  2015-07-01  8:30       ` [PATCH v5 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
                         ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01  8:30 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
No change since v4.

 wt-status.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index eaed4fe..8c4b806 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1027,6 +1027,20 @@ static int split_commit_in_progress(struct wt_status *s)
 	return split_in_progress;
 }
 
+static void print_rebase_state(struct wt_status *s,
+				struct wt_status_state *state,
+				const char *color)
+{
+	if (state->branch)
+		status_printf_ln(s, color,
+				 _("You are currently rebasing branch '%s' on '%s'."),
+				 state->branch,
+				 state->onto);
+	else
+		status_printf_ln(s, color,
+				 _("You are currently rebasing."));
+}
+
 static void show_rebase_in_progress(struct wt_status *s,
 				struct wt_status_state *state,
 				const char *color)
@@ -1034,14 +1048,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 	struct stat st;
 
 	if (has_unmerged(s)) {
-		if (state->branch)
-			status_printf_ln(s, color,
-					 _("You are currently rebasing branch '%s' on '%s'."),
-					 state->branch,
-					 state->onto);
-		else
-			status_printf_ln(s, color,
-					 _("You are currently rebasing."));
+		print_rebase_state(s, state, color);
 		if (s->hints) {
 			status_printf_ln(s, color,
 				_("  (fix conflicts and then run \"git rebase --continue\")"));
@@ -1051,14 +1058,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 				_("  (use \"git rebase --abort\" to check out the original branch)"));
 		}
 	} else if (state->rebase_in_progress || !stat(git_path("MERGE_MSG"), &st)) {
-		if (state->branch)
-			status_printf_ln(s, color,
-					 _("You are currently rebasing branch '%s' on '%s'."),
-					 state->branch,
-					 state->onto);
-		else
-			status_printf_ln(s, color,
-					 _("You are currently rebasing."));
+		print_rebase_state(s, state, color);
 		if (s->hints)
 			status_printf_ln(s, color,
 				_("  (all conflicts fixed: run \"git rebase --continue\")"));
-- 
2.5.0.rc0.7.ge1edd74

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v5 2/4] status: differentiate interactive from non-interactive rebases
  2015-07-01  8:30     ` [PATCH v5 1/4] status: factor two rebase-related messages together Matthieu Moy
@ 2015-07-01  8:30       ` Matthieu Moy
  2015-07-01  8:30       ` [PATCH v5 3/4] status: give more information during rebase -i Matthieu Moy
  2015-07-01  8:30       ` [PATCH v5 4/4] status: add new tests for status " Matthieu Moy
  2 siblings, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01  8:30 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
No change since v4.

 t/t7512-status-help.sh | 28 ++++++++++++++--------------
 wt-status.c            |  5 ++++-
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 68ad2d7..190656d 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -136,7 +136,7 @@ test_expect_success 'status during rebase -i when conflicts unresolved' '
 	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (fix conflicts and then run "git rebase --continue")
   (use "git rebase --skip" to skip this patch)
@@ -162,7 +162,7 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	git add main.txt &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (all conflicts fixed: run "git rebase --continue")
 
@@ -190,7 +190,7 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	ONTO=$(git rev-parse --short HEAD~2) &&
 	git rebase -i HEAD~2 &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive 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)
@@ -216,7 +216,7 @@ test_expect_success 'status when splitting a commit' '
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -247,7 +247,7 @@ test_expect_success 'status after editing the last commit with --amend during a
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -277,7 +277,7 @@ test_expect_success 'status: (continue first edit) second edit' '
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -299,7 +299,7 @@ test_expect_success 'status: (continue first edit) second edit and split' '
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -326,7 +326,7 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
 	git rebase --continue &&
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -348,7 +348,7 @@ test_expect_success 'status: (amend first edit) second edit' '
 	git commit --amend -m "a" &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -371,7 +371,7 @@ test_expect_success 'status: (amend first edit) second edit and split' '
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -399,7 +399,7 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
 	git rebase --continue &&
 	git commit --amend -m "d" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -423,7 +423,7 @@ test_expect_success 'status: (split first edit) second edit' '
 	git commit -m "e" &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -448,7 +448,7 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -478,7 +478,7 @@ test_expect_success 'status: (split first edit) second edit and amend' '
 	git rebase --continue &&
 	git commit --amend -m "h" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
diff --git a/wt-status.c b/wt-status.c
index 8c4b806..81610dc 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1328,7 +1328,10 @@ void wt_status_print(struct wt_status *s)
 		else if (!strcmp(branch_name, "HEAD")) {
 			branch_status_color = color(WT_STATUS_NOBRANCH, s);
 			if (state.rebase_in_progress || state.rebase_interactive_in_progress) {
-				on_what = _("rebase in progress; onto ");
+				if (state.rebase_interactive_in_progress)
+					on_what = _("interactive rebase in progress; onto ");
+				else
+					on_what = _("rebase in progress; onto ");
 				branch_name = state.onto;
 			} else if (state.detached_from) {
 				branch_name = state.detached_from;
-- 
2.5.0.rc0.7.ge1edd74

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-01  8:30     ` [PATCH v5 1/4] status: factor two rebase-related messages together Matthieu Moy
  2015-07-01  8:30       ` [PATCH v5 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
@ 2015-07-01  8:30       ` Matthieu Moy
  2015-07-01 16:18         ` Junio C Hamano
  2015-07-01  8:30       ` [PATCH v5 4/4] status: add new tests for status " Matthieu Moy
  2 siblings, 1 reply; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01  8:30 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

git status gives more information during rebase -i, about the list of
command that are done during the rebase. It displays the two last
commands executed and the two next lines to be executed. It also gives
hints to find the whole files in .git directory.

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Added sha1-shortening code.

 t/t7512-status-help.sh | 111 +++++++++++++++++++++++++++++++++++++++++++++++++
 wt-status.c            | 109 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 220 insertions(+)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 190656d..9be0235 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -134,9 +134,13 @@ test_expect_success 'prepare for rebase_i_conflicts' '
 test_expect_success 'status during rebase -i when conflicts unresolved' '
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
+	LAST_COMMIT=$(git rev-parse --short rebase_i_conflicts_second) &&
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last command done (1 command done):
+   pick $LAST_COMMIT one_second
+No commands remaining.
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (fix conflicts and then run "git rebase --continue")
   (use "git rebase --skip" to skip this patch)
@@ -159,10 +163,14 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
 	git reset --hard rebase_i_conflicts_second &&
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
+	LAST_COMMIT=$(git rev-parse --short rebase_i_conflicts_second) &&
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	git add main.txt &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last command done (1 command done):
+   pick $LAST_COMMIT one_second
+No commands remaining.
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (all conflicts fixed: run "git rebase --continue")
 
@@ -183,7 +191,9 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	git checkout -b rebase_i_edit &&
 	test_commit one_rebase_i main.txt one &&
 	test_commit two_rebase_i main.txt two &&
+	COMMIT2=$(git rev-parse --short rebase_i_edit) &&
 	test_commit three_rebase_i main.txt three &&
+	COMMIT3=$(git rev-parse --short rebase_i_edit) &&
 	FAKE_LINES="1 edit 2" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
@@ -191,6 +201,10 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	git rebase -i HEAD~2 &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   pick $COMMIT2 two_rebase_i
+   edit $COMMIT3 three_rebase_i
+No commands remaining.
 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)
@@ -207,8 +221,11 @@ test_expect_success 'status when splitting a commit' '
 	git checkout -b split_commit &&
 	test_commit one_split main.txt one &&
 	test_commit two_split main.txt two &&
+	COMMIT2=$(git rev-parse --short split_commit) &&
 	test_commit three_split main.txt three &&
+	COMMIT3=$(git rev-parse --short split_commit) &&
 	test_commit four_split main.txt four &&
+	COMMIT4=$(git rev-parse --short split_commit) &&
 	FAKE_LINES="1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
@@ -217,6 +234,12 @@ test_expect_success 'status when splitting a commit' '
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   pick $COMMIT2 two_split
+   edit $COMMIT3 three_split
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_split
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -239,7 +262,9 @@ test_expect_success 'status after editing the last commit with --amend during a
 	test_commit one_amend main.txt one &&
 	test_commit two_amend main.txt two &&
 	test_commit three_amend main.txt three &&
+	COMMIT3=$(git rev-parse --short amend_last) &&
 	test_commit four_amend main.txt four &&
+	COMMIT4=$(git rev-parse --short amend_last) &&
 	FAKE_LINES="1 2 edit 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
@@ -248,6 +273,11 @@ test_expect_success 'status after editing the last commit with --amend during a
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (3 commands done):
+   pick $COMMIT3 three_amend
+   edit $COMMIT4 four_amend
+  (see more in file .git/rebase-merge/done)
+No commands remaining.
 You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -273,11 +303,20 @@ test_expect_success 'status: (continue first edit) second edit' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -294,12 +333,21 @@ test_expect_success 'status: (continue first edit) second edit and split' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -321,12 +369,21 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -343,12 +400,21 @@ test_expect_success 'status: (amend first edit) second edit' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "a" &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -366,12 +432,21 @@ test_expect_success 'status: (amend first edit) second edit and split' '
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "b" &&
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -393,6 +468,9 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "c" &&
@@ -400,6 +478,12 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
 	git commit --amend -m "d" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -416,6 +500,9 @@ test_expect_success 'status: (split first edit) second edit' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
@@ -424,6 +511,12 @@ test_expect_success 'status: (split first edit) second edit' '
 	git rebase --continue &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -440,6 +533,9 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
@@ -449,6 +545,12 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -470,6 +572,9 @@ test_expect_success 'status: (split first edit) second edit and amend' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
@@ -479,6 +584,12 @@ test_expect_success 'status: (split first edit) second edit and amend' '
 	git commit --amend -m "h" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
diff --git a/wt-status.c b/wt-status.c
index 81610dc..005a558 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1027,6 +1027,114 @@ static int split_commit_in_progress(struct wt_status *s)
 	return split_in_progress;
 }
 
+/*
+ * Turn
+ * pick d6a2f0303e897ec257dd0e0a39a5ccb709bc2047 some message
+ * into
+ * pick d6a2f03 some message
+ */
+static void abbrev_sha1_in_line(struct strbuf *line)
+{
+	struct strbuf **split;
+	int i;
+
+	if (starts_with(line->buf, "exec ") ||
+	    starts_with(line->buf, "x "))
+		return;
+
+	split = strbuf_split_max(line, ' ', 3);
+	if (split[0] && split[1]) {
+		unsigned char sha1[20];
+		const char *abbrev;
+
+		/*
+		 * strbuf_split_max left a space. Trim it and re-add
+		 * it after abbreviation.
+		 */
+		strbuf_trim(split[1]);
+		if (!get_sha1(split[1]->buf, sha1)) {
+			abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
+			strbuf_reset(split[1]);
+			strbuf_addf(split[1], "%s ", abbrev);
+		}
+		strbuf_reset(line);
+		for (i = 0; split[i]; i++)
+			strbuf_addstr(line, split[i]->buf);
+	}
+	for (i = 0; split[i]; i++)
+		strbuf_release(split[i]);
+
+}
+
+static void read_rebase_todolist(const char *fname, struct string_list *lines)
+{
+	struct strbuf line = STRBUF_INIT;
+	FILE *f = fopen(git_path(fname), "r");
+
+	if (!f)
+		die_errno("Could not open file %s for reading", git_path(fname));
+	while (!strbuf_getline(&line, f, '\n')) {
+		stripspace(&line, 1);
+		/* Remove trailing \n */
+		strbuf_rtrim(&line);
+		abbrev_sha1_in_line(&line);
+		string_list_append(lines, line.buf);
+	}
+	string_list_remove_empty_items(lines, 1);
+}
+
+static void show_rebase_information(struct wt_status *s,
+					struct wt_status_state *state,
+					const char *color)
+{
+	if (state->rebase_interactive_in_progress) {
+		int i;
+		int nr_lines_to_show = 2;
+
+		struct string_list have_done = STRING_LIST_INIT_DUP;
+		struct string_list yet_to_do = STRING_LIST_INIT_DUP;
+
+		read_rebase_todolist("rebase-merge/done", &have_done);
+		read_rebase_todolist("rebase-merge/git-rebase-todo", &yet_to_do);
+
+		if (have_done.nr == 0)
+			status_printf_ln(s, color, _("No commands done."));
+		else {
+			status_printf_ln(s, color,
+				Q_("Last command done (%d command done):",
+					"Last commands done (%d commands done):",
+					have_done.nr),
+				have_done.nr);
+			for (i = (have_done.nr > nr_lines_to_show)
+				? have_done.nr - nr_lines_to_show : 0;
+				i < have_done.nr;
+				i++)
+				status_printf_ln(s, color, "   %s", have_done.items[i].string);
+			if (have_done.nr > nr_lines_to_show && s->hints)
+				status_printf_ln(s, color,
+					_("  (see more in file %s)"), git_path("rebase-merge/done"));
+		}
+
+		if (yet_to_do.nr == 0)
+			status_printf_ln(s, color,
+					 _("No commands remaining."));
+		else {
+			status_printf_ln(s, color,
+				Q_("Next command to do (%d remaining command):",
+					"Next commands to do (%d remaining commands):",
+					yet_to_do.nr),
+				yet_to_do.nr);
+			for (i = 0; i < nr_lines_to_show && i < yet_to_do.nr; i++)
+				status_printf_ln(s, color, "   %s", yet_to_do.items[i].string);
+			if (s->hints)
+				status_printf_ln(s, color,
+					_("  (use \"git rebase --edit-todo\" to view and edit)"));
+		}
+		string_list_clear(&yet_to_do, 0);
+		string_list_clear(&have_done, 0);
+	}
+}
+
 static void print_rebase_state(struct wt_status *s,
 				struct wt_status_state *state,
 				const char *color)
@@ -1047,6 +1155,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 {
 	struct stat st;
 
+	show_rebase_information(s, state, color);
 	if (has_unmerged(s)) {
 		print_rebase_state(s, state, color);
 		if (s->hints) {
-- 
2.5.0.rc0.7.ge1edd74

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v5 4/4] status: add new tests for status during rebase -i
  2015-07-01  8:30     ` [PATCH v5 1/4] status: factor two rebase-related messages together Matthieu Moy
  2015-07-01  8:30       ` [PATCH v5 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
  2015-07-01  8:30       ` [PATCH v5 3/4] status: give more information during rebase -i Matthieu Moy
@ 2015-07-01  8:30       ` Matthieu Moy
  2 siblings, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01  8:30 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Expand test coverage with one or more than two commands done
and with zero, one or more than two commands remaining.

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Added --short where appropriate.

 t/t7512-status-help.sh | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 9be0235..49d19a3 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -856,4 +856,91 @@ EOF
 	test_i18ncmp expected actual
 '
 
+test_expect_success 'prepare for different number of commits rebased' '
+	git reset --hard master &&
+	git checkout -b several_commits &&
+	test_commit one_commit main.txt one &&
+	test_commit two_commit main.txt two &&
+	test_commit three_commit main.txt three &&
+	test_commit four_commit main.txt four
+'
+
+test_expect_success 'status: one command done nothing remaining' '
+	FAKE_LINES="exec_exit_15" &&
+	export FAKE_LINES &&
+	test_when_finished "git rebase --abort" &&
+	ONTO=$(git rev-parse --short HEAD~3) &&
+	test_must_fail git rebase -i HEAD~3 &&
+	cat >expected <<EOF &&
+interactive rebase in progress; onto $ONTO
+Last command done (1 command done):
+   exec exit 15
+No commands remaining.
+You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
+  (use "git commit --amend" to amend the current commit)
+  (use "git rebase --continue" once you are satisfied with your changes)
+
+nothing to commit (use -u to show untracked files)
+EOF
+	git status --untracked-files=no >actual &&
+	test_i18ncmp expected actual
+'
+
+test_expect_success 'status: two commands done with some white lines in done file' '
+	FAKE_LINES="1 > exec_exit_15  2 3" &&
+	export FAKE_LINES &&
+	test_when_finished "git rebase --abort" &&
+	ONTO=$(git rev-parse --short HEAD~3) &&
+	COMMIT4=$(git rev-parse --short HEAD) &&
+	COMMIT3=$(git rev-parse --short HEAD^) &&
+	COMMIT2=$(git rev-parse --short HEAD^^) &&
+	test_must_fail git rebase -i HEAD~3 &&
+	cat >expected <<EOF &&
+interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   pick $COMMIT2 two_commit
+   exec exit 15
+Next commands to do (2 remaining commands):
+   pick $COMMIT3 three_commit
+   pick $COMMIT4 four_commit
+  (use "git rebase --edit-todo" to view and edit)
+You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
+  (use "git commit --amend" to amend the current commit)
+  (use "git rebase --continue" once you are satisfied with your changes)
+
+nothing to commit (use -u to show untracked files)
+EOF
+	git status --untracked-files=no >actual &&
+	test_i18ncmp expected actual
+'
+
+test_expect_success 'status: two remaining commands with some white lines in todo file' '
+	FAKE_LINES="1 2 exec_exit_15 3 > 4" &&
+	export FAKE_LINES &&
+	test_when_finished "git rebase --abort" &&
+	ONTO=$(git rev-parse --short HEAD~4) &&
+	COMMIT4=$(git rev-parse --short HEAD) &&
+	COMMIT3=$(git rev-parse --short HEAD^) &&
+	COMMIT2=$(git rev-parse --short HEAD^^) &&
+	test_must_fail git rebase -i HEAD~4 &&
+	cat >expected <<EOF &&
+interactive rebase in progress; onto $ONTO
+Last commands done (3 commands done):
+   pick $COMMIT2 two_commit
+   exec exit 15
+  (see more in file .git/rebase-merge/done)
+Next commands to do (2 remaining commands):
+   pick $COMMIT3 three_commit
+   pick $COMMIT4 four_commit
+  (use "git rebase --edit-todo" to view and edit)
+You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
+  (use "git commit --amend" to amend the current commit)
+  (use "git rebase --continue" once you are satisfied with your changes)
+
+nothing to commit (use -u to show untracked files)
+EOF
+	git status --untracked-files=no >actual &&
+	test_i18ncmp expected actual
+'
+
 test_done
-- 
2.5.0.rc0.7.ge1edd74

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-01  8:30       ` [PATCH v5 3/4] status: give more information during rebase -i Matthieu Moy
@ 2015-07-01 16:18         ` Junio C Hamano
  2015-07-01 16:33           ` Eric Sunshine
  2015-07-01 21:06           ` Matthieu Moy
  0 siblings, 2 replies; 26+ messages in thread
From: Junio C Hamano @ 2015-07-01 16:18 UTC (permalink / raw)
  To: Matthieu Moy
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

Matthieu Moy <Matthieu.Moy@imag.fr> writes:

> +/*
> + * Turn
> + * pick d6a2f0303e897ec257dd0e0a39a5ccb709bc2047 some message
> + * into
> + * pick d6a2f03 some message
> + */
> +static void abbrev_sha1_in_line(struct strbuf *line)
> +{
> +	struct strbuf **split;
> +	int i;
> +
> +	if (starts_with(line->buf, "exec ") ||
> +	    starts_with(line->buf, "x "))
> +		return;
> +
> +	split = strbuf_split_max(line, ' ', 3);
> +	if (split[0] && split[1]) {
> +		unsigned char sha1[20];
> +		const char *abbrev;
> +
> +		/*
> +		 * strbuf_split_max left a space. Trim it and re-add
> +		 * it after abbreviation.
> +		 */
> +		strbuf_trim(split[1]);
> +		if (!get_sha1(split[1]->buf, sha1)) {
> +			abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
> +			strbuf_reset(split[1]);
> +			strbuf_addf(split[1], "%s ", abbrev);
> +		}

... else?

That is, "we thought there would be a full SHA-1, but it turns out
that there wasn't, so we keep split[1] as-is" would need to add the
space back, no?  Perhaps be more strict and do this instead (without
leading strbuf_trim):

	if (!get_sha1_hex(split[1]->buf, sha1) &&
	    !strcmp(split[1]->buf + 40, " ") {
		replace split[1] with "%s " abbrev
	}

> +		strbuf_reset(line);
> +		for (i = 0; split[i]; i++)
> +			strbuf_addstr(line, split[i]->buf);
> +	}
> +	for (i = 0; split[i]; i++)
> +		strbuf_release(split[i]);
> +
> +}
> +
> +static void read_rebase_todolist(const char *fname, struct string_list *lines)
> +{
> +	struct strbuf line = STRBUF_INIT;
> +	FILE *f = fopen(git_path(fname), "r");
> +
> +	if (!f)
> +		die_errno("Could not open file %s for reading", git_path(fname));
> +	while (!strbuf_getline(&line, f, '\n')) {
> +		stripspace(&line, 1);

stripspace() is meant to be used for multi-line input (e.g. it
collapses a multi-line paragraph break into one blank line) and it
does not look a good fit in a loop that goes line-by-line. As you
call (and you have to, because stripspace() fixes the incomplete
line by adding LF at the end) rtrim() immediately afterward, this
call is done only for removing comments (in other words, trailing
whitespaces are removed without the call to stripspace() anyway).

> +		/* Remove trailing \n */
> +		strbuf_rtrim(&line);
> +		abbrev_sha1_in_line(&line);
> +		string_list_append(lines, line.buf);
> +	}
> +	string_list_remove_empty_items(lines, 1);
> +}

Perhaps

        while (!strbuf_getline(&line, f, '\n')) {
                if (line.len && line.len[0] == comment_line_char)
                        continue;
                strbuf_rtrim(&line);
                if (!line.len)
                        continue;
                abbrev_sha1_in_line(&line);
                string_list_append(lines, line.buf);
        }

without the "we may have added cruft, so discard them at the end"?

Other than these two minor nits, I didn't spot anything questionable
in the diff between this and the previous round.

Thanks.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-01 16:18         ` Junio C Hamano
@ 2015-07-01 16:33           ` Eric Sunshine
  2015-07-01 16:36             ` Junio C Hamano
  2015-07-01 21:06           ` Matthieu Moy
  1 sibling, 1 reply; 26+ messages in thread
From: Eric Sunshine @ 2015-07-01 16:33 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Matthieu Moy, Git List, Remi Lespinet, Guillaume Pages,
	Louis-Alexandre Stuber, Antoine Delaite

On Wed, Jul 1, 2015 at 12:18 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>> +/*
>> + * Turn
>> + * pick d6a2f0303e897ec257dd0e0a39a5ccb709bc2047 some message
>> + * into
>> + * pick d6a2f03 some message
>> + */
>> +static void abbrev_sha1_in_line(struct strbuf *line)
>> +{
>> +     struct strbuf **split;
>> +     int i;
>> +
>> +     if (starts_with(line->buf, "exec ") ||
>> +         starts_with(line->buf, "x "))
>> +             return;
>> +
>> +     split = strbuf_split_max(line, ' ', 3);
>> +     if (split[0] && split[1]) {
>> +             unsigned char sha1[20];
>> +             const char *abbrev;
>> +
>> +             /*
>> +              * strbuf_split_max left a space. Trim it and re-add
>> +              * it after abbreviation.
>> +              */
>> +             strbuf_trim(split[1]);
>> +             if (!get_sha1(split[1]->buf, sha1)) {
>> +                     abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
>> +                     strbuf_reset(split[1]);
>> +                     strbuf_addf(split[1], "%s ", abbrev);
>> +             }
>
> ... else?
>
> That is, "we thought there would be a full SHA-1, but it turns out
> that there wasn't, so we keep split[1] as-is" would need to add the
> space back, no?

I was about to mention the same shortcoming, but you beat me to it.

> Perhaps be more strict and do this instead (without
> leading strbuf_trim):
>
>         if (!get_sha1_hex(split[1]->buf, sha1) &&
>             !strcmp(split[1]->buf + 40, " ") {
>                 replace split[1] with "%s " abbrev
>         }

Isn't it dangerous to assume that you can index 40 characters into
split[1]? If (for some reason), the user botched the todo line such
that the SHA1 is no longer a valid hex string, then split[1] will be
that botched string, which might be shorter than 40 characters. For
instance, if the user-edited todo line is:

    pick oops nothing

then git-rebase--interactive.sh:transform_todo_ids() will leave "oops"
as-is, since it can't unabbreviate it, and then this code will place
"oops" into split[1].

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-01 16:33           ` Eric Sunshine
@ 2015-07-01 16:36             ` Junio C Hamano
  2015-07-01 16:37               ` Eric Sunshine
  0 siblings, 1 reply; 26+ messages in thread
From: Junio C Hamano @ 2015-07-01 16:36 UTC (permalink / raw)
  To: Eric Sunshine
  Cc: Matthieu Moy, Git List, Remi Lespinet, Guillaume Pages,
	Louis-Alexandre Stuber, Antoine Delaite

Eric Sunshine <sunshine@sunshineco.com> writes:

> I was about to mention the same shortcoming, but you beat me to it.
>
>> Perhaps be more strict and do this instead (without
>> leading strbuf_trim):
>>
>>         if (!get_sha1_hex(split[1]->buf, sha1) &&
>>             !strcmp(split[1]->buf + 40, " ") {
>>                 replace split[1] with "%s " abbrev
>>         }
>
> Isn't it dangerous to assume that you can index 40 characters into
> split[1]? If (for some reason), the user botched the todo line such
> that the SHA1 is no longer a valid hex string, then split[1] will be
> that botched string, which might be shorter than 40 characters. For
> instance, if the user-edited todo line is:
>
>     pick oops nothing
>
> then git-rebase--interactive.sh:transform_todo_ids() will leave "oops"
> as-is, since it can't unabbreviate it, and then this code will place
> "oops" into split[1].

Yeah, that is why get_sha1_hex() is checked before we try to make
sure buf[40] has " " in the code snippet you quoted.

Isn't that how && short-cut works?

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-01 16:36             ` Junio C Hamano
@ 2015-07-01 16:37               ` Eric Sunshine
  0 siblings, 0 replies; 26+ messages in thread
From: Eric Sunshine @ 2015-07-01 16:37 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Matthieu Moy, Git List, Remi Lespinet, Guillaume Pages,
	Louis-Alexandre Stuber, Antoine Delaite

On Wed, Jul 1, 2015 at 12:36 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>> I was about to mention the same shortcoming, but you beat me to it.
>>
>>> Perhaps be more strict and do this instead (without
>>> leading strbuf_trim):
>>>
>>>         if (!get_sha1_hex(split[1]->buf, sha1) &&
>>>             !strcmp(split[1]->buf + 40, " ") {
>>>                 replace split[1] with "%s " abbrev
>>>         }
>>
>> Isn't it dangerous to assume that you can index 40 characters into
>> split[1]? If (for some reason), the user botched the todo line such
>> that the SHA1 is no longer a valid hex string, then split[1] will be
>> that botched string, which might be shorter than 40 characters. For
>> instance, if the user-edited todo line is:
>>
>>     pick oops nothing
>>
>> then git-rebase--interactive.sh:transform_todo_ids() will leave "oops"
>> as-is, since it can't unabbreviate it, and then this code will place
>> "oops" into split[1].
>
> Yeah, that is why get_sha1_hex() is checked before we try to make
> sure buf[40] has " " in the code snippet you quoted.
>
> Isn't that how && short-cut works?

Argh, I misread the code. Sorry for the noise.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-01 16:18         ` Junio C Hamano
  2015-07-01 16:33           ` Eric Sunshine
@ 2015-07-01 21:06           ` Matthieu Moy
  2015-07-01 21:08             ` [PATCH v6 1/4] status: factor two rebase-related messages together Matthieu Moy
  2015-07-01 21:23             ` [PATCH v5 3/4] status: give more information " Junio C Hamano
  1 sibling, 2 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01 21:06 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

Junio C Hamano <gitster@pobox.com> writes:

> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> +		strbuf_trim(split[1]);
>> +		if (!get_sha1(split[1]->buf, sha1)) {
>> +			abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
>> +			strbuf_reset(split[1]);
>> +			strbuf_addf(split[1], "%s ", abbrev);
>> +		}
>
> ... else?
>
> That is, "we thought there would be a full SHA-1, but it turns out
> that there wasn't, so we keep split[1] as-is" would need to add the
> space back, no?

Right.

> Perhaps be more strict and do this instead (without leading
> strbuf_trim):
>
> 	if (!get_sha1_hex(split[1]->buf, sha1) &&
> 	    !strcmp(split[1]->buf + 40, " ") {
> 		replace split[1] with "%s " abbrev
> 	}

Actually, we can do simpler: we still have the original line available,
so if we don't find a sha1, we can just keep it. By just letting the few
lines after the if enter the if, it just works:

		strbuf_trim(split[1]);
		if (!get_sha1(split[1]->buf, sha1)) {
			abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
			strbuf_reset(split[1]);
			strbuf_addf(split[1], "%s ", abbrev);
			strbuf_reset(line);
			for (i = 0; split[i]; i++)
				strbuf_addf(line, "%s", split[i]->buf);
		}

>         while (!strbuf_getline(&line, f, '\n')) {
>                 if (line.len && line.len[0] == comment_line_char)
>                         continue;
>                 strbuf_rtrim(&line);
>                 if (!line.len)
>                         continue;
>                 abbrev_sha1_in_line(&line);
>                 string_list_append(lines, line.buf);
>         }

I took this (modulo s/line.len[0]/line.buf[0]/, and s/rtrim/trim/ to be
robust to leading whitespace (not really important, but doesn't harm).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v6 1/4] status: factor two rebase-related messages together
  2015-07-01 21:06           ` Matthieu Moy
@ 2015-07-01 21:08             ` Matthieu Moy
  2015-07-01 21:08               ` [PATCH v6 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
                                 ` (2 more replies)
  2015-07-01 21:23             ` [PATCH v5 3/4] status: give more information " Junio C Hamano
  1 sibling, 3 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01 21:08 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
No modification.

 wt-status.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index eaed4fe..8c4b806 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1027,6 +1027,20 @@ static int split_commit_in_progress(struct wt_status *s)
 	return split_in_progress;
 }
 
+static void print_rebase_state(struct wt_status *s,
+				struct wt_status_state *state,
+				const char *color)
+{
+	if (state->branch)
+		status_printf_ln(s, color,
+				 _("You are currently rebasing branch '%s' on '%s'."),
+				 state->branch,
+				 state->onto);
+	else
+		status_printf_ln(s, color,
+				 _("You are currently rebasing."));
+}
+
 static void show_rebase_in_progress(struct wt_status *s,
 				struct wt_status_state *state,
 				const char *color)
@@ -1034,14 +1048,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 	struct stat st;
 
 	if (has_unmerged(s)) {
-		if (state->branch)
-			status_printf_ln(s, color,
-					 _("You are currently rebasing branch '%s' on '%s'."),
-					 state->branch,
-					 state->onto);
-		else
-			status_printf_ln(s, color,
-					 _("You are currently rebasing."));
+		print_rebase_state(s, state, color);
 		if (s->hints) {
 			status_printf_ln(s, color,
 				_("  (fix conflicts and then run \"git rebase --continue\")"));
@@ -1051,14 +1058,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 				_("  (use \"git rebase --abort\" to check out the original branch)"));
 		}
 	} else if (state->rebase_in_progress || !stat(git_path("MERGE_MSG"), &st)) {
-		if (state->branch)
-			status_printf_ln(s, color,
-					 _("You are currently rebasing branch '%s' on '%s'."),
-					 state->branch,
-					 state->onto);
-		else
-			status_printf_ln(s, color,
-					 _("You are currently rebasing."));
+		print_rebase_state(s, state, color);
 		if (s->hints)
 			status_printf_ln(s, color,
 				_("  (all conflicts fixed: run \"git rebase --continue\")"));
-- 
2.5.0.rc0.7.ge1edd74.dirty

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v6 2/4] status: differentiate interactive from non-interactive rebases
  2015-07-01 21:08             ` [PATCH v6 1/4] status: factor two rebase-related messages together Matthieu Moy
@ 2015-07-01 21:08               ` Matthieu Moy
  2015-07-01 21:08               ` [PATCH v6 3/4] status: give more information during rebase -i Matthieu Moy
  2015-07-01 21:08               ` [PATCH v6 4/4] status: add new tests for status " Matthieu Moy
  2 siblings, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01 21:08 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
No modification.

 t/t7512-status-help.sh | 28 ++++++++++++++--------------
 wt-status.c            |  5 ++++-
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 68ad2d7..190656d 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -136,7 +136,7 @@ test_expect_success 'status during rebase -i when conflicts unresolved' '
 	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (fix conflicts and then run "git rebase --continue")
   (use "git rebase --skip" to skip this patch)
@@ -162,7 +162,7 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	git add main.txt &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (all conflicts fixed: run "git rebase --continue")
 
@@ -190,7 +190,7 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	ONTO=$(git rev-parse --short HEAD~2) &&
 	git rebase -i HEAD~2 &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive 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)
@@ -216,7 +216,7 @@ test_expect_success 'status when splitting a commit' '
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -247,7 +247,7 @@ test_expect_success 'status after editing the last commit with --amend during a
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -277,7 +277,7 @@ test_expect_success 'status: (continue first edit) second edit' '
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -299,7 +299,7 @@ test_expect_success 'status: (continue first edit) second edit and split' '
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -326,7 +326,7 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
 	git rebase --continue &&
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -348,7 +348,7 @@ test_expect_success 'status: (amend first edit) second edit' '
 	git commit --amend -m "a" &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -371,7 +371,7 @@ test_expect_success 'status: (amend first edit) second edit and split' '
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -399,7 +399,7 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
 	git rebase --continue &&
 	git commit --amend -m "d" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -423,7 +423,7 @@ test_expect_success 'status: (split first edit) second edit' '
 	git commit -m "e" &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -448,7 +448,7 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -478,7 +478,7 @@ test_expect_success 'status: (split first edit) second edit and amend' '
 	git rebase --continue &&
 	git commit --amend -m "h" &&
 	cat >expected <<EOF &&
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
diff --git a/wt-status.c b/wt-status.c
index 8c4b806..81610dc 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1328,7 +1328,10 @@ void wt_status_print(struct wt_status *s)
 		else if (!strcmp(branch_name, "HEAD")) {
 			branch_status_color = color(WT_STATUS_NOBRANCH, s);
 			if (state.rebase_in_progress || state.rebase_interactive_in_progress) {
-				on_what = _("rebase in progress; onto ");
+				if (state.rebase_interactive_in_progress)
+					on_what = _("interactive rebase in progress; onto ");
+				else
+					on_what = _("rebase in progress; onto ");
 				branch_name = state.onto;
 			} else if (state.detached_from) {
 				branch_name = state.detached_from;
-- 
2.5.0.rc0.7.ge1edd74.dirty

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v6 3/4] status: give more information during rebase -i
  2015-07-01 21:08             ` [PATCH v6 1/4] status: factor two rebase-related messages together Matthieu Moy
  2015-07-01 21:08               ` [PATCH v6 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
@ 2015-07-01 21:08               ` Matthieu Moy
  2015-07-07 22:14                 ` Junio C Hamano
  2015-07-01 21:08               ` [PATCH v6 4/4] status: add new tests for status " Matthieu Moy
  2 siblings, 1 reply; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01 21:08 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

git status gives more information during rebase -i, about the list of
command that are done during the rebase. It displays the two last
commands executed and the two next lines to be executed. It also gives
hints to find the whole files in .git directory.

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Applied Junio's remark on C code to abbreviate sha1s and filter comments.

 t/t7512-status-help.sh | 111 ++++++++++++++++++++++++++++++++++++++++++++++++
 wt-status.c            | 113 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 224 insertions(+)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 190656d..9be0235 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -134,9 +134,13 @@ test_expect_success 'prepare for rebase_i_conflicts' '
 test_expect_success 'status during rebase -i when conflicts unresolved' '
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
+	LAST_COMMIT=$(git rev-parse --short rebase_i_conflicts_second) &&
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last command done (1 command done):
+   pick $LAST_COMMIT one_second
+No commands remaining.
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (fix conflicts and then run "git rebase --continue")
   (use "git rebase --skip" to skip this patch)
@@ -159,10 +163,14 @@ test_expect_success 'status during rebase -i after resolving conflicts' '
 	git reset --hard rebase_i_conflicts_second &&
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short rebase_i_conflicts) &&
+	LAST_COMMIT=$(git rev-parse --short rebase_i_conflicts_second) &&
 	test_must_fail git rebase -i rebase_i_conflicts &&
 	git add main.txt &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last command done (1 command done):
+   pick $LAST_COMMIT one_second
+No commands remaining.
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO'\''.
   (all conflicts fixed: run "git rebase --continue")
 
@@ -183,7 +191,9 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	git checkout -b rebase_i_edit &&
 	test_commit one_rebase_i main.txt one &&
 	test_commit two_rebase_i main.txt two &&
+	COMMIT2=$(git rev-parse --short rebase_i_edit) &&
 	test_commit three_rebase_i main.txt three &&
+	COMMIT3=$(git rev-parse --short rebase_i_edit) &&
 	FAKE_LINES="1 edit 2" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
@@ -191,6 +201,10 @@ test_expect_success 'status when rebasing -i in edit mode' '
 	git rebase -i HEAD~2 &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   pick $COMMIT2 two_rebase_i
+   edit $COMMIT3 three_rebase_i
+No commands remaining.
 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)
@@ -207,8 +221,11 @@ test_expect_success 'status when splitting a commit' '
 	git checkout -b split_commit &&
 	test_commit one_split main.txt one &&
 	test_commit two_split main.txt two &&
+	COMMIT2=$(git rev-parse --short split_commit) &&
 	test_commit three_split main.txt three &&
+	COMMIT3=$(git rev-parse --short split_commit) &&
 	test_commit four_split main.txt four &&
+	COMMIT4=$(git rev-parse --short split_commit) &&
 	FAKE_LINES="1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
@@ -217,6 +234,12 @@ test_expect_success 'status when splitting a commit' '
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   pick $COMMIT2 two_split
+   edit $COMMIT3 three_split
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_split
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''split_commit'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -239,7 +262,9 @@ test_expect_success 'status after editing the last commit with --amend during a
 	test_commit one_amend main.txt one &&
 	test_commit two_amend main.txt two &&
 	test_commit three_amend main.txt three &&
+	COMMIT3=$(git rev-parse --short amend_last) &&
 	test_commit four_amend main.txt four &&
+	COMMIT4=$(git rev-parse --short amend_last) &&
 	FAKE_LINES="1 2 edit 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
@@ -248,6 +273,11 @@ test_expect_success 'status after editing the last commit with --amend during a
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (3 commands done):
+   pick $COMMIT3 three_amend
+   edit $COMMIT4 four_amend
+  (see more in file .git/rebase-merge/done)
+No commands remaining.
 You are currently editing a commit while rebasing branch '\''amend_last'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -273,11 +303,20 @@ test_expect_success 'status: (continue first edit) second edit' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -294,12 +333,21 @@ test_expect_success 'status: (continue first edit) second edit and split' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -321,12 +369,21 @@ test_expect_success 'status: (continue first edit) second edit and amend' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git rebase --continue &&
 	git commit --amend -m "foo" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -343,12 +400,21 @@ test_expect_success 'status: (amend first edit) second edit' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "a" &&
 	git rebase --continue &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -366,12 +432,21 @@ test_expect_success 'status: (amend first edit) second edit and split' '
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "b" &&
 	git rebase --continue &&
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -393,6 +468,9 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git commit --amend -m "c" &&
@@ -400,6 +478,12 @@ test_expect_success 'status: (amend first edit) second edit and amend' '
 	git commit --amend -m "d" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -416,6 +500,9 @@ test_expect_success 'status: (split first edit) second edit' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
@@ -424,6 +511,12 @@ test_expect_success 'status: (split first edit) second edit' '
 	git rebase --continue &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
@@ -440,6 +533,9 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
@@ -449,6 +545,12 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	git reset HEAD^ &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently splitting a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (Once your working directory is clean, run "git rebase --continue")
 
@@ -470,6 +572,9 @@ test_expect_success 'status: (split first edit) second edit and amend' '
 	FAKE_LINES="edit 1 edit 2 3" &&
 	export FAKE_LINES &&
 	test_when_finished "git rebase --abort" &&
+	COMMIT2=$(git rev-parse --short several_edits^^) &&
+	COMMIT3=$(git rev-parse --short several_edits^) &&
+	COMMIT4=$(git rev-parse --short several_edits) &&
 	ONTO=$(git rev-parse --short HEAD~3) &&
 	git rebase -i HEAD~3 &&
 	git reset HEAD^ &&
@@ -479,6 +584,12 @@ test_expect_success 'status: (split first edit) second edit and amend' '
 	git commit --amend -m "h" &&
 	cat >expected <<EOF &&
 interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   edit $COMMIT2 two_edits
+   edit $COMMIT3 three_edits
+Next command to do (1 remaining command):
+   pick $COMMIT4 four_edits
+  (use "git rebase --edit-todo" to view and edit)
 You are currently editing a commit while rebasing branch '\''several_edits'\'' on '\''$ONTO'\''.
   (use "git commit --amend" to amend the current commit)
   (use "git rebase --continue" once you are satisfied with your changes)
diff --git a/wt-status.c b/wt-status.c
index 81610dc..0204c17 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1027,6 +1027,118 @@ static int split_commit_in_progress(struct wt_status *s)
 	return split_in_progress;
 }
 
+/*
+ * Turn
+ * "pick d6a2f0303e897ec257dd0e0a39a5ccb709bc2047 some message"
+ * into
+ * "pick d6a2f03 some message"
+ *
+ * The function assumes that the line does not contain useless spaces
+ * before or after the command.
+ */
+static void abbrev_sha1_in_line(struct strbuf *line)
+{
+	struct strbuf **split;
+	int i;
+
+	if (starts_with(line->buf, "exec ") ||
+	    starts_with(line->buf, "x "))
+		return;
+
+	split = strbuf_split_max(line, ' ', 3);
+	if (split[0] && split[1]) {
+		unsigned char sha1[20];
+		const char *abbrev;
+
+		/*
+		 * strbuf_split_max left a space. Trim it and re-add
+		 * it after abbreviation.
+		 */
+		strbuf_trim(split[1]);
+		if (!get_sha1(split[1]->buf, sha1)) {
+			abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
+			strbuf_reset(split[1]);
+			strbuf_addf(split[1], "%s ", abbrev);
+			strbuf_reset(line);
+			for (i = 0; split[i]; i++)
+				strbuf_addf(line, "%s", split[i]->buf);
+		}
+	}
+	for (i = 0; split[i]; i++)
+		strbuf_release(split[i]);
+
+}
+
+static void read_rebase_todolist(const char *fname, struct string_list *lines)
+{
+	struct strbuf line = STRBUF_INIT;
+	FILE *f = fopen(git_path(fname), "r");
+
+	if (!f)
+		die_errno("Could not open file %s for reading", git_path(fname));
+	while (!strbuf_getline(&line, f, '\n')) {
+		if (line.len && line.buf[0] == comment_line_char)
+			continue;
+		strbuf_trim(&line);
+		if (!line.len)
+			continue;
+		abbrev_sha1_in_line(&line);
+		string_list_append(lines, line.buf);
+	}
+}
+
+static void show_rebase_information(struct wt_status *s,
+					struct wt_status_state *state,
+					const char *color)
+{
+	if (state->rebase_interactive_in_progress) {
+		int i;
+		int nr_lines_to_show = 2;
+
+		struct string_list have_done = STRING_LIST_INIT_DUP;
+		struct string_list yet_to_do = STRING_LIST_INIT_DUP;
+
+		read_rebase_todolist("rebase-merge/done", &have_done);
+		read_rebase_todolist("rebase-merge/git-rebase-todo", &yet_to_do);
+
+		if (have_done.nr == 0)
+			status_printf_ln(s, color, _("No commands done."));
+		else {
+			status_printf_ln(s, color,
+				Q_("Last command done (%d command done):",
+					"Last commands done (%d commands done):",
+					have_done.nr),
+				have_done.nr);
+			for (i = (have_done.nr > nr_lines_to_show)
+				? have_done.nr - nr_lines_to_show : 0;
+				i < have_done.nr;
+				i++)
+				status_printf_ln(s, color, "   %s", have_done.items[i].string);
+			if (have_done.nr > nr_lines_to_show && s->hints)
+				status_printf_ln(s, color,
+					_("  (see more in file %s)"), git_path("rebase-merge/done"));
+		}
+
+		if (yet_to_do.nr == 0)
+			status_printf_ln(s, color,
+					 _("No commands remaining."));
+		else {
+			status_printf_ln(s, color,
+				Q_("Next command to do (%d remaining command):",
+					"Next commands to do (%d remaining commands):",
+					yet_to_do.nr),
+				yet_to_do.nr);
+			for (i = 0; i < nr_lines_to_show && i < yet_to_do.nr; i++)
+				status_printf_ln(s, color, "   %s", yet_to_do.items[i].string);
+			if (s->hints)
+				status_printf_ln(s, color,
+					_("  (use \"git rebase --edit-todo\" to view and edit)"));
+		}
+		string_list_clear(&yet_to_do, 0);
+		string_list_clear(&have_done, 0);
+	}
+}
+
 static void print_rebase_state(struct wt_status *s,
 				struct wt_status_state *state,
 				const char *color)
@@ -1047,6 +1159,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 {
 	struct stat st;
 
+	show_rebase_information(s, state, color);
 	if (has_unmerged(s)) {
 		print_rebase_state(s, state, color);
 		if (s->hints) {
-- 
2.5.0.rc0.7.ge1edd74.dirty

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v6 4/4] status: add new tests for status during rebase -i
  2015-07-01 21:08             ` [PATCH v6 1/4] status: factor two rebase-related messages together Matthieu Moy
  2015-07-01 21:08               ` [PATCH v6 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
  2015-07-01 21:08               ` [PATCH v6 3/4] status: give more information during rebase -i Matthieu Moy
@ 2015-07-01 21:08               ` Matthieu Moy
  2 siblings, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-07-01 21:08 UTC (permalink / raw)
  To: gitster
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite, Matthieu Moy

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Expand test coverage with one or more than two commands done
and with zero, one or more than two commands remaining.

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
No modification.

 t/t7512-status-help.sh | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 9be0235..49d19a3 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -856,4 +856,91 @@ EOF
 	test_i18ncmp expected actual
 '
 
+test_expect_success 'prepare for different number of commits rebased' '
+	git reset --hard master &&
+	git checkout -b several_commits &&
+	test_commit one_commit main.txt one &&
+	test_commit two_commit main.txt two &&
+	test_commit three_commit main.txt three &&
+	test_commit four_commit main.txt four
+'
+
+test_expect_success 'status: one command done nothing remaining' '
+	FAKE_LINES="exec_exit_15" &&
+	export FAKE_LINES &&
+	test_when_finished "git rebase --abort" &&
+	ONTO=$(git rev-parse --short HEAD~3) &&
+	test_must_fail git rebase -i HEAD~3 &&
+	cat >expected <<EOF &&
+interactive rebase in progress; onto $ONTO
+Last command done (1 command done):
+   exec exit 15
+No commands remaining.
+You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
+  (use "git commit --amend" to amend the current commit)
+  (use "git rebase --continue" once you are satisfied with your changes)
+
+nothing to commit (use -u to show untracked files)
+EOF
+	git status --untracked-files=no >actual &&
+	test_i18ncmp expected actual
+'
+
+test_expect_success 'status: two commands done with some white lines in done file' '
+	FAKE_LINES="1 > exec_exit_15  2 3" &&
+	export FAKE_LINES &&
+	test_when_finished "git rebase --abort" &&
+	ONTO=$(git rev-parse --short HEAD~3) &&
+	COMMIT4=$(git rev-parse --short HEAD) &&
+	COMMIT3=$(git rev-parse --short HEAD^) &&
+	COMMIT2=$(git rev-parse --short HEAD^^) &&
+	test_must_fail git rebase -i HEAD~3 &&
+	cat >expected <<EOF &&
+interactive rebase in progress; onto $ONTO
+Last commands done (2 commands done):
+   pick $COMMIT2 two_commit
+   exec exit 15
+Next commands to do (2 remaining commands):
+   pick $COMMIT3 three_commit
+   pick $COMMIT4 four_commit
+  (use "git rebase --edit-todo" to view and edit)
+You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
+  (use "git commit --amend" to amend the current commit)
+  (use "git rebase --continue" once you are satisfied with your changes)
+
+nothing to commit (use -u to show untracked files)
+EOF
+	git status --untracked-files=no >actual &&
+	test_i18ncmp expected actual
+'
+
+test_expect_success 'status: two remaining commands with some white lines in todo file' '
+	FAKE_LINES="1 2 exec_exit_15 3 > 4" &&
+	export FAKE_LINES &&
+	test_when_finished "git rebase --abort" &&
+	ONTO=$(git rev-parse --short HEAD~4) &&
+	COMMIT4=$(git rev-parse --short HEAD) &&
+	COMMIT3=$(git rev-parse --short HEAD^) &&
+	COMMIT2=$(git rev-parse --short HEAD^^) &&
+	test_must_fail git rebase -i HEAD~4 &&
+	cat >expected <<EOF &&
+interactive rebase in progress; onto $ONTO
+Last commands done (3 commands done):
+   pick $COMMIT2 two_commit
+   exec exit 15
+  (see more in file .git/rebase-merge/done)
+Next commands to do (2 remaining commands):
+   pick $COMMIT3 three_commit
+   pick $COMMIT4 four_commit
+  (use "git rebase --edit-todo" to view and edit)
+You are currently editing a commit while rebasing branch '\''several_commits'\'' on '\''$ONTO'\''.
+  (use "git commit --amend" to amend the current commit)
+  (use "git rebase --continue" once you are satisfied with your changes)
+
+nothing to commit (use -u to show untracked files)
+EOF
+	git status --untracked-files=no >actual &&
+	test_i18ncmp expected actual
+'
+
 test_done
-- 
2.5.0.rc0.7.ge1edd74.dirty

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-01 21:06           ` Matthieu Moy
  2015-07-01 21:08             ` [PATCH v6 1/4] status: factor two rebase-related messages together Matthieu Moy
@ 2015-07-01 21:23             ` Junio C Hamano
  2015-07-02  8:01               ` Matthieu Moy
  2015-07-02  8:10               ` Matthieu Moy
  1 sibling, 2 replies; 26+ messages in thread
From: Junio C Hamano @ 2015-07-01 21:23 UTC (permalink / raw)
  To: Matthieu Moy
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> Actually, we can do simpler: we still have the original line available,
> ...
>
> I took this (modulo s/line.len[0]/line.buf[0]/, and s/rtrim/trim/ to be
> robust to leading whitespace (not really important, but doesn't harm).

I'd prefer us to be more strict when we know we are reading our own
output; rtrim is sensible, as the log line has end-user subject
the end and the subject might have a trailing whitespace we want to
trim, but there is no valid reason to expect leading whitespace.

In any case, I wouldn't have much time during the remainder of the
day to requeue and/or comment; please check what I push out on 'pu'.

Thanks.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-01 21:23             ` [PATCH v5 3/4] status: give more information " Junio C Hamano
@ 2015-07-02  8:01               ` Matthieu Moy
  2015-07-03 17:40                 ` Junio C Hamano
  2015-07-02  8:10               ` Matthieu Moy
  1 sibling, 1 reply; 26+ messages in thread
From: Matthieu Moy @ 2015-07-02  8:01 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

Junio C Hamano <gitster@pobox.com> writes:

> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> Actually, we can do simpler: we still have the original line available,
>> ...
>>
>> I took this (modulo s/line.len[0]/line.buf[0]/, and s/rtrim/trim/ to be
>> robust to leading whitespace (not really important, but doesn't harm).
>
> I'd prefer us to be more strict when we know we are reading our own
> output; rtrim is sensible, as the log line has end-user subject
> the end and the subject might have a trailing whitespace we want to
> trim, but there is no valid reason to expect leading whitespace.

I would agree with "more strict" is it was about rejecting the input (to
catch errors), but here we're still accepting it without complaining if
it has leading whitespaces. So, being strict does not seem to have any
benefit to me. Being a bit more robust is just one character _less_ in
the code.

Actually, there's a hidden benefit in accepting not-well-formatted
input: it mimicks the shell equivalent closer, which means that we're
close to replacing the shell's collapse_todo_ids and expand_todo_ids in
C which would avoid C/shell duplication.

> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -1046,12 +1046,8 @@ static void abbrev_sha1_in_line(struct strbuf *line)
>                 unsigned char sha1[20];
>                 const char *abbrev;
>  
> -               /*
> -                * strbuf_split_max left a space. Trim it and re-add
> -                * it after abbreviation.
> -                */
> -               strbuf_trim(split[1]);
> -               if (!get_sha1(split[1]->buf, sha1)) {
> +               if (!get_sha1_hex(split[1]->buf, sha1) &&
> +                   !strcmp(split[1]->buf + 40, " ")) {
>                         abbrev = find_unique_abbrev(sha1, DEFAULT_ABBREV);
>                         strbuf_reset(split[1]);
>                         strbuf_addf(split[1], "%s ", abbrev);

I prefer my version. It's simpler: when we can't expand, keep the
original "line", don't try to deconstruct/reconstruct it, it's
unmodified by construction. And my version works if the line is just
"pick <sha1>\n", while yours doesn't.

About get_sha1_hex Vs get_sha1, the same argument as above applies:
accepting short sha1s here means that implementing expand_todo_ids based
on the function would be relatively easy.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-01 21:23             ` [PATCH v5 3/4] status: give more information " Junio C Hamano
  2015-07-02  8:01               ` Matthieu Moy
@ 2015-07-02  8:10               ` Matthieu Moy
  1 sibling, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-07-02  8:10 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

Junio C Hamano <gitster@pobox.com> writes:

> In any case, I wouldn't have much time during the remainder of the
> day to requeue and/or comment; please check what I push out on 'pu'.

BTW, I do agree with this hunk:

@@ -1068,18 +1064,20 @@ static void abbrev_sha1_in_line(struct strbuf *line)
 static void read_rebase_todolist(const char *fname, struct string_list *lines)
 {
        struct strbuf line = STRBUF_INIT;
-       FILE *f = fopen(git_path(fname), "r");
+       FILE *f = fopen(git_path("%s", fname), "r");
 
        if (!f)
-               die_errno("Could not open file %s for reading", git_path(fname));
+               die_errno("Could not open file %s for reading",
+                         git_path("%s", fname));

Let me know if you want me to resend. In any case, I'm fine with your
"SQUASH ??" version even though I prefer mine (cf. other message).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v5 3/4] status: give more information during rebase -i
  2015-07-02  8:01               ` Matthieu Moy
@ 2015-07-03 17:40                 ` Junio C Hamano
  0 siblings, 0 replies; 26+ messages in thread
From: Junio C Hamano @ 2015-07-03 17:40 UTC (permalink / raw)
  To: Matthieu Moy
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> I would agree with "more strict" is it was about rejecting the input (to
> catch errors), but here we're still accepting it without complaining

Yes, by "more strict", I meant that I would prefer to keep things we
do not understand as intact as possible, while transforming what we
do understand into whatever shape we deem appropriate.

> Actually, there's a hidden benefit in accepting not-well-formatted
> input: it mimicks the shell equivalent closer, which means that we're
> close to replacing the shell's collapse_todo_ids and expand_todo_ids in
> C which would avoid C/shell duplication.

;-)

But as I said above, that is a mere "would prefer" preference, so I
can go either way.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v6 3/4] status: give more information during rebase -i
  2015-07-01 21:08               ` [PATCH v6 3/4] status: give more information during rebase -i Matthieu Moy
@ 2015-07-07 22:14                 ` Junio C Hamano
  2015-07-08  7:10                   ` Matthieu Moy
  0 siblings, 1 reply; 26+ messages in thread
From: Junio C Hamano @ 2015-07-07 22:14 UTC (permalink / raw)
  To: Matthieu Moy
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

By the way, does this have any potential interaction with 16cf51c7
(git-rebase--interactive.sh: add config option for custom
instruction format, 2015-06-13)?  I _think_ that the other topic
should only affect the collapsed format, so there hopefully
shouldn't be a problem, but just double checking if you folks
considered the ramifications already.

Thanks.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v6 3/4] status: give more information during rebase -i
  2015-07-07 22:14                 ` Junio C Hamano
@ 2015-07-08  7:10                   ` Matthieu Moy
  0 siblings, 0 replies; 26+ messages in thread
From: Matthieu Moy @ 2015-07-08  7:10 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, remi.lespinet, guillaume.pages, louis--alexandre.stuber,
	antoine.delaite

Junio C Hamano <gitster@pobox.com> writes:

> By the way, does this have any potential interaction with 16cf51c7
> (git-rebase--interactive.sh: add config option for custom
> instruction format, 2015-06-13)?  I _think_ that the other topic
> should only affect the collapsed format, so there hopefully
> shouldn't be a problem, but just double checking if you folks
> considered the ramifications already.

16cf51c7 adds rebase.instructionFormat that allows changing the part
after <command> <sha1> in the todo-list, but this part is not parsed by
our patch. So it's OK.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-07-08  7:10 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-30 13:01 [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Matthieu Moy
2015-06-30 13:01 ` [PATCH v4 1/4] status: factor two rebase-related messages together Matthieu Moy
2015-06-30 13:01 ` [PATCH v4 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
2015-06-30 13:01 ` [PATCH v4 3/4] status: give more information during rebase -i Matthieu Moy
2015-06-30 13:01 ` [PATCH v4 4/4] status: add new tests for status " Matthieu Moy
2015-06-30 23:03 ` [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Junio C Hamano
2015-07-01  8:12   ` Matthieu Moy
2015-07-01  8:30     ` [PATCH v5 1/4] status: factor two rebase-related messages together Matthieu Moy
2015-07-01  8:30       ` [PATCH v5 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
2015-07-01  8:30       ` [PATCH v5 3/4] status: give more information during rebase -i Matthieu Moy
2015-07-01 16:18         ` Junio C Hamano
2015-07-01 16:33           ` Eric Sunshine
2015-07-01 16:36             ` Junio C Hamano
2015-07-01 16:37               ` Eric Sunshine
2015-07-01 21:06           ` Matthieu Moy
2015-07-01 21:08             ` [PATCH v6 1/4] status: factor two rebase-related messages together Matthieu Moy
2015-07-01 21:08               ` [PATCH v6 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
2015-07-01 21:08               ` [PATCH v6 3/4] status: give more information during rebase -i Matthieu Moy
2015-07-07 22:14                 ` Junio C Hamano
2015-07-08  7:10                   ` Matthieu Moy
2015-07-01 21:08               ` [PATCH v6 4/4] status: add new tests for status " Matthieu Moy
2015-07-01 21:23             ` [PATCH v5 3/4] status: give more information " Junio C Hamano
2015-07-02  8:01               ` Matthieu Moy
2015-07-03 17:40                 ` Junio C Hamano
2015-07-02  8:10               ` Matthieu Moy
2015-07-01  8:30       ` [PATCH v5 4/4] status: add new tests for status " Matthieu Moy

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).