Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup rebase signoff tests #1713

Conversation

phillipwood
Copy link

@phillipwood phillipwood commented Apr 9, 2024

This series cleans up the tests for "git rebase --signoff" in preparation for extending them and fixing a couple of bugs in a future series. The cleanups are:

  • move test setup into "test_expect_success"
  • stop running git upstream of a pipe
  • restore "git rebase --apply --signoff" coverage

cc: Phillip Wood [email protected]

Perform the setup in a dedicated test so the later tests can be run
independently. Also avoid running git upstream of a pipe and take
advantage of test_commit.

Signed-off-by: Phillip Wood <[email protected]>
Using a helper function makes the tests shorter and avoids running "git
cat-file" upstream of a pipe.

Signed-off-by: Phillip Wood <[email protected]>
@phillipwood
Copy link
Author

/submit

Copy link

gitgitgadget bot commented Apr 9, 2024

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1713/phillipwood/cleanup-rebase-signoff-tests-v1

To fetch this version to local tag pr-1713/phillipwood/cleanup-rebase-signoff-tests-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1713/phillipwood/cleanup-rebase-signoff-tests-v1


git config alias.rbs "rebase --signoff"
'

# We configure an alias to do the rebase --signoff so that
# on the next subtest we can show that --no-signoff overrides the alias
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Junio C Hamano wrote (reply to this):

"Phillip Wood via GitGitGadget" <[email protected]> writes:

> From: Phillip Wood <[email protected]>
>
> Using a helper function makes the tests shorter and avoids running "git
> cat-file" upstream of a pipe.

Nice.


git config alias.rbs "rebase --signoff"
'

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Junio C Hamano wrote (reply to this):

"Phillip Wood via GitGitGadget" <[email protected]> writes:

> From: Phillip Wood <[email protected]>
>
> This test file assumes the "apply" backend is the default which is not
> the case since 2ac0d6273f (rebase: change the default backend from "am"
> to "merge", 2020-02-15). Make sure the "apply" backend is tested by
> specifying it explicitly.

Hmph, doesn't this lose coverage for the merge backend, though?

> Signed-off-by: Phillip Wood <[email protected]>
> ---
>  t/t3428-rebase-signoff.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t3428-rebase-signoff.sh b/t/t3428-rebase-signoff.sh
> index 133e54114f6..1bebd1ce74a 100755
> --- a/t/t3428-rebase-signoff.sh
> +++ b/t/t3428-rebase-signoff.sh
> @@ -38,8 +38,8 @@ test_expect_success 'setup' '
>  
>  # We configure an alias to do the rebase --signoff so that
>  # on the next subtest we can show that --no-signoff overrides the alias
> -test_expect_success 'rebase --signoff adds a sign-off line' '
> -	git rbs HEAD^ &&
> +test_expect_success 'rebase --apply --signoff adds a sign-off line' '
> +	git rbs --apply HEAD^ &&
>  	test_commit_message HEAD expected-signed
>  '

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, [email protected] wrote (reply to this):

Hi Junio

On 10/04/2024 00:08, Junio C Hamano wrote:
> "Phillip Wood via GitGitGadget" <[email protected]> writes:
> >> From: Phillip Wood <[email protected]>
>>
>> This test file assumes the "apply" backend is the default which is not
>> the case since 2ac0d6273f (rebase: change the default backend from "am"
>> to "merge", 2020-02-15). Make sure the "apply" backend is tested by
>> specifying it explicitly.
> > Hmph, doesn't this lose coverage for the merge backend, though?

I don't think so, we had coverage for the merge backend from the other tests before 2ac0d6273f as all of the other tests in this file use the merge backend. We're no longer testing "--signoff" without specifying some other option that selects a backend but it seems unlikely that we could break that without breaking one of the other tests.

Best Wishes

Phillip

