Make a short-and-sweet "git-add -i" synonym for "git-add --interactive"
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 17, 2007 at 10:52 UTC
df59afe3eb121e89195e246105dd53de0ec396ab
2 files changed
+5
-4
Documentation/git-add.txt
+2
-2
@@ -7,7 +7,7 @@ git-add - Add file contents to the changeset to be committed next
7
8
SYNOPSIS
9
--------
10
-'git-add' [-n] [-v] [-f] [--interactive] [--] <file>...
10
+'git-add' [-n] [-v] [-f] [--interactive | -i] [--] <file>...
11
12
DESCRIPTION
13
-----------
@@ -52,7 +52,7 @@ OPTIONS
52
-f::
53
Allow adding otherwise ignored files.
54
55
-\--interactive::
55
+\i, \--interactive::
56
Add modified contents in the working tree interactively to
57
the index.
58
builtin-add.c
+3
-2
@@ -10,7 +10,7 @@
10
#include "cache-tree.h"
11
12
static const char builtin_add_usage[] =
13
-"git-add [-n] [-v] [-f] [--interactive] [--] <filepattern>...";
13
+"git-add [-n] [-v] [-f] [--interactive | -i] [--] <filepattern>...";
14
15
static void prune_directory(struct dir_struct *dir, const char **pathspec, int prefix)
16
{
@@ -102,7 +102,8 @@ int cmd_add(int argc, const char **argv, const char *prefix)
102
int add_interactive = 0;
103
104
for (i = 1; i < argc; i++) {
105
- if (!strcmp("--interactive", argv[i]))
105
+ if (!strcmp("--interactive", argv[i]) ||
106
+ !strcmp("-i", argv[i]))
107
add_interactive++;
108
}
109
if (add_interactive) {