git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 20, 2016, 02:14 UTC
Message-ID
<CAPig+cQvpGgWzT9rXSx_9TR8fg0TrUf+dSs91iRinbbdwo39cg@mail.gmail.com>
In-Reply-To
<CA+DCAeTnvEZjcGaS=Ed95bGYHRqV-svtTY-hX8gEbXstbkYe5A@mail.gmail.com>
On Fri, Mar 18, 2016 at 11:17 AM, Mehul Jain <mehul.jain2029@gmail.com> wrote:
Show 27 quoted lines
> On Fri, Mar 18, 2016 at 10:09 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> 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?
>
> This is interesting. I checked out git-rebase.sh and found that it reads
> rebase.autoStash if nothing is specified by user. So if user is not
> specifying anything about stashing then it is the job of git-rebase
> to decide whether or not to do stashing by reading rebase.autoStash.
>
> Similarly if user doesn't specify the --[no-]autostash option to git-pull
> then neither of --autostash and --no-autstash should be passed to the
> git-rebase as it will decide on his own about what needs to be done.
> Agreed. I made a unnecessary tight coupling between git-pull and
> git-rebase. Instead of that the following changes can be done to
> remove it.
>
> This way there's no need to remove "autostash" from the current code
> base and instead use it to write a much cleaner patch.  Something like
> this (this is w.r.t. current code base)
> [...]
>
> What are your views on this?

I think this makes the patches cleaner and the final code nicer, and it eliminates the too-tight coupling between the two commands, so it seems to be a win overall.

Previous: Mehul JainNext: Mehul Jain
Message 6 of 8 in “git-pull.c: introduce git_pull_config()”
  1. 1/2 git-pull.c: introduce git_pull_config()Mehul Jain, Mar 17, 2016
  2. 2/2 pull --rebase: add --[no-]autostash flagMehul Jain, Mar 17, 2016
  3. Eric SunshineMar 18, 2016
  4. Eric SunshineMar 18, 2016
  5. Mehul JainMar 18, 2016
  6. Eric SunshineMar 20, 2016
  7. Mehul JainMar 18, 2016
  8. Eric SunshineMar 20, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.