Bug 235861

Summary: [git-webkit] Autostash when pulling
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jbedard, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=222847

Description Ryosuke Niwa 2022-01-29 12:49:13 PST
% ./Tools/Scripts/git-webkit up    
Downloading whichcraft-0.6.1...
Installing whichcraft-0.6.1...
Installed whichcraft-0.6.1!
error: cannot pull with rebase: You have unstaged changes.
error: additionally, your index contains uncommitted changes.
error: please commit or stash them.

% ./Tools/Scripts/git-webkit pull
error: cannot pull with rebase: You have unstaged changes.
error: additionally, your index contains uncommitted changes.
error: please commit or stash them.

This doesn't work. I need the ability to rebase against remote main without having to commit or stash local changes.
Comment 1 Jonathan Bedard 2022-01-31 13:55:13 PST
The implementation that first came to my mind would be controversial because it wouldn't work well from a branch, but turns out that `git pull` has an `--autostash` option, which should do what you're asking.
Comment 2 Ryosuke Niwa 2022-01-31 14:00:05 PST
(In reply to Jonathan Bedard from comment #1)
> The implementation that first came to my mind would be controversial because
> it wouldn't work well from a branch, but turns out that `git pull` has an
> `--autostash` option, which should do what you're asking.

oh, that's neat. so that'll stash, pull, then stash apply?
Comment 3 Jonathan Bedard 2022-01-31 15:45:59 PST
(In reply to Ryosuke Niwa from comment #2)
> (In reply to Jonathan Bedard from comment #1)
> > The implementation that first came to my mind would be controversial because
> > it wouldn't work well from a branch, but turns out that `git pull` has an
> > `--autostash` option, which should do what you're asking.
> 
> oh, that's neat. so that'll stash, pull, then stash apply?

Looks like it creates a temporary stash commit to be compatible with --rebase, but basically yes.
Comment 4 Radar WebKit Bug Importer 2022-01-31 15:47:54 PST
<rdar://problem/88298948>
Comment 5 Jonathan Bedard 2022-01-31 15:50:24 PST
Pull request: https://github.com/WebKit/WebKit/pull/113
Comment 6 Jonathan Bedard 2022-02-08 10:37:24 PST
Landed 246972@main (r289386)