gitweb.git
dir.c: git-status --ignored: don't scan the work tree... Karsten Blees Mon, 15 Apr 2013 19:15:03 +0000 (21:15 +0200)

dir.c: git-status --ignored: don't scan the work tree twice

'git-status --ignored' still scans the work tree twice to collect
untracked and ignored files, respectively.

fill_directory / read_directory already supports collecting untracked and
ignored files in a single directory scan. However, the DIR_COLLECT_IGNORED
flag to enable this has some git-add specific side-effects (e.g. it
doesn't recurse into ignored directories, so listing ignored files with
--untracked=all doesn't work).

The DIR_SHOW_IGNORED flag doesn't list untracked files and returns ignored
files in dir_struct.entries[] (instead of dir_struct.ignored[] as
DIR_COLLECT_IGNORED). DIR_SHOW_IGNORED is used all throughout git.

We don't want to break the existing API, so lets introduce a new flag
DIR_SHOW_IGNORED_TOO that lists untracked as well as ignored files similar
to DIR_COLLECT_FILES, but will recurse into sub-directories based on the
other flags as DIR_SHOW_IGNORED does.

In dir.c::read_directory_recursive, add ignored files to either
dir_struct.entries[] or dir_struct.ignored[] based on the flags. Also move
the DIR_COLLECT_IGNORED case here so that filling result lists is in a
common place.

In wt-status.c::wt_status_collect_untracked, use the new flag and read
results from dir_struct.ignored[]. Remove the extra fill_directory call.

builtin/check-ignore.c doesn't call fill_directory, setting the git-add
specific DIR_COLLECT_IGNORED flag has no effect here. Remove for clarity.

Update API documentation to reflect the changes.

Performance: with this patch, 'git-status --ignored' is typically as fast
as 'git-status'.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: git-status --ignored: don't scan the work tree... Karsten Blees Mon, 15 Apr 2013 19:14:22 +0000 (21:14 +0200)

dir.c: git-status --ignored: don't scan the work tree three times

'git-status --ignored' recursively scans directories up to three times:

1. To collect untracked files.

2. To collect ignored files.

3. When collecting ignored files, to check that an untracked directory
that potentially contains ignored files doesn't also contain untracked
files (i.e. isn't already listed as untracked).

Let's get rid of case 3 first.

Currently, read_directory_recursive returns a boolean whether a directory
contains the requested files or not (actually, it returns the number of
files, but no caller actually needs that), and DIR_SHOW_IGNORED specifies
what we're looking for.

To be able to test for both untracked and ignored files in a single scan,
we need to return a bit more info, and the result must be independent of
the DIR_SHOW_IGNORED flag.

Reuse the path_treatment enum as return value of read_directory_recursive.
Split path_handled in two separate values path_excluded and path_untracked
that don't change their meaning with the DIR_SHOW_IGNORED flag. We don't
need an extra value path_untracked_and_excluded, as directories with both
untracked and ignored files should be listed as untracked.

Rename path_ignored to path_none for clarity (i.e. "don't treat that path"
in contrast to "the path is ignored and should be treated according to
DIR_SHOW_IGNORED").

Replace enum directory_treatment with path_treatment. That's just another
enum with the same meaning, no need to translate back and forth.

In treat_directory, get rid of the extra read_directory_recursive call and
all the DIR_SHOW_IGNORED-specific code.

In read_directory_recursive, decide whether to dir_add_name path_excluded
or path_untracked paths based on the DIR_SHOW_IGNORED flag.

The return value of read_directory_recursive is the maximum path_treatment
of all files and sub-directories. In the check_only case, abort when we've
reached the most significant value (path_untracked).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: git-status: avoid is_excluded checks for tracked... Karsten Blees Mon, 15 Apr 2013 19:13:35 +0000 (21:13 +0200)

dir.c: git-status: avoid is_excluded checks for tracked files

Checking if a file is in the index is much faster (hashtable lookup) than
checking if the file is excluded (linear search over exclude patterns).

Skip is_excluded checks for files: move the cache_name_exists check from
treat_file to treat_one_path and return early if the file is tracked.

This can safely be done as all other code paths also return path_ignored
for tracked files, and dir_add_ignored skips tracked files as well.

There's just one line left in treat_file, so move this to treat_one_path
as well.

Here's some performance data for git-status from the linux and WebKit
repos (best of 10 runs on a Debian Linux on SSD, core.preloadIndex=true):

| status | status --ignored
| linux | WebKit | linux | WebKit
-------+-------+--------+-------+---------
before | 0.218 | 1.583 | 0.321 | 2.579
after | 0.156 | 0.988 | 0.202 | 1.279
gain | 1.397 | 1.602 | 1.589 | 2.016

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: replace is_path_excluded with now equivalent... Karsten Blees Mon, 15 Apr 2013 19:12:57 +0000 (21:12 +0200)

dir.c: replace is_path_excluded with now equivalent is_excluded API

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: unify is_excluded and is_path_excluded APIsKarsten Blees Mon, 15 Apr 2013 19:12:14 +0000 (21:12 +0200)

dir.c: unify is_excluded and is_path_excluded APIs

The is_excluded and is_path_excluded APIs are very similar, except for a
few noteworthy differences:

is_excluded doesn't handle ignored directories, results for paths within
ignored directories are incorrect. This is probably based on the premise
that recursive directory scans should stop at ignored directories, which
is no longer true (in certain cases, read_directory_recursive currently
calls is_excluded *and* is_path_excluded to get correct ignored state).

is_excluded caches parsed .gitignore files of the last directory in struct
dir_struct. If the directory changes, it finds a common parent directory
and is very careful to drop only as much state as necessary. On the other
hand, is_excluded will also read and parse .gitignore files in already
ignored directories, which are completely irrelevant.

is_path_excluded correctly handles ignored directories by checking if any
component in the path is excluded. As it uses is_excluded internally, this
unfortunately forces is_excluded to drop and re-read all .gitignore files,
as there is no common parent directory for the root dir.

is_path_excluded tracks state in a separate struct path_exclude_check,
which is essentially a wrapper of dir_struct with two more fields. However,
as is_path_excluded also modifies dir_struct, it is not possible to e.g.
use multiple path_exclude_check structures with the same dir_struct in
parallel. The additional structure just unnecessarily complicates the API.

Teach is_excluded / prep_exclude about ignored directories: whenever
entering a new directory, first check if the entire directory is excluded.
Remember the excluded state in dir_struct. Don't traverse into already
ignored directories (i.e. don't read irrelevant .gitignore files).

Directories could also be excluded by exclude patterns specified on the
command line or .git/info/exclude, so we cannot simply skip prep_exclude
entirely if there's no .gitignore file name (dir_struct.exclude_per_dir).
Move this check to just before actually reading the file.

is_path_excluded is now equivalent to is_excluded, so we can simply
redirect to it (the public API is cleaned up in the next patch).

The performance impact of the additional ignored check per directory is
hardly noticeable when reading directories recursively (e.g. 'git status').
However, performance of git commands using the is_path_excluded API (e.g.
'git ls-files --cached --ignored --exclude-standard') is greatly improved
as this no longer re-reads .gitignore files on each call.

Here's some performance data from the linux and WebKit repos (best of 10
runs on a Debian Linux on SSD, core.preloadIndex=true):

| ls-files -ci | status | status --ignored
| linux | WebKit | linux | WebKit | linux | WebKit
-------+-------+--------+-------+--------+-------+---------
before | 0.506 | 6.539 | 0.212 | 1.555 | 0.323 | 2.541
after | 0.080 | 1.191 | 0.218 | 1.583 | 0.321 | 2.579
gain | 6.325 | 5.490 | 0.972 | 0.982 | 1.006 | 0.985

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: move prep_excludeKarsten Blees Mon, 15 Apr 2013 19:11:37 +0000 (21:11 +0200)

dir.c: move prep_exclude

Move prep_exclude in preparation for the next patch.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: factor out parts of last_exclude_matching for... Karsten Blees Mon, 15 Apr 2013 19:11:02 +0000 (21:11 +0200)

dir.c: factor out parts of last_exclude_matching for later reuse

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: git-clean -d -X: don't delete tracked directoriesKarsten Blees Mon, 15 Apr 2013 19:10:05 +0000 (21:10 +0200)

dir.c: git-clean -d -X: don't delete tracked directories

The notion of "ignored tracked" directories introduced in 721ac4ed "dir.c:
Make git-status --ignored more consistent" has a few unwanted side effects:

- git-clean -d -X: deletes ignored tracked directories. git-clean should
never delete tracked content.

- git-ls-files --ignored --other --directory: lists ignored tracked
directories instead of "other" directories.

- git-status --ignored: lists ignored tracked directories while contained
files may be listed as modified. Paths listed by git-status should be
disjoint (except in long format where a path may be listed in both the
staged and unstaged section).

Additionally, the current behaviour violates documentation in gitignore(5)
("Specifies intentionally *untracked* files to ignore") and Documentation/
technical/api-directory-listing.txt ("DIR_SHOW_OTHER_DIRECTORIES: Include
a directory that is *not tracked*.").

In dir.c::treat_directory, remove the special handling of ignored tracked
directories, so that the DIR_SHOW_OTHER_DIRECTORIES flag only affects
"other" (i.e. untracked) directories. In dir.c::dir_add_name, check that
added paths are untracked even if DIR_SHOW_IGNORED is set.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: make 'git-status --ignored' work within leading... Karsten Blees Mon, 15 Apr 2013 19:09:25 +0000 (21:09 +0200)

dir.c: make 'git-status --ignored' work within leading directories

'git-status --ignored path/' doesn't list ignored files and directories
within 'path' if some component of 'path' is classified as untracked.

Disable the DIR_SHOW_OTHER_DIRECTORIES flag while traversing leading
directories. This prevents treat_leading_path() with DIR_SHOW_IGNORED flag
from aborting at the top level untracked directory.

As a side effect, this also eliminates a recursive directory scan per
leading directory level, as treat_directory() can no longer call
read_directory_recursive() when called from treat_leading_path().

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: git-status --ignored: don't list empty directori... Karsten Blees Mon, 15 Apr 2013 19:08:42 +0000 (21:08 +0200)

dir.c: git-status --ignored: don't list empty directories as ignored

'git-status --ignored' lists empty untracked directories as ignored, even
though they don't have any ignored files.

When checking if a directory is already listed as untracked (i.e. shouldn't
be listed as ignored as well), don't assume that the directory has only
ignored files if it doesn't have untracked files, as the directory may be
empty.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: git-ls-files --directories: don't hide empty... Karsten Blees Mon, 15 Apr 2013 19:08:02 +0000 (21:08 +0200)

dir.c: git-ls-files --directories: don't hide empty directories

'git-ls-files --ignored --directories' hides empty directories even though
--no-empty-directory was not specified.

Treat the DIR_HIDE_EMPTY_DIRECTORIES flag independently from
DIR_SHOW_IGNORED to make all git-ls-files options work as expected.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: git-status --ignored: don't list empty ignored... Karsten Blees Mon, 15 Apr 2013 19:07:16 +0000 (21:07 +0200)

dir.c: git-status --ignored: don't list empty ignored directories

'git-status --ignored' lists ignored tracked directories without any
ignored files if a tracked file happens to match an exclude pattern.

Always exclude tracked files.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: git-status --ignored: don't list files in ignore... Karsten Blees Mon, 15 Apr 2013 19:06:30 +0000 (21:06 +0200)

dir.c: git-status --ignored: don't list files in ignored directories

'git-status --ignored' lists both the ignored directory and the ignored
files if the files are in a tracked sub directory.

When recursing into sub directories in read_directory_recursive, pass on
the check_only parameter so that we don't accidentally add the files.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: git-status --ignored: don't drop ignored directoriesKarsten Blees Mon, 15 Apr 2013 19:05:19 +0000 (21:05 +0200)

dir.c: git-status --ignored: don't drop ignored directories

'git-status --ignored' drops ignored directories if they contain untracked
files in an untracked sub directory.

Fix it by getting exact (recursive) excluded status in treat_directory.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'po/help-guides'Junio C Hamano Mon, 15 Apr 2013 06:33:17 +0000 (23:33 -0700)

Merge branch 'po/help-guides'

Finishing touches.

* po/help-guides:
help: mark common_guides[] as translatable

test-bzr: portable shell and utf-8 strings for Mac OSTorsten Bögershausen Fri, 12 Apr 2013 21:18:20 +0000 (23:18 +0200)

test-bzr: portable shell and utf-8 strings for Mac OS

Make the shell script more portable:
- Split export X=Y into 2 lines
- Use printf instead of echo -e

Use UTF-8 code points which are not decomposed by the filesystem:
Code points like "á" will be decomposed by Mac OS X.
bzr is unable to find the file "á" on disk.
Use code points from unicode which can not be decomposed.
In other words, the precompsed form use the same bytes as decomposed.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Acked-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 'maint'Junio C Hamano Fri, 12 Apr 2013 20:54:01 +0000 (13:54 -0700)

Sync with 'maint'

* maint:
Correct common spelling mistakes in comments and tests
kwset: fix spelling in comments
precompose-utf8: fix spelling of "want" in error message
compat/nedmalloc: fix spelling in comments
compat/regex: fix spelling and grammar in comments
obstack: fix spelling of similar
contrib/subtree: fix spelling of accidentally
git-remote-mediawiki: spelling fixes
doc: various spelling fixes
fast-export: fix argument name in error messages
Documentation: distinguish between ref and offset deltas in pack-format
i18n: make the translation of -u advice in one go

Merge branch 'rr/test-3200-style' into maintJunio C Hamano Fri, 12 Apr 2013 20:41:48 +0000 (13:41 -0700)

Merge branch 'rr/test-3200-style' into maint

* rr/test-3200-style:
t3200 (branch): modernize style

Conflicts:
t/t3200-branch.sh

Merge branch 'mg/texinfo-5' into maintJunio C Hamano Fri, 12 Apr 2013 20:41:48 +0000 (13:41 -0700)

Merge branch 'mg/texinfo-5' into maint

* mg/texinfo-5:
Documentation: Strip texinfo anchors to avoid duplicates

Merge branch 'jk/diffcore-break-divzero' into maintJunio C Hamano Fri, 12 Apr 2013 20:41:47 +0000 (13:41 -0700)

Merge branch 'jk/diffcore-break-divzero' into maint

* jk/diffcore-break-divzero:
diffcore-break: don't divide by zero

Merge branch 'cn/commit-amend-doc' into maintJunio C Hamano Fri, 12 Apr 2013 20:41:47 +0000 (13:41 -0700)

Merge branch 'cn/commit-amend-doc' into maint

* cn/commit-amend-doc:
Documentation/git-commit: reword the --amend explanation

Merge branch 'jk/bisect-prn-unsigned' into maintJunio C Hamano Fri, 12 Apr 2013 20:41:46 +0000 (13:41 -0700)

Merge branch 'jk/bisect-prn-unsigned' into maint

* jk/bisect-prn-unsigned:
bisect: avoid signed integer overflow

Merge branch 'jk/no-more-self-assignment' into maintJunio C Hamano Fri, 12 Apr 2013 20:41:46 +0000 (13:41 -0700)

Merge branch 'jk/no-more-self-assignment' into maint

* jk/no-more-self-assignment:
match-trees: simplify score_trees() using tree_entry()
submodule: clarify logic in show_submodule_summary

Merge branch 'rr/send-email-perl-critique' into maintJunio C Hamano Fri, 12 Apr 2013 20:41:46 +0000 (13:41 -0700)

Merge branch 'rr/send-email-perl-critique' into maint

* rr/send-email-perl-critique:
send-email: use the three-arg form of open in recipients_cmd
send-email: drop misleading function prototype
send-email: use "return;" not "return undef;" on error codepaths

Merge branch 'jc/t5516-pushInsteadOf-vs-pushURL' into... Junio C Hamano Fri, 12 Apr 2013 20:41:45 +0000 (13:41 -0700)

Merge branch 'jc/t5516-pushInsteadOf-vs-pushURL' into maint

* jc/t5516-pushInsteadOf-vs-pushURL:
t5516: test interaction between pushURL and pushInsteadOf correctly

Correct common spelling mistakes in comments and testsStefano Lattarini Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)

Correct common spelling mistakes in comments and tests

Most of these were found using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

kwset: fix spelling in commentsStefano Lattarini Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)

kwset: fix spelling in comments

Correct spelling mistakes noticed using Lucas De Marchi's codespell
tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

precompose-utf8: fix spelling of "want" in error messageStefano Lattarini Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)

precompose-utf8: fix spelling of "want" in error message

Noticed using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

compat/nedmalloc: fix spelling in commentsStefano Lattarini Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)

