Git development
 help / color / mirror / Atom feed
* [PATCH] Enter interactive mode if no parameters are given to git-add
@ 2006-12-19 15:16 Andy Parkins
  2006-12-19 16:42 ` Jakub Narebski
  2006-12-19 18:00 ` Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Parkins @ 2006-12-19 15:16 UTC (permalink / raw)
  To: git

git-add with no parameters previously adds every modified file.  This
patch instead makes git-add enter interactive mode.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
This patch is against pu.

It seemed a bit nasty to add content without explicit instructions to do
so.  Instead, just drop into interactive mode, which they can easily get out
of if it was all a big accident, and additionally is quicker than typing
--interactive.

 builtin-add.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/builtin-add.c b/builtin-add.c
index aa2f0f3..52a63a0 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -96,10 +96,12 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		if (!strcmp("--interactive", argv[i]))
 			add_interactive++;
 	}
+	if (argc == 1)
+		add_interactive++;
 	if (add_interactive) {
 		const char *args[] = { "add--interactive", NULL };
 
-		if (add_interactive != 1 || argc != 2)
+		if (add_interactive != 1 || argc > 2)
 			die("add --interactive does not take any parameters");
 		execv_git_cmd(args);
 		exit(1);
-- 
1.4.4.2.g95ee-dirty

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-19 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-19 15:16 [PATCH] Enter interactive mode if no parameters are given to git-add Andy Parkins
2006-12-19 16:42 ` Jakub Narebski
2006-12-19 18:00 ` Junio C Hamano
2006-12-19 19:04   ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox