Files
git/builtin
Jonathan Nieder 71c7b0538f add -u: only show pathless 'add -u' warning when changes exist outside cwd
A common workflow in large projects is to chdir into a subdirectory of
interest and only do work there:

	cd src
	vi foo.c
	make test
	git add -u
	git commit

The upcoming change to 'git add -u' behavior would not affect such a
workflow: when the only changes present are in the current directory,
'git add -u' will add all changes, and whether that happens via an
implicit "." or implicit ":/" parameter is an unimportant
implementation detail.

The warning about use of 'git add -u' with no pathspec is annoying
because it seemingly serves no purpose in this case.  So suppress the
warning unless there are changes outside the cwd that are not being
added.

A previous version of this patch ran two I/O-intensive diff-files
passes: one to find changes outside the cwd, and another to find
changes to add to the index within the cwd.  This version runs one
full-tree diff and decides for each change whether to add it or warn
and suppress it in update_callback.  As a result, even on very large
repositories "git add -u" will not be significantly slower than the
future default behavior ("git add -u :/"), and the slowdown relative
to "git add -u ." should be a useful clue to users of such
repositories to get into the habit of explicitly passing '.'.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03 11:34:22 -07:00
..
2013-02-07 14:41:38 -08:00
2012-09-17 15:59:34 -07:00
2013-01-23 21:19:10 -08:00
2013-02-12 12:23:12 -08:00
2012-10-25 06:42:27 -04:00
2012-11-20 10:32:10 -08:00
2013-02-01 12:40:16 -08:00
2012-09-27 17:57:26 -07:00
2013-01-20 17:06:53 -08:00
2013-01-23 21:19:10 -08:00
2012-09-11 11:36:05 -07:00
2012-12-26 14:46:15 -08:00
2013-02-04 10:23:49 -08:00
2013-01-16 12:48:22 -08:00
2012-10-25 06:42:27 -04:00
2012-09-14 11:53:53 -07:00
2013-02-04 10:25:04 -08:00
2013-02-17 15:25:57 -08:00
2012-11-26 13:27:45 -08:00
2012-10-29 03:08:30 -04:00
2012-11-29 12:52:30 -08:00
2013-01-20 17:06:53 -08:00
2012-10-25 06:42:27 -04:00
2013-01-16 12:48:22 -08:00
2013-01-16 12:48:22 -08:00