l10n: git.pot: v1.9 round 1 (27 new, 11 removed)

Generate po/git.pot from v1.9-rc0 for git v1.9 l10n round 1.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
l10n: vi.po (2210t): Updated git-core translation

 * Updated new strings
 * Fix typos and review
 * Change meaning of stage

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
[fr] update french translation 2210/2210

Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Merge branch 'fr-po' of git://github.com/jnavila/git

* 'fr-po' of git://github.com/jnavila/git:
  [fr] update french translation 2210/2210
l10n: Update Swedish translation (2210t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
builtin/blame.c: struct blame_entry does not need a prev link

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eliminate same_suspect function in builtin/blame.c

Since the origin pointers are "interned" and reference-counted, comparing
the pointers rather than the content is enough.  The only uninterned
origins are cached values kept in commit->util, but same_suspect is not
called on them.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
l10n: zh_CN.po: translate 27 messages (2210t0f0u)

Translations for git v1.9-rc0, and also update translations on "graft"
and "reference repository".

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
l10n: remove 2 blank translations on Danish, Dutch

Two l10n teams haven't contributed a single translation for about two
years since they was initialized with a blank template.  Remove them
can make the Git package smaller and give opportunities to other
contributors.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
t3030-merge-recursive: Test known breakage with empty work tree

Sometimes when working with a large repository it can be useful to try
out a merge and only check out conflicting files to disk (for example as
a speed optimization on a server).  Until v1.7.7-rc1~28^2~20
(merge-recursive: When we detect we can skip an update, actually skip
it, 2011-08-11), it was possible to do so with the following idiom:

	# Prepare a temporary index and empty work tree.
	GIT_INDEX_FILE="$PWD/tmp-$$-index" &&
	export GIT_INDEX_FILE &&
	GIT_WORK_TREE="$PWD/tmp-$$-work" &&
	export GIT_WORK_TREE &&
	mkdir "$GIT_WORK_TREE" &&

	# Convince the index that our side is on disk.
	git read-tree -i -m $ours &&
	git update-index --ignore-missing --refresh &&

	# Merge their side into our side.
	bases=$(git merge-base --all $ours $theirs) &&
	git merge-recursive $bases -- $ours $theirs &&
	tree=$(git write-tree)

Nowadays, that still works and the exit status is the same, but
merge-recursive produces a diagnostic if "our" side renamed a file:

	error: addinfo_cache failed for path 'dst'

Add a test to document this regression.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c: Refactor --ignore-missing implementation

Move lstat ENOENT handling from refresh_index to refresh_cache_ent and
activate it with a new CE_MATCH_IGNORE_MISSING option.  This will allow
other call paths into refresh_cache_ent to use the feature.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c: Extend make_cache_entry refresh flag with options

Convert the make_cache_entry boolean 'refresh' argument to a more
general 'refresh_options' argument.  Pass the value through to the
underlying refresh_cache_ent call.  Add option CE_MATCH_REFRESH to
enable stat refresh.  Update call sites to use the new signature.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c: Tolerate missing files while refreshing index

Teach add_cacheinfo to tell make_cache_entry to skip refreshing stat
information when a file is missing from the work tree.  We do not want
the index to be stat-dirty after the merge but also do not want to fail
when a file happens to be missing.

This fixes the 'merge-recursive w/ empty work tree - ours has rename'
case in t3030-merge-recursive.

Suggested-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Move diffcore_skip_stat_unmatch core logic out for reuse later

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff: do not quit early on stat-dirty files

When QUICK is set (i.e. with --quiet) we try to do as little work as
possible, stopping after seeing the first change. stat-dirty is
considered a "change" but it may turn out not, if no actual content is
changed. The actual content test is performed too late in the process
and the shortcut may be taken prematurely, leading to incorrect return
code.

Assume we do "git diff --quiet". If we have a stat-dirty file "a" and
a really dirty file "b". We break the loop in run_diff_files() and
stop after "a" because we have got a "change". Later in
diffcore_skip_stat_unmatch() we find out "a" is actually not
changed. But there's nothing else in the diff queue, we incorrectly
declare "no change", ignoring the fact that "b" is changed.

This also happens to "git diff --quiet HEAD" when it hits
diff_can_quit_early() in oneway_diff().

This patch does the content test earlier in order to keep going if "a"
is unchanged. The test result is cached so that when
diffcore_skip_stat_unmatch() is done in the end, we spend no cycles on
re-testing "a".

Reported-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Convert some match_pathspec_depth() to ce_path_match()

This helps reduce the number of match_pathspec_depth() call sites and
show how match_pathspec_depth() is used.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Convert some match_pathspec_depth() to dir_path_match()

This helps reduce the number of match_pathspec_depth() call sites and
show how m_p_d() is used. And it usage is:

 - match against an index entry (ce_path_match or match_pathspec_depth
   in ls-files)

 - match against a dir_entry from read_directory (dir_path_match and
   match_pathspec_depth in clean.c, which will be converted later)

 - resolve-undo (rerere.c and ls-files.c)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Rename match_pathspec_depth() to match_pathspec()

A long time ago, for some reason I was not happy with
match_pathspec(). I created a better version, match_pathspec_depth()
that was suppose to replace match_pathspec()
eventually. match_pathspec() has finally been gone since 6 months
ago. Use the shorter name for match_pathspec_depth().

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c: prepare match_pathspec_item for taking more flags

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
match_pathspec: match pathspec "foo/" against directory "foo"

Currently we do support matching pathspec "foo/" against directory
"foo". That is because match_pathspec() has no way to tell "foo" is a
directory and matching "foo/" against _file_ "foo" is wrong.

The callers can now tell match_pathspec if "foo" is a directory, we
could make an exception for this case. Code is not executed though
because no callers pass the flag yet.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>