Re: `pull --rebase --autostash` fails when fast forward in dirty repo

2017-05-25 Thread Junio C Hamano
Tyler Brazier writes: > On Thu, May 25, 2017 at 6:33 PM, Junio C Hamano wrote: >> Jeff King writes: >> >>> Anyway. All this has shown me is that it's probably pointless to do this >>> timing at all on Linux. Somebody on Windows might

Re: `pull --rebase --autostash` fails when fast forward in dirty repo

2017-05-25 Thread Tyler Brazier
Does git accept outside pull requests? I wouldn't mind committing the fix for this once it's been decided what the fix should be. (It might help my resume ;) On Thu, May 25, 2017 at 6:33 PM, Junio C Hamano wrote: > Jeff King writes: > >> Anyway. All this has

Re: `pull --rebase --autostash` fails when fast forward in dirty repo

2017-05-25 Thread Junio C Hamano
Jeff King writes: > Anyway. All this has shown me is that it's probably pointless to do this > timing at all on Linux. Somebody on Windows might get better results. > > But regardless, we need to do something. Correctness must trump > optimizations, and the question is whether we

Re: `pull --rebase --autostash` fails when fast forward in dirty repo

2017-05-25 Thread Jeff King
On Thu, May 25, 2017 at 02:04:07PM -0400, Jeff King wrote: > > ...that might be something worth thinking about---my gut feeling > > tells me something but we should go by a measurement, not by gut > > feeling of a random somebody. > > Yeah, I'd agree. I had the impression the original change was

Re: `pull --rebase --autostash` fails when fast forward in dirty repo

2017-05-25 Thread Jeff King
On Wed, May 24, 2017 at 07:40:08AM +0900, Junio C Hamano wrote: > > But I notice on the run_merge() code path that we do still invoke > > git-merge. > > ... wouldn't that what we want even when the merge happens to be a > fast-forward one? I am not sure what you meant by this, but... I just

Re: `pull --rebase --autostash` fails when fast forward in dirty repo

2017-05-23 Thread Junio C Hamano
Jeff King writes: > ...we can probably restrict it to when autostash is in use, like: > > /* >* If this is a fast-forward, we can skip calling rebase and >* just do the merge ourselves. But we don't know about >* autostash, so use the real rebase command when it's in

Re: `pull --rebase --autostash` fails when fast forward in dirty repo

2017-05-23 Thread Jeff King
[+cc Junio, whose code this is touching] On Sun, May 21, 2017 at 12:17:06AM -0500, Tyler Brazier wrote: > This script explains and tests what's going on: > https://gist.github.com/tylerbrazier/4478e76fe44bf6657d4d3da6c789531d > > pull is failing because it shortcuts to --ff-only then calls >

`pull --rebase --autostash` fails when fast forward in dirty repo

2017-05-20 Thread Tyler Brazier
Hi, This script explains and tests what's going on: https://gist.github.com/tylerbrazier/4478e76fe44bf6657d4d3da6c789531d pull is failing because it shortcuts to --ff-only then calls run_merge(), which does not know how to autostash. Removing the shortcut fixes the problem: diff --git