compat/nedmalloc: fix spelling in comments

Correct some typos found using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

compat/regex: fix spelling and grammar in commentsStefano Lattarini Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)

compat/regex: fix spelling and grammar in comments

Some of these were found using Lucas De Marchi's codespell tool.
Others noticed by Eric Sunshine.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

obstack: fix spelling of similarStefano Lattarini Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)

obstack: fix spelling of similar

Noticed using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/subtree: fix spelling of accidentallyStefano Lattarini Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)

contrib/subtree: fix spelling of accidentally

Noticed with Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: spelling fixesStefano Lattarini Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)

git-remote-mediawiki: spelling fixes

Most of these were found using Lucas De Marchi's codespell tool.
Others were pointed out by Eric Sunshine.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: various spelling fixesStefano Lattarini Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)

doc: various spelling fixes

Most of these were found using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint-1.8.1' into maintJunio C Hamano Fri, 12 Apr 2013 18:48:38 +0000 (11:48 -0700)

Merge branch 'maint-1.8.1' into maint

* maint-1.8.1:
fast-export: fix argument name in error messages
Documentation: distinguish between ref and offset deltas in pack-format

help: mark common_guides[] as translatableSimon Ruderich Fri, 12 Apr 2013 13:51:42 +0000 (15:51 +0200)

help: mark common_guides[] as translatable

Signed-off-by: Simon Ruderich <simon@ruderich.org>
Acked-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-export: fix argument name in error messagesPaul Price Fri, 12 Apr 2013 14:05:55 +0000 (10:05 -0400)

fast-export: fix argument name in error messages

The --signed-tags argument is plural, while error messages referred
to --signed-tag (singular). Tweak error messages to correspond to the
argument.

Signed-off-by: Paul Price <price@astro.princeton.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: distinguish between ref and offset delta... Stefan Saasen Fri, 12 Apr 2013 05:56:24 +0000 (15:56 +1000)

Documentation: distinguish between ref and offset deltas in pack-format

eb32d236 introduced the OBJ_OFS_DELTA object that uses a relative offset to
identify the base object instead of the 20-byte SHA1 reference. The pack file
documentation only mentions the SHA1 based reference in its description of the
deltified object entry.

Update the pack format documentation to clarify that the deltified object
representation refers to its base using either a relative negative offset or
the absolute SHA1 identifier.

Signed-off-by: Stefan Saasen <ssaasen@atlassian.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'tb/document-status-u-tradeoff' into maintJunio C Hamano Fri, 12 Apr 2013 15:12:47 +0000 (08:12 -0700)

Merge branch 'tb/document-status-u-tradeoff' into maint

