Re: [PATCH 1/3] t3403: fix commit authorship

3 messages, 3 authors, 2021-08-14 · open the first message on its own page

Re: [PATCH 1/3] t3403: fix commit authorship

From: Junio C Hamano <hidden>
Date: 2021-08-10 18:43:58

Elijah Newren [off-list ref] writes:
On Tue, Aug 10, 2021 at 2:32 AM Phillip Wood via GitGitGadget
[off-list ref] wrote:
quoted
From: Phillip Wood <redacted>

Setting GIT_AUTHOR_* when committing with --amend will only change the
author if we also pass --reset-author

Signed-off-by: Phillip Wood <redacted>
---
 t/t3403-rebase-skip.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index e26762d0b29..6365c5af2f7 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -36,7 +36,8 @@ test_expect_success setup '
        test_tick &&
        GIT_AUTHOR_NAME="Another Author" \
                GIT_AUTHOR_EMAIL="another.author@example.com" \
-               git commit --amend --no-edit -m amended-goodbye &&
+               git commit --amend --no-edit -m amended-goodbye \
+                       --reset-author &&
Makes sense...but doesn't the fact that this test worked either way
suggest that the specifying of a special author name/email was totally
superfluous and could just be removed?  If there really was a reason
for specifying a different name/email, then is the test faulty for not
checking for it somewhere?
Good point.  The commit tagged with amended-goodbye is later used in
some tests that ensure the author ident does not change across a
rebase.  If this commit gets created without authorship customized
(i.e. before Phillip's fix), we would not catch a possible breakage
to make rebase discard the original authorship information.

But with this fix, we now can catch such a breakage.

Thanks.

Re: [PATCH 1/3] t3403: fix commit authorship

From: Phillip Wood <hidden>
Date: 2021-08-12 10:04:58

On 10/08/2021 19:43, Junio C Hamano wrote:
Elijah Newren [off-list ref] writes:
quoted
On Tue, Aug 10, 2021 at 2:32 AM Phillip Wood via GitGitGadget
[off-list ref] wrote:
quoted
From: Phillip Wood <redacted>

Setting GIT_AUTHOR_* when committing with --amend will only change the
author if we also pass --reset-author

Signed-off-by: Phillip Wood <redacted>
---
  t/t3403-rebase-skip.sh | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index e26762d0b29..6365c5af2f7 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -36,7 +36,8 @@ test_expect_success setup '
         test_tick &&
         GIT_AUTHOR_NAME="Another Author" \
                 GIT_AUTHOR_EMAIL="another.author@example.com" \
-               git commit --amend --no-edit -m amended-goodbye &&
+               git commit --amend --no-edit -m amended-goodbye \
+                       --reset-author &&
Makes sense...but doesn't the fact that this test worked either way
suggest that the specifying of a special author name/email was totally
superfluous and could just be removed?  If there really was a reason
for specifying a different name/email, then is the test faulty for not
checking for it somewhere?
Good point.  The commit tagged with amended-goodbye is later used in
some tests that ensure the author ident does not change across a
rebase.  If this commit gets created without authorship customized
(i.e. before Phillip's fix), we would not catch a possible breakage
to make rebase discard the original authorship information.

But with this fix, we now can catch such a breakage.
I'll expand the commit message to make that clear

Thanks

Phillip

Re: [PATCH 1/3] t3403: fix commit authorship

From: Johannes Schindelin <hidden>
Date: 2021-08-14 21:56:03

Hi Phillip,

On Thu, 12 Aug 2021, Phillip Wood wrote:
On 10/08/2021 19:43, Junio C Hamano wrote:
quoted
Elijah Newren [off-list ref] writes:
quoted
On Tue, Aug 10, 2021 at 2:32 AM Phillip Wood via GitGitGadget
[off-list ref] wrote:
quoted
From: Phillip Wood <redacted>

Setting GIT_AUTHOR_* when committing with --amend will only change the
author if we also pass --reset-author

Signed-off-by: Phillip Wood <redacted>
---
  t/t3403-rebase-skip.sh | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh
index e26762d0b29..6365c5af2f7 100755
--- a/t/t3403-rebase-skip.sh
+++ b/t/t3403-rebase-skip.sh
@@ -36,7 +36,8 @@ test_expect_success setup '
         test_tick &&
         GIT_AUTHOR_NAME="Another Author" \
                 GIT_AUTHOR_EMAIL="another.author@example.com" \
-               git commit --amend --no-edit -m amended-goodbye &&
+               git commit --amend --no-edit -m amended-goodbye \
+                       --reset-author &&
Makes sense...but doesn't the fact that this test worked either way
suggest that the specifying of a special author name/email was totally
superfluous and could just be removed?  If there really was a reason
for specifying a different name/email, then is the test faulty for not
checking for it somewhere?
Good point.  The commit tagged with amended-goodbye is later used in
some tests that ensure the author ident does not change across a
rebase.  If this commit gets created without authorship customized
(i.e. before Phillip's fix), we would not catch a possible breakage
to make rebase discard the original authorship information.

But with this fix, we now can catch such a breakage.
I'll expand the commit message to make that clear
Maybe you could even add a `test another.author@example.com = $(git show
-s --format=%ae HEAD)`?

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help