> >> Signed-off-by: Phillip Wood <[email protected]>
>> ---
>>   t/t3428-rebase-signoff.sh | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/t/t3428-rebase-signoff.sh b/t/t3428-rebase-signoff.sh
>> index 133e54114f6..1bebd1ce74a 100755
>> --- a/t/t3428-rebase-signoff.sh
>> +++ b/t/t3428-rebase-signoff.sh
>> @@ -38,8 +38,8 @@ test_expect_success 'setup' '
>>   >>   # We configure an alias to do the rebase --signoff so that
>>   # on the next subtest we can show that --no-signoff overrides the alias
>> -test_expect_success 'rebase --signoff adds a sign-off line' '
>> -	git rbs HEAD^ &&
>> +test_expect_success 'rebase --apply --signoff adds a sign-off line' '
>> +	git rbs --apply HEAD^ &&
>>   	test_commit_message HEAD expected-signed
>>   '

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Junio C Hamano wrote (reply to this):

[email protected] writes:

>> Hmph, doesn't this lose coverage for the merge backend, though?
>
> I don't think so, we had coverage for the merge backend from the other
> tests before 2ac0d6273f as all of the other tests in this file use the
> merge backend. We're no longer testing "--signoff" without specifying
> some other option that selects a backend but it seems unlikely that we
> could break that without breaking one of the other tests.

OK, so we have "rebase --merge --signoff" tested elsewhere and we
are replacing "rebase --signoff" with "rebase --apply --signoff"?

Thanks.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, [email protected] wrote (reply to this):

On 10/04/2024 15:22, Junio C Hamano wrote:
> [email protected] writes:
> >>> Hmph, doesn't this lose coverage for the merge backend, though?
>>
>> I don't think so, we had coverage for the merge backend from the other
>> tests before 2ac0d6273f as all of the other tests in this file use the
>> merge backend. We're no longer testing "--signoff" without specifying
>> some other option that selects a backend but it seems unlikely that we
>> could break that without breaking one of the other tests.
> > OK, so we have "rebase --merge --signoff" tested elsewhere and we
> are replacing "rebase --signoff" with "rebase --apply --signoff"?

Exactly

> Thanks.
> 

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Junio C Hamano wrote (reply to this):

[email protected] writes:

> On 10/04/2024 15:22, Junio C Hamano wrote:
>> [email protected] writes:
>> 
>>>> Hmph, doesn't this lose coverage for the merge backend, though?
>>>
>>> I don't think so, we had coverage for the merge backend from the other
>>> tests before 2ac0d6273f as all of the other tests in this file use the
>>> merge backend. We're no longer testing "--signoff" without specifying
>>> some other option that selects a backend but it seems unlikely that we
>>> could break that without breaking one of the other tests.
>> OK, so we have "rebase --merge --signoff" tested elsewhere and we
>> are replacing "rebase --signoff" with "rebase --apply --signoff"?
>
> Exactly

Perhaps we can write that in the log message to help the next person
who reads the patch?  Something like...

    t3428: restore coverage for "apply" backend
    
    This test file assumes the "apply" backend is the default which is
    not the case since 2ac0d6273f (rebase: change the default backend
    from "am" to "merge", 2020-02-15).  The way "merge" backend honors
    "--signoff" is already tested elsewhere, so make sure the "apply"
    backend is tested by specifying it explicitly.
    
    Signed-off-by: Phillip Wood <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, [email protected] wrote (reply to this):

On 10/04/2024 17:45, Junio C Hamano wrote:
> [email protected] writes:
> >> On 10/04/2024 15:22, Junio C Hamano wrote:
>>> [email protected] writes:
>>>
>>>>> Hmph, doesn't this lose coverage for the merge backend, though?
>>>>
>>>> I don't think so, we had coverage for the merge backend from the other
>>>> tests before 2ac0d6273f as all of the other tests in this file use the
>>>> merge backend. We're no longer testing "--signoff" without specifying
>>>> some other option that selects a backend but it seems unlikely that we
>>>> could break that without breaking one of the other tests.
>>> OK, so we have "rebase --merge --signoff" tested elsewhere and we
>>> are replacing "rebase --signoff" with "rebase --apply --signoff"?
>>
>> Exactly
> > Perhaps we can write that in the log message to help the next person
> who reads the patch?  Something like...
> >      t3428: restore coverage for "apply" backend
>      >      This test file assumes the "apply" backend is the default which is
>      not the case since 2ac0d6273f (rebase: change the default backend
>      from "am" to "merge", 2020-02-15).  The way "merge" backend honors
>      "--signoff" is already tested elsewhere, so make sure the "apply"
>      backend is tested by specifying it explicitly.
>      >      Signed-off-by: Phillip Wood <[email protected]>
>      Signed-off-by: Junio C Hamano <[email protected]>