* tb/document-status-u-tradeoff:
i18n: make the translation of -u advice in one go

i18n: make the translation of -u advice in one goJiang Xin Fri, 12 Apr 2013 03:53:01 +0000 (11:53 +0800)

i18n: make the translation of -u advice in one go

The advice (consider use of -u when read_directory takes too long) is
separated into 3 different status_printf_ln() calls, and which brings
trouble for translators.

Since status_vprintf() called by status_printf_ln() can handle eol in
buffer, we could simply join these lines into one paragraph.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Fri, 12 Apr 2013 00:41:48 +0000 (17:41 -0700)

Merge branch 'maint'

* maint:
Typo fix: replacing it's -> its
t: make PIPE a standard test prerequisite
archive: clarify explanation of --worktree-attributes
t/README: --immediate skips cleanup commands for failed tests

Update dtaft release notes to 1.8.3Junio C Hamano Thu, 11 Apr 2013 23:03:55 +0000 (16:03 -0700)

Update dtaft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ap/combine-diff-coalesce-lost'Junio C Hamano Fri, 12 Apr 2013 00:41:05 +0000 (17:41 -0700)

Merge branch 'ap/combine-diff-coalesce-lost'

Attempts to minimize "diff -c/--cc" output by coalescing the same
lines removed from the parents better, but with an O(n^2)
complexity.

* ap/combine-diff-coalesce-lost:
combine-diff: coalesce lost lines optimally

Merge branch 'sr/log-SG-no-textconv'Junio C Hamano Fri, 12 Apr 2013 00:41:04 +0000 (17:41 -0700)

Merge branch 'sr/log-SG-no-textconv'

"git log -S/-G" started paying attention to textconv filter, but
there was no way to disable this. Make it honor --no-textconv
option.

* sr/log-SG-no-textconv:
diffcore-pickaxe: unify code for log -S/-G
diffcore-pickaxe: fix leaks in "log -S<block>" and "log -G<pattern>"
diffcore-pickaxe: port optimization from has_changes() to diff_grep()
diffcore-pickaxe: respect --no-textconv
diffcore-pickaxe: remove fill_one()
diffcore-pickaxe: remove unnecessary call to get_textconv()

Merge branch 'js/rerere-forget-protect-against-NUL'Junio C Hamano Fri, 12 Apr 2013 00:41:02 +0000 (17:41 -0700)

Merge branch 'js/rerere-forget-protect-against-NUL'

A few bugfixes to "git rerere" working on corner case merge
conflicts.

* js/rerere-forget-protect-against-NUL:
rerere forget: do not segfault if not all stages are present
rerere forget: grok files containing NUL

Merge branch 'po/help-guides'Junio C Hamano Fri, 12 Apr 2013 00:41:00 +0000 (17:41 -0700)

Merge branch 'po/help-guides'

