Git autostash doesn't

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Git autostash doesn't

Ryan Schmidt-24
I don't understand why I get the error:

Please commit your changes or stash them before you merge.

when the command I'm running (via "sudo port sync") is "/opt/local/bin/git pull --rebase --autostash".

Why won't it automatically stash? Usually it does, but apparently not when there are conflicts.
Reply | Threaded
Open this post in threaded view
|

Re: Git autostash doesn't

Brandon Allbery

On Thu, Mar 9, 2017 at 2:51 PM, Ryan Schmidt <[hidden email]> wrote:
Why won't it automatically stash? Usually it does, but apparently not when there are conflicts.

The manpage for git pull warns that --autostash has edge cases/restrictions.

--
brandon s allbery kf8nh                               sine nomine associates
[hidden email]                                  [hidden email]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
Reply | Threaded
Open this post in threaded view
|

Re: Git autostash doesn't

Ryan Schmidt-24

> On Mar 9, 2017, at 14:18, Brandon Allbery <[hidden email]> wrote:
>
>
> On Thu, Mar 9, 2017 at 2:51 PM, Ryan Schmidt <[hidden email]> wrote:
> Why won't it automatically stash? Usually it does, but apparently not when there are conflicts.
>
> The manpage for git pull warns that --autostash has edge cases/restrictions.

I only see:

 --autostash, --no-autostash
     Before starting rebase, stash local modifications away (see git-stash(1)) if
     needed, and apply the stash when done.  --no-autostash is useful to override
     the rebase.autoStash configuration variable (see git-config(1)).

     This option is only valid when "--rebase" is used.



Reply | Threaded
Open this post in threaded view
|

Re: Git autostash doesn't

Brandon Allbery
On Thu, Mar 9, 2017 at 5:39 PM, Ryan Schmidt <[hidden email]> wrote:
> On Mar 9, 2017, at 14:18, Brandon Allbery <[hidden email]> wrote:
> On Thu, Mar 9, 2017 at 2:51 PM, Ryan Schmidt <[hidden email]> wrote:
> Why won't it automatically stash? Usually it does, but apparently not when there are conflicts.
>
> The manpage for git pull warns that --autostash has edge cases/restrictions.

I only see:

Gleh. I thought there was a full discussion in there somewhere, but I just tried to chase it through git-rebase and git-config and neither had more than the minimal warning. But I thought one of the issues people raised against making autostash the default was specifically that there are nasty edge cases other than the mentioned one of possibly leading to significant conflicts when the stashed changes are applied.

That said, there is also the implicit one: it's only applicable if rebasing. Merges will merge with your changes, not stash them; rebases need to work from a tree that matches a series of upstream commits (possibly with additional local commits, but no uncommitted changes) and force stashing.

--
brandon s allbery kf8nh                               sine nomine associates
[hidden email]                                  [hidden email]
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net