Sounds good, I'll send a re-roll

Thanks

Phillip

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the Git mailing list, Phillip Wood wrote (reply to this):

On 12/04/2024 10:33, [email protected] wrote:
> On 10/04/2024 17:45, Junio C Hamano wrote:
>> [email protected] writes:
>> Perhaps we can write that in the log message to help the next person
>> who reads the patch?  Something like...
>>
>>      t3428: restore coverage for "apply" backend
>>      This test file assumes the "apply" backend is the default which is
>>      not the case since 2ac0d6273f (rebase: change the default backend
>>      from "am" to "merge", 2020-02-15).  The way "merge" backend honors
>>      "--signoff" is already tested elsewhere, so make sure the "apply"
>>      backend is tested by specifying it explicitly.
>>      Signed-off-by: Phillip Wood <[email protected]>
>>      Signed-off-by: Junio C Hamano <[email protected]>
> > Sounds good, I'll send a re-roll

Oh, it looks like this hit next yesterday

Phillip

Copy link

gitgitgadget bot commented Apr 10, 2024

This branch is now known as pw/t3428-cleanup.

Copy link

gitgitgadget bot commented Apr 10, 2024

This patch series was integrated into seen via git@b9d7312.

@gitgitgadget gitgitgadget bot added the seen label Apr 10, 2024
Copy link

gitgitgadget bot commented Apr 10, 2024

This patch series was integrated into seen via git@f35b092.

Copy link

gitgitgadget bot commented Apr 11, 2024

This patch series was integrated into seen via git@f4c219c.

Copy link

gitgitgadget bot commented Apr 11, 2024

This patch series was integrated into next via git@3c40516.

@gitgitgadget gitgitgadget bot added the next label Apr 11, 2024
This test file assumes the "apply" backend is the default which is not
the case since 2ac0d62 (rebase: change the default backend from "am"
to "merge", 2020-02-15).  The way "merge" backend honors "--signoff" is
already tested elsewhere, so make sure the "apply" backend is tested by
specifying it explicitly.

Signed-off-by: Phillip Wood <[email protected]>
@phillipwood phillipwood force-pushed the cleanup-rebase-signoff-tests branch from b45af37 to 7d796c7 Compare April 12, 2024 13:37
Copy link

gitgitgadget bot commented Apr 12, 2024

User Phillip Wood <[email protected]> has been added to the cc: list.

Copy link

gitgitgadget bot commented Apr 12, 2024

This patch series was integrated into seen via git@97b69ff.

Copy link

gitgitgadget bot commented Apr 12, 2024

This patch series was integrated into seen via git@dfb36b3.

Copy link

gitgitgadget bot commented Apr 13, 2024

There was a status update in the "New Topics" section about the branch pw/t3428-cleanup on the Git mailing list:

Test cleanup.

Will merge to 'master'.
source: <[email protected]>

Copy link

gitgitgadget bot commented Apr 15, 2024

This patch series was integrated into seen via git@26b5e59.

Copy link

gitgitgadget bot commented Apr 15, 2024

This patch series was integrated into seen via git@a7c9e28.

Copy link

gitgitgadget bot commented Apr 16, 2024

This patch series was integrated into seen via git@93e3f9d.

Copy link

gitgitgadget bot commented Apr 16, 2024

This patch series was integrated into master via git@93e3f9d.

Copy link

gitgitgadget bot commented Apr 16, 2024

This patch series was integrated into next via git@93e3f9d.

@gitgitgadget gitgitgadget bot added the master label Apr 16, 2024
@gitgitgadget gitgitgadget bot closed this Apr 16, 2024
Copy link

gitgitgadget bot commented Apr 16, 2024

Closed via 93e3f9d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant