Skip to contentSkip to conversation

t3404-rebase-interactive.sh: fix name of a rewording test

PATCH Superseded Oswald Buddenhagen 3 participants 7 messages Sep 11, 2023 – Sep 13, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t3404-rebase-interactive.sh: fix name of a rewording test

The given test name made no sense to me at all; it seems to be a concatenation of two unrelated things. This was introduced by commit 0c164ae7a ("rebase -i: add another reword test", 20-08-20).

---
actually, i don't understand what the test even does. shouldn't it, to match the description, actually dirty the tree and verify that the operation fails?

Cc Phillip Wood <[email protected]>
---
 t/t3404-rebase-interactive.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t3404-rebase-interactive.sh +1 -1
index 96a56aafbe..31ee5bc1f6 100755
@@ -758,7 +758,7 @@ test_expect_success 'reword' '
 	git show HEAD~2 | grep "C changed"
 '
 
-test_expect_success 'no uncommited changes when rewording the todo list is reloaded' '
+test_expect_success 'no uncommitted changes when rewording' '
 	git checkout E &&
 	test_when_finished "git checkout @{-1}" &&
 	(
Signature · 1 line
2.42.0.419.g70bf8a5751
#1 lore raw
Quoted 4 lines · Oswald Buddenhagen

The given test name made no sense to me at all; it seems to be a concatenation of two unrelated things. This was introduced by commit 0c164ae7a ("rebase -i: add another reword test", 20-08-20).

Quoted 8 lines

---
actually, i don't understand what the test even does. shouldn't it, to match the description, actually dirty the tree and verify that the operation fails?

Cc Phillip Wood <[email protected]>

As a typofix the updated text looks more correct, but the above is a very good point, so I'll let Phillip, whose 0c164ae7 (rebase -i: add another reword test, 2021-08-20) introduced this test, react first.

Thanks for spotting and fixing.

Quoted 17 lines
---
 t/t3404-rebase-interactive.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t3404-rebase-interactive.sh +1 -1
index 96a56aafbe..31ee5bc1f6 100755
@@ -758,7 +758,7 @@ test_expect_success 'reword' '
 	git show HEAD~2 | grep "C changed"
 '
 
-test_expect_success 'no uncommited changes when rewording the todo list is reloaded' '
+test_expect_success 'no uncommitted changes when rewording' '
 	git checkout E &&
 	test_when_finished "git checkout @{-1}" &&
 	(
#2 lore raw
Quoted 13 lines · Junio C Hamano
Quoted 11 lines · Oswald Buddenhagen

The given test name made no sense to me at all; it seems to be a concatenation of two unrelated things. This was introduced by commit 0c164ae7a ("rebase -i: add another reword test", 20-08-20).

---
actually, i don't understand what the test even does. shouldn't it, to match the description, actually dirty the tree and verify that the operation fails?

Quoted 4 lines
Quoted 1 line
Cc Phillip Wood <[email protected]>

As a typofix the updated text looks more correct, but the above is a > very good point, so I'll let Phillip, whose 0c164ae7 (rebase -i: add another reword test, 2021-08-20) introduced this test, react first.

Thanks. There is a typo, but that typo is a missing "and", the title should be

no uncommitted changes when rewording and the todo list is reloaded

The purpose of the test is to ensure that

(i) There are no uncommited changes when the editor runs. i.e. we commit without running the editor and then reword by amending that commit. This ensures that we have the same user experience whether or not the commit was fast-forwarded [1].

(ii) That the todo list is re-read after the commit has been
reworded. This is to allow the user to update the todo list while the rebase is paused for editing the commit message.

All of the action happens in the functions called from this test. set_reword_editor() sets up an editor that runs "git diff --exit-code HEAD" to ensure there are no uncommitted changes when it is run and also updates the todo list. Then check_reworded_commits() checks that the commits were reworded and that the todo list was updated.

Best Wishes

Phillip

[1] https://lore.kernel.org/git/[email protected]/

Quoted 19 lines

Thanks for spotting and fixing.

Quoted 17 lines
---
  t/t3404-rebase-interactive.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
t/t3404-rebase-interactive.sh +1 -1
index 96a56aafbe..31ee5bc1f6 100755
@@ -758,7 +758,7 @@ test_expect_success 'reword' '
  	git show HEAD~2 | grep "C changed"
  '
 
-test_expect_success 'no uncommited changes when rewording the todo list is reloaded' '
+test_expect_success 'no uncommitted changes when rewording' '
  	git checkout E &&
  	test_when_finished "git checkout @{-1}" &&
  	(
#3 lore raw

PATCH v2 1/1 t3404-rebase-interactive.sh: fix typos in title of a rewording test

This test was introduced by commit 0c164ae7a ("rebase -i: add another reword test", 2021-08-20). I didn't quite get what it was meant to do, so here's an explanation from Phillip:

The purpose of the test is to ensure that

(i) There are no uncommited changes when the editor runs. I.e., we commit without running the editor and then reword by amending that commit. This ensures that we have the same user experience whether or not the commit was fast-forwarded [1].

(ii) That the todo list is re-read after the commit has been reworded.
This is to allow the user to update the todo list while the rebase is paused for editing the commit message.

[1] https://lore.kernel.org/git/[email protected]/

---
v2:
- actually, it's kinda a new patch now

Cc Phillip Wood <[email protected]>
Cc Junio C Hamano <[email protected]>
---
 t/t3404-rebase-interactive.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t3404-rebase-interactive.sh +1 -1
index 96a56aafbe..bf94eb28b9 100755
@@ -758,7 +758,7 @@ test_expect_success 'reword' '
 	git show HEAD~2 | grep "C changed"
 '
 
-test_expect_success 'no uncommited changes when rewording the todo list is reloaded' '
+test_expect_success 'no uncommitted changes when rewording and the todo list is reloaded' '
 	git checkout E &&
 	test_when_finished "git checkout @{-1}" &&
 	(
Signature · 1 line
2.42.0.419.g70bf8a5751
#4 lore raw

Re: [PATCH v2] t3404-rebase-interactive.sh: fix typos in title of a rewording test

Quoted 5 lines · Oswald Buddenhagen

so here's an explanation from Phillip:

The purpose of the test is to ensure that

(i) There are no uncommited changes when the editor runs. I.e., we

			   ^

you may want to add the missing 't' here when applying.🙃

regards

#5 lore raw

Re: [PATCH v2] t3404-rebase-interactive.sh: fix typos in title of a rewording test

In reply to Oswald Buddenhagen
Quoted 11 lines · Oswald Buddenhagen

This test was introduced by commit 0c164ae7a ("rebase -i: add another reword test", 2021-08-20). I didn't quite get what it was meant to do, so here's an explanation from Phillip:

The purpose of the test is to ensure that

(i) There are no uncommited changes when the editor runs. I.e., we commit without running the editor and then reword by amending that commit. This ensures that we have the same user experience whether or not the commit was fast-forwarded [1].

Quoted 7 lines

(ii) That the todo list is re-read after the commit has been reworded.
This is to allow the user to update the todo list while the rebase is paused for editing the commit message.

[1] https://lore.kernel.org/git/[email protected]/

This looks good to me, Thanks

Phillip

Quoted 23 lines

---
v2:
- actually, it's kinda a new patch now

Cc Phillip Wood <[email protected]>
Cc Junio C Hamano <[email protected]>
---
  t/t3404-rebase-interactive.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
t/t3404-rebase-interactive.sh +1 -1
index 96a56aafbe..bf94eb28b9 100755
@@ -758,7 +758,7 @@ test_expect_success 'reword' '
  	git show HEAD~2 | grep "C changed"
  '
 
-test_expect_success 'no uncommited changes when rewording the todo list is reloaded' '
+test_expect_success 'no uncommitted changes when rewording and the todo list is reloaded' '
  	git checkout E &&
  	test_when_finished "git checkout @{-1}" &&
  	(
#6 lore raw

Re: [PATCH v2] t3404-rebase-interactive.sh: fix typos in title of a rewording test

Quoted 17 lines · Phillip Wood
Quoted 14 lines · Oswald Buddenhagen

This test was introduced by commit 0c164ae7a ("rebase -i: add another reword test", 2021-08-20). I didn't quite get what it was meant to do, so here's an explanation from Phillip:
The purpose of the test is to ensure that
(i) There are no uncommited changes when the editor runs. I.e.,
we
commit without running the editor and then reword by amending that commit. This ensures that we have the same user experience whether or not the commit was fast-forwarded [1].
(ii) That the todo list is re-read after the commit has been
reworded.
This is to allow the user to update the todo list while the rebase is paused for editing the commit message.
[1] https://lore.kernel.org/git/[email protected]/

Quoted 1 line
Quoted 3 lines

This looks good to me, Thanks

Phillip

Thanks, both. Will queue.