From: Eric Sunshine <sunshine@sunshineco.com>
To: Mehul Jain <mehul.jain2029@gmail.com>
Cc: Git List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>,
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Paul Tan <pyokagan@gmail.com>
Subject: Re: [PATCH v9 2/2] pull --rebase: add --[no-]autostash flag
Date: Fri, 18 Mar 2016 00:39:54 -0400 [thread overview]
Message-ID: <CAPig+cQg2gYbr26X6PPQ6bobkxbufSSNtA1T94kdyEKQwHZXBw@mail.gmail.com> (raw)
In-Reply-To: <CAPig+cQHbGAB=XCVWtC1MuubWUFc0tT-+ZGD+hW18whJP_U0_Q@mail.gmail.com>
On Fri, Mar 18, 2016 at 12:24 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Thu, Mar 17, 2016 at 12:49 PM, Mehul Jain <mehul.jain2029@gmail.com> 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"
next prev parent reply other threads:[~2016-03-18 4:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-17 16:49 [PATCH v9 1/2] git-pull.c: introduce git_pull_config() Mehul Jain
2016-03-17 16:49 ` [PATCH v9 2/2] pull --rebase: add --[no-]autostash flag Mehul Jain
2016-03-18 4:24 ` Eric Sunshine
2016-03-18 4:39 ` Eric Sunshine [this message]
2016-03-18 15:17 ` Mehul Jain
2016-03-20 2:14 ` Eric Sunshine
2016-03-18 15:17 ` Mehul Jain
2016-03-20 2:01 ` Eric Sunshine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPig+cQg2gYbr26X6PPQ6bobkxbufSSNtA1T94kdyEKQwHZXBw@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mehul.jain2029@gmail.com \
--cc=pyokagan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).