From ac083c47ea226b470afab39d975e718a475a3c78 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Thu, 3 Jul 2008 00:00:00 +0200 Subject: git-add--interactive: manual hunk editing mode Adds a new option 'e' to the 'add -p' command loop that lets you edit the current hunk in your favourite editor. If the resulting patch applies cleanly, the edited hunk will immediately be marked for staging. If it does not apply cleanly, you will be given an opportunity to edit again. If all lines of the hunk are removed, then the edit is aborted and the hunk is left unchanged. Applying the changed hunk(s) relies on Johannes Schindelin's new --recount option for git-apply. Note that the "real patch" test intentionally uses (echo e; echo n; echo d) | git add -p even though the 'n' and 'd' are superfluous at first sight. They serve to get out of the interaction loop if git add -p wrongly concludes the patch does not apply. Many thanks to Jeff King for lots of help and suggestions. Signed-off-by: Thomas Rast Signed-off-by: Junio C Hamano --- Documentation/git-add.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'Documentation/git-add.txt') diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 011a743652..46dd56c12a 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -236,6 +236,7 @@ patch:: k - leave this hunk undecided, see previous undecided hunk K - leave this hunk undecided, see previous hunk s - split the current hunk into smaller hunks + e - manually edit the current hunk ? - print help + After deciding the fate for all hunks, if there is any hunk -- cgit v1.2.3