Re: [PATCH 7/7] rebase: implement --[no-]autostash and rebase.autostash
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Apr 24, 2013, 17:52 UTC
- Message-ID
- <vpq8v47q0ji.fsf@grenoble-inp.fr>
- In-Reply-To
- <CABURp0onypkDFiovYP4s0UuBV+oFp3rPv1Jq8dGbxZhKU_sgsQ@mail.gmail.com>
Phil Hord <phil.hord@gmail.com> writes:
> Because I am in a git-rebase which has apparently failed, I would > expect 'git rebase --abort' would save me here.
More generally, if I "git rebase --abort" in the middle of a rebase (not necessarily at the end), I'd expect the stash to be restored. Right now, if I read correctly, "git rebase --abort" would discard the stashed changes without giving me the sha1 I'd need to use to recover it :-(.
Recovering the stash should be doable with stg like
--- a/git-rebase.sh +++ b/git-rebase.sh @@ -341,6 +341,11 @@ abort) ;; esac output git reset --hard $orig_head + if test -f "$state_dir/autostash" + then + stash_sha1=$(cat "$state_dir/autostash") + git stash apply $stash_sha1 + fi rm -r "$state_dir" exit ;; the "stash apply" should succeed without conflict by construction because the stash is applied on the commit it was created.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/