Re: [PATCH v3] commit: restore --edit when combined with --fixup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 14, 2021, at 17:20, Phillip Wood wrote:
> On 13/08/2021 16:35, Joel Klinghed wrote:
> > 
> > With the above change use_editor no longer defaults to 0 for --fixup as
> > it used to do.
> > My expected behavior (based on old versions):
> > git commit --fixup <hash>  /// No editor
> > git commit --fixup <hash> --edit  /// Editor
> > As far as I can see your change would display an editor in both cases.
> 
> I've just tested it and it works as expected. However moving the
> 'if (logfile...)' breaks the test "commit --squash works with -c" so we
> need to just move the second if clause. This is what I have on top of
> master (i.e. without your patch so a plain fixup is still setting
> use_editor=0)
> 

Ah, my bad. I misunderstood and thought your first patch was to
be applied without my fixes. This way is cleaner, no doubt.

> diff --git a/t/t7500-commit-template-squash-signoff.sh 
> b/t/t7500-commit-template-squash-signoff.sh
> index 54c2082acb..3fa674e52d 100755
> --- a/t/t7500-commit-template-squash-signoff.sh
> +++ b/t/t7500-commit-template-squash-signoff.sh
> @@ -270,7 +270,7 @@ EOF
>   
>   test_expect_success 'commit --fixup provides correct one-line commit 
> message' '
>          commit_for_rebase_autosquash_setup &&
> -       git commit --fixup HEAD~1 &&
> +       EDITOR="printf \"something\nextra\" >>" git commit --fixup 
> HEAD~1 &&
>          commit_msg_is "fixup! target message subject line"
>   '

Good idea to make --fixup without edit behavior verification explicit.

/JK



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux