diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-04-19 12:18:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-03-08 23:26:56 -0800 |
commit | 45c45e300bcbe493a39533bb04f6bd548e8a3f19 (patch) | |
tree | 5ac08e2d6af81dcbd3c57efdc49e63612bd12640 /compat/bswap.h | |
parent | builtin/add.c: simplify boolean variables (diff) | |
download | tgif-45c45e300bcbe493a39533bb04f6bd548e8a3f19.tar.xz |
git add: start preparing for "git add <pathspec>..." to default to "-A"
When "git add subdir/" is run without "-u" or "-A" option, e.g.
$ edit subdir/x
$ create subdir/y
$ rm subdir/z
$ git add subdir/
the command does not notice removal of paths (e.g. subdir/z) from
the working tree. This sometimes confuses new people, as arguably
"git add" is told to record the current state of "subdir/" as a
whole, not the current state of the paths that exist in the working
tree that matches that pathspec (the latter by definition excludes
the state of "subdir/z" because it does not exist in the working
tree).
Plan to eventually make "git add" pretend as if "-A" is given when
there is a pathspec on the command line. When resolving a conflict
to remove a path, the current code tells you to "git rm $path", but
with such a change, you will be able to say "git add $path" (of
course you can do "git add -A $path" today). That means that we can
simplify the advice messages given by "git status". That all will
be in Git 2.0 or later, if we are going to do so.
For that transition to work, people need to learn either to say "git
add --no-all subdir/" when they want to ignore the removed paths
like "subdir/z", or to say "git add -A subdir/" when they want to
take the state of the directory as a whole.
"git add" without any argument will continue to be a no-op.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/bswap.h')
0 files changed, 0 insertions, 0 deletions