git add: add long equivalents of '-u' and '-f' options

The option -u stands for --update and it is a good idea to make it clear
especially because this is the only mode of operation of "git add" that
does something different from "adding".  Give longer --force synonym to -f
while we are at it as well.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
SZEDER Gábor 2008-06-14 11:48:00 +02:00 committed by Junio C Hamano
parent b994ec142f
commit 69c61c4fa9
2 changed files with 7 additions and 4 deletions

View File

@ -8,8 +8,9 @@ git-add - Add file contents to the index
SYNOPSIS SYNOPSIS
-------- --------
[verse] [verse]
'git-add' [-n] [-v] [-f] [--interactive | -i] [--patch | -p] [-u] [--refresh] 'git-add' [-n] [-v] [--force | -f] [--interactive | -i] [--patch | -p]
[--ignore-errors] [--] <filepattern>... [--update | -u] [--refresh] [--ignore-errors] [--]
<filepattern>...
DESCRIPTION DESCRIPTION
----------- -----------
@ -59,6 +60,7 @@ OPTIONS
Be verbose. Be verbose.
-f:: -f::
--force::
Allow adding otherwise ignored files. Allow adding otherwise ignored files.
-i:: -i::
@ -75,6 +77,7 @@ OPTIONS
the specified filepatterns before exiting. the specified filepatterns before exiting.
-u:: -u::
--update::
Update only files that git already knows about, staging modified Update only files that git already knows about, staging modified
content for commit and marking deleted files for removal. This content for commit and marking deleted files for removal. This
is similar is similar

View File

@ -200,8 +200,8 @@ static struct option builtin_add_options[] = {
OPT_GROUP(""), OPT_GROUP(""),
OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"), OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"),
OPT_BOOLEAN('p', "patch", &patch_interactive, "interactive patching"), OPT_BOOLEAN('p', "patch", &patch_interactive, "interactive patching"),
OPT_BOOLEAN('f', NULL, &ignored_too, "allow adding otherwise ignored files"), OPT_BOOLEAN('f', "force", &ignored_too, "allow adding otherwise ignored files"),
OPT_BOOLEAN('u', NULL, &take_worktree_changes, "update tracked files"), OPT_BOOLEAN('u', "update", &take_worktree_changes, "update tracked files"),
OPT_BOOLEAN( 0 , "refresh", &refresh_only, "don't add, only refresh the index"), OPT_BOOLEAN( 0 , "refresh", &refresh_only, "don't add, only refresh the index"),
OPT_BOOLEAN( 0 , "ignore-errors", &ignore_add_errors, "just skip files which cannot be added because of errors"), OPT_BOOLEAN( 0 , "ignore-errors", &ignore_add_errors, "just skip files which cannot be added because of errors"),
OPT_END(), OPT_END(),