Re: [PATCH 3/3] pull: introduce --[no-]autostash and pull.autostash
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Apr 16, 2013, 09:20 UTC
- Message-ID
- <CALkWK0ndk7hPYk4pN8gmLxLOJR0XsLo1gwHB=n0QkK6DHgLzKQ@mail.gmail.com>
- In-Reply-To
- <vpqli8je8w0.fsf@grenoble-inp.fr>
Matthieu Moy wrote:
Show 8 quoted lines
> Because "git rebase" needs multiple runs in case of conflicts. You have > to store the information somewhere in the filesystem, not in a variable. > What you need to store is whether you need to unstash, and where you are > in the process (in Junio's version, you may be doing the actual rebase, > or fixing conflicts in index state application, or fixing conflicts in > tree state application, or done). Storing what you have to do and where > you are in the process really sounds like a job for the instruction > sheet, no?
No. Ultimately, the entry point of all these invocations is git-rebase.sh. The plan is to refactor calls from git-rebase.sh to git-rebase--*.sh scripts so that those scripts return control to git-rebase.sh, which will be the final exit point. The logic is very simple: On the very first invocation of rebase (ie. no existing rebase in progress), stash. If the return statement from the specific rebase script is 1 (which means that there are conflicts to be resolved), exit as usual. If it is 0 (which means that the rebase completely successfully), pop the stash before exiting as usual.
What's so complicated about that? I'm against leaking the autostash implementation detail into specific rebases, because I value a clean and pleasant implementation over everything else.