From: Junio C Hamano Date: Wed, 17 Jan 2007 18:52:36 +0000 (-0800) Subject: Make a short-and-sweet "git-add -i" synonym for "git-add --interactive" X-Git-Tag: v1.5.0-rc2~55 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=df59afe3eb121e89195e246105dd53de0ec396ab;p=git.git Make a short-and-sweet "git-add -i" synonym for "git-add --interactive" Signed-off-by: Junio C Hamano --- diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index a5051aad6..b73a99d61 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -7,7 +7,7 @@ git-add - Add file contents to the changeset to be committed next SYNOPSIS -------- -'git-add' [-n] [-v] [-f] [--interactive] [--] ... +'git-add' [-n] [-v] [-f] [--interactive | -i] [--] ... DESCRIPTION ----------- @@ -52,7 +52,7 @@ OPTIONS -f:: Allow adding otherwise ignored files. -\--interactive:: +\i, \--interactive:: Add modified contents in the working tree interactively to the index. diff --git a/builtin-add.c b/builtin-add.c index e7a1b4d9a..87e16aa22 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -10,7 +10,7 @@ #include "cache-tree.h" static const char builtin_add_usage[] = -"git-add [-n] [-v] [-f] [--interactive] [--] ..."; +"git-add [-n] [-v] [-f] [--interactive | -i] [--] ..."; static void prune_directory(struct dir_struct *dir, const char **pathspec, int prefix) { @@ -102,7 +102,8 @@ int cmd_add(int argc, const char **argv, const char *prefix) int add_interactive = 0; for (i = 1; i < argc; i++) { - if (!strcmp("--interactive", argv[i])) + if (!strcmp("--interactive", argv[i]) || + !strcmp("-i", argv[i])) add_interactive++; } if (add_interactive) {