git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
JSJörg Sommer <joerg@alea.gnuu.de>
Date
Mar 22, 2008, 01:22 UTC
Message-ID
<1206148960-29563-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.

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
Next: Johannes Schindelin
Message 1 of 4 in “git add --interactive: Autoselect single patch file”
  1. git add --interactive: Autoselect single patch fileJörg Sommer, Mar 22, 2008
  2. Johannes SchindelinMar 22, 2008
  3. Wincent ColaiutaMar 22, 2008
  4. Johannes SchindelinMar 22, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.