"git help" learned "-g" option to show the list of guides just like
list of commands are given with "-a".

* po/help-guides:
doc: include --guide option description for "git help"
help: mention -a and -g option, and 'git help <concept>' usage.
builtin/help.c: add list_common_guides_help() function
builtin/help.c: add --guide option
builtin/help.c: split "-a" processing into two

Typo fix: replacing it's -> itsBenoit Bourbie Sat, 13 Apr 2013 16:47:21 +0000 (10:47 -0600)

Typo fix: replacing it's -> its

Signed-off-by: Benoit Bourbie <benoit.bourbie@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t: make PIPE a standard test prerequisiteAdam Spiers Thu, 11 Apr 2013 02:07:04 +0000 (03:07 +0100)

t: make PIPE a standard test prerequisite

The 'PIPE' test prerequisite was already defined identically by t9010
and t9300, therefore it makes sense to make it a predefined
prerequisite.

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive: clarify explanation of --worktree-attributesRené Scharfe Wed, 10 Apr 2013 17:49:57 +0000 (19:49 +0200)

archive: clarify explanation of --worktree-attributes

Make it a bit clearer that --worktree-attributes is about files in the
working tree (checked out files, possibly changed) and not the current
working directory ($PWD). Link to the ATTRIBUTES section, which has
more details.

Reported-by: Amit Bakshi <ambakshi@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/README: --immediate skips cleanup commands for failed... Simon Ruderich Tue, 9 Apr 2013 21:48:36 +0000 (23:48 +0200)

t/README: --immediate skips cleanup commands for failed tests

Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: improve tag handlingFelipe Contreras Mon, 8 Apr 2013 18:36:39 +0000 (13:36 -0500)

remote-bzr: improve tag handling

revision_history() is deprecated and doesn't do what we want (revno
instead of dotted_revno?).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: fix utf-8 support for fetchingChristophe Simonis Mon, 8 Apr 2013 18:36:38 +0000 (13:36 -0500)

remote-bzr: fix utf-8 support for fetching

The previous patches didn't deal with all the scenarios.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert 4b7f53da7618 (simplify-merges: drop merge from... Junio C Hamano Mon, 8 Apr 2013 20:10:27 +0000 (13:10 -0700)

Revert 4b7f53da7618 (simplify-merges: drop merge from irrelevant side branch, 2013-01-17)

Kevin Bracey reports that the change regresses a case shown in the
user manual.

Trading one fix with another breakage is not worth it. Just keep
the test to document the existing breakage, and revert the change
for now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.8.2.1Junio C Hamano Sun, 7 Apr 2013 22:28:50 +0000 (15:28 -0700)

Sync with 1.8.2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.8.2.1 v1.8.2.1Junio C Hamano Sun, 7 Apr 2013 22:27:23 +0000 (15:27 -0700)

Git 1.8.2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.8.3Junio C Hamano Sun, 7 Apr 2013 21:40:26 +0000 (14:40 -0700)

Update draft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/rm-removed-paths'Junio C Hamano Sun, 7 Apr 2013 21:33:14 +0000 (14:33 -0700)

Merge branch 'jk/rm-removed-paths'

A handful of test cases and a corner case bugfix for "git rm".

* jk/rm-removed-paths:
t3600: document failure of rm across symbolic links
t3600: test behavior of reverse-d/f conflict
rm: do not complain about d/f conflicts during deletion

Merge branch 'tb/shared-perm'Junio C Hamano Sun, 7 Apr 2013 21:33:11 +0000 (14:33 -0700)

Merge branch 'tb/shared-perm'

Simplifies adjust_shared_perm() implementation.

* tb/shared-perm:
path.c: optimize adjust_shared_perm()
path.c: simplify adjust_shared_perm()

Merge branch 'cn/commit-amend-doc'Junio C Hamano Sun, 7 Apr 2013 21:33:06 +0000 (14:33 -0700)

Merge branch 'cn/commit-amend-doc'

* cn/commit-amend-doc:
Documentation/git-commit: reword the --amend explanation

Merge branch 'fc/remote-helpers-test-updates'Junio C Hamano Sun, 7 Apr 2013 21:33:02 +0000 (14:33 -0700)

Merge branch 'fc/remote-helpers-test-updates'

* fc/remote-helpers-test-updates:
remote-hg: fix hg-git test-case
remote-bzr: remove stale check code for tests
remote-helpers: fix the run of all tests
remote-bzr: avoid echo -n

Merge branch 'mg/texinfo-5'Junio C Hamano Sun, 7 Apr 2013 21:32:59 +0000 (14:32 -0700)

Merge branch 'mg/texinfo-5'

Strip @anchor elements in the texinfo output of the documentation,
as a single document created by concatenating our entire manual set
will produce many duplicates that makes newer texinfo unhappy.

* mg/texinfo-5:
Documentation: Strip texinfo anchors to avoid duplicates

Merge branch 'jk/diffcore-break-divzero'Junio C Hamano Sun, 7 Apr 2013 21:32:57 +0000 (14:32 -0700)

Merge branch 'jk/diffcore-break-divzero'

* jk/diffcore-break-divzero:
diffcore-break: don't divide by zero

Merge branch 'jk/bisect-prn-unsigned'Junio C Hamano Sun, 7 Apr 2013 21:32:54 +0000 (14:32 -0700)

Merge branch 'jk/bisect-prn-unsigned'

* jk/bisect-prn-unsigned:
bisect: avoid signed integer overflow

Merge branch 'rr/triangle'Junio C Hamano Sun, 7 Apr 2013 21:32:50 +0000 (14:32 -0700)

Merge branch 'rr/triangle'

