reset: Make reset remove the sequencer state
authorRamkumar Ramachandra <artagnon@gmail.com>
Thu, 4 Aug 2011 10:39:12 +0000 (16:09 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2011 16:24:50 +0000 (09:24 -0700)
commit95eb88d8ee588d89b4f06d2753ed4d16ab13b39f
treeee9bd4f977a3f4c1df67cb42e4d90dc709f90ac9
parent26ae337be11e440420d8ec7ce415425daaabe573
reset: Make reset remove the sequencer state

Years of muscle memory have trained users to use "git reset --hard" to
remove the branch state after any sort operation.  Make it also remove
the sequencer state to facilitate this established workflow:

  $ git cherry-pick foo..bar
  ... conflict encountered ...
  $ git reset --hard # Oops, I didn't mean that
  $ git cherry-pick quux..bar
  ... cherry-pick succeeded ...

Guard against accidental removal of the sequencer state by providing
one level of "undo".  In the first "reset" invocation,
".git/sequencer" is moved to ".git/sequencer-old"; it is completely
removed only in the second invocation.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c
t/t7106-reset-sequence.sh [new file with mode: 0755]