Re: [PATCH v9 2/2] pull --rebase: add --[no-]autostash flag

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

 



On Fri, Mar 18, 2016 at 12:24 AM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> On Thu, Mar 17, 2016 at 12:49 PM, Mehul Jain <mehul.jain2029@xxxxxxxxx> wrote:
>> @@ -801,6 +804,7 @@ static int run_rebase(const unsigned char *curr_head,
>>         argv_array_pushv(&args, opt_strategy_opts.argv);
>>         if (opt_gpg_sign)
>>                 argv_array_push(&args, opt_gpg_sign);
>> +       argv_array_push(&args, opt_autostash ? "--autostash" : "--no-autostash");
>
> At this point, we know that opt_autostash can't be -1 (thus
> incorrectly triggering use of --autostash) because the conditional in
> cmd_pull() set it to the value of config_autostash (either 0 or 1) if
> the user did not specify it on the command-line. Okay. Makes sense.

Actually, this is going to pass --autostash or --no-autostash to
git-rebase unconditionally won't it? This seems kind of undesirable
due to the unnecessarily tight coupling it creates between the two
commands. I wasn't paying close attention to the earlier discussion,
but wasn't the idea that you should pass one of these two options
along to git-rebase only if the user explicitly asked to do by saying
so on the command line?

In other words:

* invoke "git-rebase --autostash" only if the user typed "git pull
--rebase --autostash"

* invoke "git-rebase --no-autostash" only if the user typed "git pull
--rebase --no-autostash"

* invoke "git rebase" if the user typed bare "git pull --rebase"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]