Support "pull from one place, push to another place" workflow
better by introducing remote.pushdefault (overrides the "origin"
thing) and branch.*.pushremote (overrides the branch.*.remote).

* rr/triangle:
remote.c: introduce branch.<name>.pushremote
remote.c: introduce remote.pushdefault
remote.c: introduce a way to have different remotes for fetch/push
t5516 (fetch-push): drop implicit arguments from helper functions
t5516 (fetch-push): update test description
remote.c: simplify a bit of code using git_config_string()

Merge branch 'mm/status-during-revert'Junio C Hamano Sun, 7 Apr 2013 21:32:03 +0000 (14:32 -0700)

Merge branch 'mm/status-during-revert'

"git status" learned to report that you are in the middle of a
revert session, just like it does for a cherry-pick and a bisect
session.

* mm/status-during-revert:
status: show commit sha1 in "You are currently reverting" message
status: show 'revert' state and status hint

Merge branch 'jk/set-upstream-error-cases'Junio C Hamano Sun, 7 Apr 2013 21:31:08 +0000 (14:31 -0700)

Merge branch 'jk/set-upstream-error-cases'

The handing by "git branch --set-upstream-to" against various forms
of errorneous inputs were suboptimal.

* jk/set-upstream-error-cases:
branch: give advice when tracking start-point is missing
branch: mention start_name in set-upstream error messages
branch: improve error message for missing --set-upstream-to ref
branch: factor out "upstream is not a branch" error messages
t3200: test --set-upstream-to with bogus refs

Merge branch 'jk/filter-branch-come-back-to-original'Junio C Hamano Sun, 7 Apr 2013 21:29:34 +0000 (14:29 -0700)

Merge branch 'jk/filter-branch-come-back-to-original'

When used with "-d temporary-directory" option, "git filter-branch"
failed to come back to the original working tree to perform the
final clean-up procedure.

* jk/filter-branch-come-back-to-original:
filter-branch: return to original dir after filtering

Sync with 1.8.1.6Junio C Hamano Sun, 7 Apr 2013 16:10:11 +0000 (09:10 -0700)

Sync with 1.8.1.6

Git 1.8.1.6 v1.8.1.6Junio C Hamano Sun, 7 Apr 2013 15:58:30 +0000 (08:58 -0700)

Git 1.8.1.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/directory-attrs-regression-fix' into... Junio C Hamano Sun, 7 Apr 2013 15:45:03 +0000 (08:45 -0700)

Merge branch 'jc/directory-attrs-regression-fix' into maint-1.8.1

A pattern "dir" (without trailing slash) in the attributes file
stopped matching a directory "dir" by mistake with an earlier change
that wanted to allow pattern "dir/" to also match.

* jc/directory-attrs-regression-fix:
t: check that a pattern without trailing slash matches a directory
dir.c::match_pathname(): pay attention to the length of string parameters
dir.c::match_pathname(): adjust patternlen when shifting pattern
dir.c::match_basename(): pay attention to the length of string parameters
attr.c::path_matches(): special case paths that end with a slash
attr.c::path_matches(): the basename is part of the pathname

remote-helpers/test-bzr.sh: do not use "grep '\s'"Torsten Bögershausen Sun, 7 Apr 2013 08:48:30 +0000 (10:48 +0200)

remote-helpers/test-bzr.sh: do not use "grep '\s'"

Using grep "devel\s\+3:" to find at least one whitspace is not
portable on all grep versions; not all grep versions understand "\s"
as a "whitespace".

Use a literal TAB followed by SPACE.

The + as a qualifier for "one or more" is not a basic regular
expression; use egrep instead of grep.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitremote-helpers(1): clarify refspec behaviourJohn Keeping Sat, 6 Apr 2013 18:13:41 +0000 (19:13 +0100)

gitremote-helpers(1): clarify refspec behaviour

The documentation says that "If no 'refspec' capability is advertised,
there is an implied `refspec *:*`" but this is only the case for the
"import" command.

Since there is a comment in transport-helper.c indicating that this
default is for historical reasons, change the documentation to clarify
that a refspec should always be specified.

Signed-off-by: John Keeping <john@keeping.me.uk>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-export: Allow pruned-references in mark fileAntoine Pelisse Sat, 6 Apr 2013 17:04:31 +0000 (19:04 +0200)

fast-export: Allow pruned-references in mark file

fast-export can fail because of some pruned-reference when importing a
mark file.

The problem happens in the following scenario:

$ git fast-export --export-marks=MARKS master
(rewrite master)
$ git prune
$ git fast-export --import-marks=MARKS master

This might fail if some references have been removed by prune
because some marks will refer to no longer existing commits.
git-fast-export will not need these objects anyway as they were no
longer reachable.

We still need to update last_numid so we don't change the mapping
between marks and objects for remote-helpers.
Unfortunately, the mark file should not be rewritten without lost marks
if no new objects has been exported, as we could lose track of the last
last_numid.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: add utf-8 support for pushingFelipe Contreras Sat, 6 Apr 2013 03:49:23 +0000 (21:49 -0600)

remote-bzr: add utf-8 support for pushing

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: add utf-8 support for fetchingTimotheus Pokorra Sat, 6 Apr 2013 03:49:22 +0000 (21:49 -0600)

remote-bzr: add utf-8 support for fetching

