Thread (21 messages) flat view 21 messages, 3 authors, 2016-06-15
STALE3729d

[PATCH 2/4] Teach git-add--interactive to accept a file path to patch

From: Wincent Colaiuta <hidden>
Date: 2016-06-15 22:43:52
Subsystem: the rest · Maintainer: Linus Torvalds

If supplied a single file path parameter the git-add--interactive script
now bypasses the command loop and jumps straight to the patch subcommand
using the passed path. After returning from the subcommand the main
command loop is entered. If a non-resolvable path is supplied the
operation is a no-op and the command loop is entered.

Signed-off-by: Wincent Colaiuta <redacted>
---
 git-add--interactive.perl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index fb1e92a..8f21c03 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -803,6 +803,11 @@ sub main_loop {
 	}
 }
 
+die "add --interactive may take only 1 optional parameter" if ($#ARGV > 0);
 refresh();
+if ($#ARGV == 0) {
+	patch_update_file($ARGV[0]);
+}
 status_cmd();
 main_loop();
+
-- 
1.5.3.5.737.gdee1b
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help