On Sun, Sep 09, 2007 at 12:46:48AM -0400, Shawn O. Pearce wrote: > "Dmitry V. Levin" wrote: [...] > > Would "git reset --soft HEAD^" advice be better than first one? > > Could you suggest a better message, please? > > Hmm. I think you want something like this perhaps? > > if test "$tree" = "$current_tree" > then > if test z$amend = zt > then > echo >&2 "nothing to amend (use \"git reset --soft HEAD^\" to discard last commit)" > else > echo >&2 "nothing to commit" > fi > fi Yes, something like this is better, thank you. > Because there's this weird trick where you can amend the last commit > using a dirty index and in the process maybe cause the last commit > to have the same tree as his parent. In such a case you would want > to discard the last commit instead of amending it. > > But I have to also wonder, aside from the sick amend case I just > talked about, how does one get to this part of git-commit.sh with > nothing to commit? This is necessary for the next (2/2) proposed change to git-commit: I sometimes have to run git-commit without running costly git-runstatus. -- ldv
Attachment:
pgpBtUxFmDBef.pgp
Description: PGP signature