threads / patch / 12362

patchgit add --interactive: Autoselect single patch file

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

## tl;dr

2 messages between Feb 28, 2008 and Feb 29, 2008. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Jörg Sommer· Feb 28, 2008, 11:15 UTC · lore
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.
---
 git-add--interactive.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-add--interactive.perl +1 −1
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.3
Xavier Maillard· Feb 29, 2008, 02:00 UTC · re: Jörg Sommer · lore

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

   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.
Like this quick-win.
Tested-by: Xavier Maillard <xma@gnu.org>
	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org

← back to recent threads