Re: [PATCH] git-add: introduce --edit (to edit the diff vs. the index)
- From
Sverre Rabbelier <srabbelier@gmail.com>
- Date
- Apr 13, 2009, 16:59 UTC
- Message-ID
- <fabb9a1e0904130959y20ff66a8la426f33dc0a9bf8b@mail.gmail.com>
- In-Reply-To
- <alpine.DEB.1.00.0904131817160.10279@pacific.mpi-cbg.de>
Heya,
On Mon, Apr 13, 2009 at 18:19, Johannes Schindelin <Johannes.Schindelin@gmx.de> > Would not a much saner way be
Show 9 quoted lines
> > $ git reset HEAD^ > $ git add -p > $ git stash save --keep-index > # test it > $ git commit > $ git stash apply > # test again > $ git commit
That's what I do already, but now imagine that at the # test it step I notice that I staged too much, or need to tweak some value only in this commit (e.g., change test_expect_success to test_expect_failure because this commit is the test that indicates the failure, and the next one will fix it and flip from expect_failure to expect_success). At the moment I have to make the change in my working directory (which potentially involved deleting a lot of hunks), stage that and _then_ make my commit. With 'git add -e' I can make the fix and happily continue.
-- Cheers, Sverre Rabbelier