[PATCH] git add --interactive: Autoselect single patch file

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jörg Sommer
Date: Friday, March 21, 2008 - 6:22 pm

If there's only one file to patch, select it automaticly and don't bother
the user. In the case he didn't want do patching, he can say 'd' at the
patch prompt.

Signed-off-by: Jörg Sommer <joerg@alea.gnuu.de>
---
 git-add--interactive.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index a0a81f1..77ad6fb 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -778,7 +778,7 @@ sub patch_update_cmd {
 		print STDERR "No changes.\n";
 		return 0;
 	}
-	if ($patch_mode) {
+	if ($patch_mode or @mods == 1) {
 		@them = @mods;
 	}
 	else {
-- 
1.5.4.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] git add --interactive: Autoselect single patch file, Jörg Sommer, (Fri Mar 21, 6:22 pm)
Re: [PATCH] git add --interactive: Autoselect single patch ..., Johannes Schindelin, (Sat Mar 22, 7:51 am)
Re: [PATCH] git add --interactive: Autoselect single patch ..., Johannes Schindelin, (Sat Mar 22, 9:00 am)