Re: [RFC/PATCH 2/2] status: fix tests to handle new verbose git status during rebase

2015-06-03 Thread Guillaume Pages
Thanks for reviewing, I take everything into account and release a v2 ASAP.

Guillaume
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/PATCH 2/2] status: fix tests to handle new verbose git status during rebase

2015-06-03 Thread Guillaume Pagès
Signed-off-by: Guillaume Pagès guillaume.pa...@ensimag.grenoble-inp.fr
---
 t/t7512-status-help.sh | 227 ++---
 1 file changed, 213 insertions(+), 14 deletions(-)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 68ad2d7..242124f 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 
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
+Last command(s) done (1 command(s) done):
+   pick $LAST_COMMIT one_second
+No command 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 
-rebase in progress; onto $ONTO
+interactive rebase in progress; onto $ONTO
+Last command(s) done (1 command(s) done):
+   pick $LAST_COMMIT one_second
+No command remaining.
 You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on 
'\''$ONTO'\''.
   (all conflicts fixed: run git rebase --continue)
 
@@ -183,14 +191,20 @@ 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 
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
+Last command(s) done (2 command(s) done):
+   pick $COMMIT2 two_rebase_i
+   edit $COMMIT3 three_rebase_i
+No command 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 
@@ -216,7 +233,13 @@ 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
+Last command(s) done (2 command(s) done):
+   pick $COMMIT2 two_split
+   edit $COMMIT3 three_split
+Next command(s) to do (1 remaining command(s)):
+   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 
@@ -247,7 +272,12 @@ 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
+Last command(s) done (3 command(s) done):
+   pick $COMMIT3 three_amend
+   edit $COMMIT4 four_amend
+  (see more at .git/rebase-merge/done)
+No command remaining.
 You are currently editing a commit while 

Re: [RFC/PATCH 2/2] status: fix tests to handle new verbose git status during rebase

2015-06-03 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes:

 Guillaume Pagès guillaume.pa...@ensimag.grenoble-inp.fr writes:

 Signed-off-by: Guillaume Pagès guillaume.pa...@ensimag.grenoble-inp.fr
 ---
  t/t7512-status-help.sh | 227 
 ++---

 Your history is not bisectable if you sparate tests and code changes in
 two patches.

Yes.

And by squashing the two, you do not have to label 2/2 incorrectly
as fix tests; it is merely fixing what 1/2 broke ;-)

 Plus, as a reviewer, I like seeing changes to the tests next to changes
 to the code, to show me what is the impact of the code change on the
 output of the program.

That too. is a very important consideration, maybe even more so than
bisectability.

Thanks.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/PATCH 2/2] status: fix tests to handle new verbose git status during rebase

2015-06-03 Thread Matthieu Moy
Guillaume Pagès guillaume.pa...@ensimag.grenoble-inp.fr writes:

 Signed-off-by: Guillaume Pagès guillaume.pa...@ensimag.grenoble-inp.fr
 ---
  t/t7512-status-help.sh | 227 
 ++---

Your history is not bisectable if you sparate tests and code changes in
two patches.

Plus, as a reviewer, I like seeing changes to the tests next to changes
to the code, to show me what is the impact of the code change on the
output of the program. In this case, this patch really shows what your
code is doing, and reviewing PATCH 2 means checking that we agree on the
specification, which should not be done _after_ checking the code.

+  (use git rebase --edit-todo to view and edit)

All other status hints use double-quotes around commands. I think this
one should, too.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html