[PATCH v3] pull: ff --rebase --autostash works in dirty repo

2017-05-31 Thread Tyler Brazier
if autostash is not in effect. Based on a few tests against the git.git repo, the shortcut does not seem to give us significant performance benefits, on Linux at least. Regardless, it is more important to be correct than to be fast. Signed-off-by: Tyler Brazier <ty...@tylerbrazier.com> --- b

[PATCH v2] pull: ff --rebase --autostash works in dirty repo

2017-05-30 Thread Tyler Brazier
When `git pull --rebase --autostash` in a dirty repository resulted in a fast-forward, nothing was being autostashed and the pull failed. This was due to a shortcut to avoid running rebase when we can fast-forward, but autostash is ignored on that codepath. Now we will only take the shortcut if

[PATCH] pull: ff --rebase --autostash works in dirty repo

2017-05-28 Thread Tyler Brazier
pull --rebase --autostash was failing on a fast-forward in a dirty repo since we shortcut to run_merge(), which does not know how to autostash. The shortcut is a performance optimization, and since rebase was rewritten in C, it seemed okay to just bypass the shortcut if we autostash. ---

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

`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