git-add: introduce --edit (to edit the diff vs. the index)add-e
commit61c07126e28aba0a36730da06112bd2d16eabc1b
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 11 Nov 2008 23:32:47 +0000 (12 00:32 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 8 Apr 2009 21:22:31 +0000 (8 23:22 +0200)
tree2071cec35d6ec3c0eae95a5c4162d9d4a0494206
parent24c24c601d286ec62fedd8d18a591f48feca05f4
git-add: introduce --edit (to edit the diff vs. the index)

With "git add -e [<files>]", Git will fire up an editor with the current
diff relative to the index (i.e. what you would get with "git diff
[<files>]").

Now you can edit the patch as much as you like, including adding/removing
lines, editing the text, whatever.  Make sure, though, that the first
character of the hunk lines is still a space, a plus or a minus.

After you closed the editor, Git will adjust the line counts of the
hunks if necessary, thanks to the --fixup-line-counts option of apply,
and commit the patch.  Except if you deleted everything, in which case
nothing happens (for obvious reasons).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Documentation/git-add.txt
builtin-add.c
t/t3702-add-edit.sh [new file with mode: 0755]