[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: avoid unreferred tagsFelipe Contreras Sat, 6 Apr 2013 03:49:21 +0000 (21:49 -0600)

remote-bzr: avoid unreferred tags

They have no content, there's nothing we can do with them.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: only update workingtree on local reposFelipe Contreras Sat, 6 Apr 2013 03:49:20 +0000 (21:49 -0600)

remote-bzr: only update workingtree on local repos

Apparently, that's the only way it's possible.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: set author if availableDavid Engster Sat, 6 Apr 2013 03:49:19 +0000 (21:49 -0600)

remote-bzr: set author if available

[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: remove files before modificationsChristophe Simonis Sat, 6 Apr 2013 03:49:18 +0000 (21:49 -0600)

remote-bzr: remove files before modifications

Allow re-add of a deleted file in the same commit.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: fix directory renamingChristophe Simonis Sat, 6 Apr 2013 03:49:17 +0000 (21:49 -0600)

remote-bzr: fix directory renaming

Git does not handle directories, renaming a directory is renaming every
files in this directory.

[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.8.3Junio C Hamano Fri, 5 Apr 2013 21:19:57 +0000 (14:19 -0700)

Update draft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mh/rev-parse-verify-doc'Junio C Hamano Fri, 5 Apr 2013 21:15:20 +0000 (14:15 -0700)

Merge branch 'mh/rev-parse-verify-doc'

"rev-parse --verify" was documented in a misleading way.

* mh/rev-parse-verify-doc:
rev-parse: clarify documentation for the --verify option

Merge branch 'sg/gpg-sig'Junio C Hamano Fri, 5 Apr 2013 21:15:16 +0000 (14:15 -0700)

Merge branch 'sg/gpg-sig'

Teach "merge/pull" to optionally verify and reject commits that are
not signed properly.

* sg/gpg-sig:
pretty printing: extend %G? to include 'N' and 'U'
merge/pull Check for untrusted good GPG signatures
merge/pull: verify GPG signatures of commits being merged
commit.c/GPG signature verification: Also look at the first GPG status line
Move commit GPG signature verification to commit.c

Merge branch 'jl/submodule-deinit'Junio C Hamano Fri, 5 Apr 2013 21:15:13 +0000 (14:15 -0700)

Merge branch 'jl/submodule-deinit'

A finishing touch to the new topic in 1.8.3.

* jl/submodule-deinit:
submodule deinit: clarify work tree removal message

Merge branch 'rr/send-email-perl-critique'Junio C Hamano Fri, 5 Apr 2013 21:14:48 +0000 (14:14 -0700)

Merge branch 'rr/send-email-perl-critique'

Update "git send-email" for issues noticed by PerlCritic.

* rr/send-email-perl-critique:
send-email: use the three-arg form of open in recipients_cmd
send-email: drop misleading function prototype
send-email: use "return;" not "return undef;" on error codepaths

Merge branch 'jc/merge-tag-object'Junio C Hamano Fri, 5 Apr 2013 21:14:41 +0000 (14:14 -0700)

Merge branch 'jc/merge-tag-object'

"git merge $(git rev-parse v1.8.2)" behaved quite differently from
"git merge v1.8.2" as if v1.8.2 were written as v1.8.2^0 and did
not pay much attention to the annotated tag payload.

This makes the code notice the type of the tag object, in addition
to the dwim_ref() based classification the current code uses
(i.e. the name appears in refs/tags/) to decide when to special
case merging of tags.

* jc/merge-tag-object:
t6200: test message for merging of an annotated tag
t6200: use test_config/test_unconfig
merge: a random object may not necssarily be a commit

path.c: optimize adjust_shared_perm()Torsten Bögershausen Sat, 30 Mar 2013 09:53:47 +0000 (10:53 +0100)

path.c: optimize adjust_shared_perm()

Sometimes the chown() function is called even when not needed (This
can be provoked by running t1301, and adding some debug code).

Save a chmod from 400 to 400, or from 600 to 600 on these files:

.git/info/refs+
.git/objects/info/packs+

Save chmod on directories from 2770 to 2770:

.git/refs
.git/refs/heads
.git/refs/tags

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

path.c: simplify adjust_shared_perm()Torsten Bögershausen Sat, 30 Mar 2013 09:53:32 +0000 (10:53 +0100)

path.c: simplify adjust_shared_perm()

All calls to set_shared_perm() use mode == 0, so simplify the
function.

Because all callers use the macro adjust_shared_perm(path) from
cache.h to call this function, convert it to a proper function,
losing set_shared_perm().

Since path.c has much more functions than just mkpath() these days,
drop the stale comment about it.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-pickaxe: unify code for log -S/-GJeff King Fri, 5 Apr 2013 05:28:10 +0000 (01:28 -0400)

diffcore-pickaxe: unify code for log -S/-G

The logic flow of has_changes() used for "log -S" and diff_grep()
used for "log -G" are essentially the same. See if we have both
sides that could be different in any interesting way, slurp the
contents in core, possibly after applying textconv, inspect the
contents, clean-up and report the result. The only difference
between the two is how "inspect" step works.

Unify this codeflow in a helper, pickaxe_match(), which takes a
callback function that implements the specific "inspect" step.

After removing the common scaffolding code from the existing
has_changes() and diff_grep(), they each becomes such a callback
function suitable for passing to pickaxe_match().

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-pickaxe: fix leaks in "log -S<block>" and... Junio C Hamano Fri, 5 Apr 2013 04:03:21 +0000 (21:03 -0700)

diffcore-pickaxe: fix leaks in "log -S<block>" and "log -G<pattern>"

The diff_grep() and has_changes() functions had early return
codepaths for unmerged filepairs, which simply returned 0. When we
taught textconv filter to them, one was ignored and continued to
return early without freeing the result filtered by textconv, and
the other had a failed attempt to fix, which allowed the planned
return value 0 to be overwritten by a bogus call to contains().

Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-pickaxe: port optimization from has_changes... Junio C Hamano Fri, 5 Apr 2013 03:40:31 +0000 (20:40 -0700)

diffcore-pickaxe: port optimization from has_changes() to diff_grep()

These two functions are called in the same codeflow to implement
"log -S<block>" and "log -G<pattern>", respectively, but the latter
lacked two obvious optimizations the former implemented, namely:

- When a pickaxe limit is not given at all, they should return
without wasting any cycle;

- When both sides of the filepair are the same, and the same
textconv conversion apply to them, return early, as there will be
no interesting differences between the two anyway.

Also release the filespec data once the processing is done (this is
not about leaking memory--it is about releasing data we finished
looking at as early as possible).

Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-pickaxe: respect --no-textconvSimon Ruderich Fri, 5 Apr 2013 13:16:30 +0000 (15:16 +0200)

diffcore-pickaxe: respect --no-textconv

git log -S doesn't respect --no-textconv:

$ echo '*.txt diff=wrong' > .gitattributes
$ git -c diff.wrong.textconv='xxx' log --no-textconv -Sfoo
error: cannot run xxx: No such file or directory
fatal: unable to read files to diff

Reported-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-commit: reword the --amend explanationCarlos Martín Nieto Wed, 3 Apr 2013 13:07:21 +0000 (15:07 +0200)

Documentation/git-commit: reword the --amend explanation

The explanation for 'git commit --amend' talks about preparing a tree
object, which shouldn't be how user-facing documentation talks about
commit.

Reword it to say it works as usual, but replaces the current commit.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3600: document failure of rm across symbolic linksJeff King Fri, 5 Apr 2013 00:00:09 +0000 (20:00 -0400)

t3600: document failure of rm across symbolic links

If we have a symlink "d" that points to a directory, we
should not be able to remove "d/f". In the normal case,
where "d/f" does not exist in the index, we already disallow
this, as we only remove things that git knows about in the
index. So for something like:

ln -s /outside/repo foo
git add foo
git rm foo/bar

we will properly produce an error (as there is no index
entry for foo/bar). However, if there is an index entry for
the path (e.g., because the movement is due to working tree
changes that have not yet been reflected in the index), we
will happily delete it, even though the path we delete from the
filesystem is not the same as the path in the index.

This patch documents that failure with a test.

While this is a bug, it should not be possible to cause
serious data loss with it. For any path that does not have
an index entry, we will complain and bail. For a path which
does have an index entry, we will do the usual up-to-date
content check. So even if the deleted path in the filesystem
is not the same as the one we are removing from the index,
we do know that they at least have the same content, and
that the content is included in HEAD.

That means the worst case is not the accidental loss of
content, but rather confusion by the user when a copy of a
file another part of the tree is removed. Which makes this
bug a minor and hard-to-trigger annoyance rather than a
data-loss bug (and hence the fix can be saved for a rainy
day when somebody feels like working on it).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-pickaxe: remove fill_one()Jeff King Fri, 5 Apr 2013 00:08:47 +0000 (20:08 -0400)

diffcore-pickaxe: remove fill_one()

fill_one is _almost_ identical to just calling fill_textconv; the
exception is that for the !DIFF_FILE_VALID case, fill_textconv gives us
an empty buffer rather than a NULL one. Since we currently use the NULL
pointer as a signal that the file is not present on one side of the
diff, we must now switch to using DIFF_FILE_VALID to make the same
check.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-pickaxe: remove unnecessary call to get_textconv()Simon Ruderich Thu, 4 Apr 2013 20:20:29 +0000 (22:20 +0200)

diffcore-pickaxe: remove unnecessary call to get_textconv()

The fill_one() function is responsible for finding and filling the
textconv filter as necessary, and is called by diff_grep() function
that implements "git log -G<pattern>".

The has_changes() function that implements "git log -S<block>" calls
get_textconv() for two sides being compared, before it checks to see
if it was asked to perform the pickaxe limiting. Move the code
around to avoid this wastage.

After has_changes() calls get_textconv() to obtain textconv for both
sides, fill_one() is called to use them.

By adding get_textconv() to diff_grep() and relieving fill_one() of
responsibility to find the textconv filter, we can avoid calling
get_textconv() twice in has_changes().

With this change it's also no longer necessary for fill_one() to
modify the textconv argument, therefore pass a pointer instead of a
pointer to a pointer.

Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with maintJunio C Hamano Thu, 4 Apr 2013 20:03:50 +0000 (13:03 -0700)

Sync with maint

* maint:
mailmap: update Pasky's address
git-remote-mediawiki: new wiki URL in documentation

mailmap: update Pasky's addressJunio C Hamano Thu, 4 Apr 2013 20:03:34 +0000 (13:03 -0700)

mailmap: update Pasky's address

Eric Wong noticed that the address at suse.cz no longer works.
We may want to update in-code addresses as well, but let's do
this first in 'maint'.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'nd/index-pack-threaded-fixes' into maintJunio C Hamano Thu, 4 Apr 2013 20:00:41 +0000 (13:00 -0700)

Merge branch 'nd/index-pack-threaded-fixes' into maint

* nd/index-pack-threaded-fixes:
index-pack: guard nr_resolved_deltas reads by lock
index-pack: protect deepest_delta in multithread code

Merge branch 'jk/index-pack-correct-depth-fix' into... Junio C Hamano Thu, 4 Apr 2013 20:00:37 +0000 (13:00 -0700)

Merge branch 'jk/index-pack-correct-depth-fix' into maint

* jk/index-pack-correct-depth-fix:
index-pack: always zero-initialize object_entry list