Re: [PATCH v9 2/2] pull --rebase: add --[no-]autostash flag
From: Eric Sunshine <hidden>
Date: 2016-06-15 23:08:48
On Fri, Mar 18, 2016 at 12:24 AM, Eric Sunshine [off-list ref] wrote:
On Thu, Mar 17, 2016 at 12:49 PM, Mehul Jain [off-list ref] wrote:quoted
@@ -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"