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

2 messages from 2008-02-28 to 2008-02-29. Participants: Jörg Sommer, Xavier Maillard.
Thread: https://gitlist.dev/t/12362

## Jörg Sommer, 2008-02-28 11:15

Subject: [PATCH] git add --interactive: Autoselect single patch file
Message-ID: <1204197336-615-1-git-send-email-joerg@alea.gnuu.de>
URL: https://gitlist.dev/e/1204197336-615-1-git-send-email-joerg%40alea.gnuu.de

```
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(-)

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, 2008-02-29 02:00

Subject: Re: [PATCH] git add --interactive: Autoselect single patch file
Message-ID: <200802290200.m1T20KYS018031@localhost.localdomain>
URL: https://gitlist.dev/e/200802290200.m1T20KYS018031%40localhost.localdomain
In-Reply-To: <1204197336-615-1-git-send-email-joerg@alea.gnuu.de>

```

   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

```
