Commit graph

30459 commits

Author SHA1 Message Date
Michael Haggerty 7ec30aaa5b Provide a mechanism to turn off symlink resolution in ceiling paths
Commit 1b77d83cab 'setup_git_directory_gently_1(): resolve symlinks
in ceiling paths' changed the setup code to resolve symlinks in the
entries in GIT_CEILING_DIRECTORIES.  Because those entries are
compared textually to the symlink-resolved current directory, an
entry in GIT_CEILING_DIRECTORIES that contained a symlink would have
no effect.  It was known that this could cause performance problems
if the symlink resolution *itself* touched slow filesystems, but it
was thought that such use cases would be unlikely.  The intention of
the earlier change was to deal with a case when the user has this:

	GIT_CEILING_DIRECTORIES=/home/gitster

but in reality, /home/gitster is a symbolic link to somewhere else,
e.g. /net/machine/home4/gitster. A textual comparison between the
specified value /home/gitster and the location getcwd(3) returns
would not help us, but readlink("/home/gitster") would still be
fast.

After this change was released, Anders Kaseorg <andersk@mit.edu>
reported:

> [...] my computer has been acting so slow when I’m not connected to
> the network.  I put various network filesystem paths in
> $GIT_CEILING_DIRECTORIES, such as
> /afs/athena.mit.edu/user/a/n/andersk (to avoid hitting its parents
> /afs/athena.mit.edu, /afs/athena.mit.edu/user/a, and
> /afs/athena.mit.edu/user/a/n which all live in different AFS
> volumes).  Now when I’m not connected to the network, every
> invocation of Git, including the __git_ps1 in my shell prompt, waits
> for AFS to timeout.

To allow users to work around this problem, give them a mechanism to
turn off symlink resolution in GIT_CEILING_DIRECTORIES entries.  All
the entries that follow an empty entry will not be checked for symbolic
links and used literally in comparison.  E.g. with these:

	GIT_CEILING_DIRECTORIES=:/foo/bar:/xyzzy or
	GIT_CEILING_DIRECTORIES=/foo/bar::/xyzzy

we will not readlink("/xyzzy") because it comes after an empty entry.

With the former (but not with the latter), "/foo/bar" comes after an
empty entry, and we will not readlink it, either.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-02-22 11:37:34 -08:00
Michael Haggerty 1b77d83cab setup_git_directory_gently_1(): resolve symlinks in ceiling paths
longest_ancestor_length() relies on a textual comparison of directory
parts to find the part of path that overlaps with one of the paths in
prefix_list.  But this doesn't work if any of the prefixes involves a
symbolic link, because the directories will look different even though
they might logically refer to the same directory.  So canonicalize the
paths listed in GIT_CEILING_DIRECTORIES using real_path_if_valid()
before passing them to longest_ancestor_length().  (Also rename
normalize_ceiling_entry() to canonicalize_ceiling_entry() to reflect
the change.)

path is already in canonical form, so doesn't need to be canonicalized
again.

This fixes some problems with using GIT_CEILING_DIRECTORIES that
contains paths involving symlinks, including t4035 if run with --root
set to a path involving symlinks.

Please note that test t0060 is *not* changed analogously, because that
would make the test suite results dependent on the contents of the
local root directory.  However, real_path() is already tested
independently, and the "ancestor" tests cover the non-normalization
aspects of longest_ancestor_length(), so coverage remains sufficient.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
2012-10-29 02:34:58 -04:00
Michael Haggerty 9e2326c7e1 longest_ancestor_length(): require prefix list entries to be normalized
Move the responsibility for normalizing prefixes from
longest_ancestor_length() to its callers. Use slightly different
normalizations at the two callers:

In setup_git_directory_gently_1(), use the old normalization, which
ignores paths that are not usable.  In the next commit we will change
this caller to also resolve symlinks in the paths from
GIT_CEILING_DIRECTORIES as part of the normalization.

In "test-path-utils longest_ancestor_length", use the old
normalization, but die() if any paths are unusable.  Also change t0060
to only pass normalized paths to the test program (no empty entries or
non-absolute paths, strip trailing slashes from the paths, and remove
tests that thereby become redundant).

The point of this change is to reduce the scope of the ancestor_length
tests in t0060 from testing normalization+longest_prefix to testing
only mostly longest_prefix.  This is necessary because when
setup_git_directory_gently_1() starts resolving symlinks as part of
its normalization, it will not be reasonable to do the same in the
test suite, because that would make the test results depend on the
contents of the root directory of the filesystem on which the test is
run.  HOWEVER: under Windows, bash mangles arguments that look like
absolute POSIX paths into DOS paths.  So we have to retain the level
of normalization done by normalize_path_copy() to convert the
bash-mangled DOS paths (which contain backslashes) into paths that use
forward slashes.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
2012-10-29 02:34:58 -04:00
Michael Haggerty 31171d9e45 longest_ancestor_length(): take a string_list argument for prefixes
Change longest_ancestor_length() to take the prefixes argument as a
string_list rather than as a colon-separated string.  This will make
it easier for the caller to alter the entries before calling
longest_ancestor_length().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
2012-10-29 02:34:58 -04:00
Michael Haggerty a5ccdbe416 longest_ancestor_length(): use string_list_split()
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
2012-10-29 02:34:58 -04:00
Michael Haggerty e3e46cdbd4 Introduce new function real_path_if_valid()
The function is like real_path(), except that it returns NULL on error
instead of dying.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
2012-10-29 02:34:58 -04:00
Michael Haggerty d6052abca3 real_path_internal(): add comment explaining use of cwd
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
2012-10-29 02:34:57 -04:00
Michael Haggerty 038e55fec2 Introduce new static function real_path_internal()
It accepts a new parameter, die_on_error.  If die_on_error is false,
it simply cleans up after itself and returns NULL rather than dying.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
2012-10-29 02:34:57 -04:00
Junio C Hamano 652398a88e Update draft release notes to 1.8.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-25 10:44:32 -07:00
Junio C Hamano 86bdfa3955 Merge branch 'rr/test-make-sure-we-have-git'
Only the first test t0000 in the test suite made sure we have built
Git to be tested; move the check to test-lib so that it applies to
all tests equally.

* rr/test-make-sure-we-have-git:
  t/test-lib: make sure Git has already been built
2012-09-25 10:40:24 -07:00
Junio C Hamano cbea001a86 Merge branch 'js/hp-nonstop'
Port to HP NonStop aka Tandem.

* js/hp-nonstop:
  Port to HP NonStop
2012-09-25 10:40:21 -07:00
Junio C Hamano d782797aaf Merge branch 'js/poll-emu'
* js/poll-emu:
  make poll() work on platforms that can't recv() on a non-socket
  poll() exits too early with EFAULT if 1st arg is NULL
  fix some win32 specific dependencies in poll.c
  make poll available for other platforms lacking it
2012-09-25 10:40:18 -07:00
Junio C Hamano 0ec6aa567a Merge branch 'ep/malloc-check-perturb'
Run our test scripts with MALLOC_CHECK_ and MALLOC_PERTURB_, the
built-in memory access checking facility GNU libc has.

* ep/malloc-check-perturb:
  MALLOC_CHECK: various clean-ups
  Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for detecting heap corruption
2012-09-25 10:40:15 -07:00
Junio C Hamano c4eed8689b Merge branch 'aj/xfuncname-ada'
* aj/xfuncname-ada:
  Add userdiff patterns for Ada
2012-09-25 10:40:11 -07:00
Junio C Hamano b1bb02dede Merge branch 'jc/maint-mailinfo-mime-attr'
When "git am" is fed an input that has multiple "Content-type: ..."
header, it did not grok charset= attribute correctly.

* jc/maint-mailinfo-mime-attr:
  mailinfo: do not concatenate charset= attribute values from mime headers
2012-09-25 10:39:56 -07:00
Junio C Hamano ff91dbbf7d Merge branch 'po/maint-docs'
Various documentation fixups.

* po/maint-docs:
  Doc branch: show -vv option and alternative
  Doc clean: add See Also link
  Doc add: link gitignore
  Doc: separate gitignore pattern sources
  Doc: shallow clone deepens _to_ new depth
2012-09-25 10:39:52 -07:00
Junio C Hamano 8ccd4b68a7 Merge branch 'db/doc-custom-xmlto'
* db/doc-custom-xmlto:
  Documentation/Makefile: Allow custom XMLTO binary
2012-09-25 10:39:48 -07:00
Junio C Hamano 8e609b270a Merge branch 'maint'
* maint:
  Revert "completion: fix shell expansion of items"
2012-09-25 10:25:52 -07:00
Jeff King 666ca59a8c Revert "completion: fix shell expansion of items"
This reverts commit 25ae7cfd19.

That patch does fix expansion of weird variables in some
simple tests, but it also seems to break other things, like
expansion of refs by "git checkout".

While we're sorting out the correct solution, we are much
better with the original bug (people with metacharacters in
their completions occasionally see an error message) than
the current bug (ref completion does not work at all).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-25 09:00:28 -07:00
Junio C Hamano b5d156c362 Sync with maint 2012-09-24 12:50:36 -07:00
Junio C Hamano 1a002c73ba Start preparation for 1.7.12.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-24 12:50:00 -07:00
Junio C Hamano 140011d8f2 Merge branch 'jc/maint-blame-no-such-path' into maint
Even during a conflicted merge, "git blame $path" always meant to
blame uncommitted changes to the "working tree" version; make it
more useful by showing cleanly merged parts as coming from the other
branch that is being merged.

This incidentally fixes an unrelated problem on a case insensitive
filesystem, where "git blame MAKEFILE" run in a history that has
"Makefile" but not "MAKEFILE" did not say "No such file MAKEFILE in
HEAD" but pretended as if "MAKEFILE" was a newly added file.

* jc/maint-blame-no-such-path:
  blame: allow "blame file" in the middle of a conflicted merge
  blame $path: avoid getting fooled by case insensitive filesystems
2012-09-24 12:40:02 -07:00
Junio C Hamano 8144049d79 Merge branch 'dj/fetch-all-tags' into maint
"git fetch --all", when passed "--no-tags", did not honor the
"--no-tags" option while fetching from individual remotes (the same
issue existed with "--tags", but combination "--all --tags" makes
much less sense than "--all --no-tags").

* dj/fetch-all-tags:
  fetch --all: pass --tags/--no-tags through to each remote
  submodule: use argv_array instead of hand-building arrays
  fetch: use argv_array instead of hand-building arrays
  argv-array: fix bogus cast when freeing array
  argv-array: add pop function
2012-09-24 12:39:21 -07:00
Jonathan "Duke" Leto f9db19214a Improve the description of GIT_PS1_SHOWUPSTREAM
Describe what '=' means in the output of __git_ps1 when using
GIT_PS1_SHOWUPSTREAM, which was not previously described.

Signed-off-by: Jonathan "Duke" Leto <jonathan@leto.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-24 12:38:41 -07:00
Junio C Hamano 16eed7c993 Merge branch 'mh/fetch-filter-refs'
Finishing touch to update documentation of string-list to make sure
the earlier rewrite of ref-list match logic that depends on its sort
order will not get broken.

* mh/fetch-filter-refs:
  string_list API: document what "sorted" means
2012-09-21 11:17:00 -07:00
Junio C Hamano 36d1f3d131 Merge branch 'jc/maint-log-grep-all-match-1'
A finishing touch to make two symbols that were meant to be file-scope
static really so.

* jc/maint-log-grep-all-match-1:
  grep.c: make two symbols really file-scope static this time
2012-09-21 11:14:49 -07:00
Junio C Hamano f1c62ee9de Merge branch 'maint'
* maint:
  Documentation: Document signature showing options
  completion: fix shell expansion of items
2012-09-20 15:55:47 -07:00
Junio C Hamano 8ef2794ba8 Merge branch 'nd/maint-diffstat-summary' into maint
* nd/maint-diffstat-summary:
  Revert diffstat back to English
2012-09-20 15:55:31 -07:00
Junio C Hamano 467ad25471 Merge branch 'jw/doc-commit-title' into maint
* jw/doc-commit-title:
  Documentation: describe subject more precisely
2012-09-20 15:55:22 -07:00
Junio C Hamano cc84144d48 Merge branch 'dg/run-command-child-cleanup' into maint
* dg/run-command-child-cleanup:
  run-command.c: fix broken list iteration in clear_child_for_cleanup
2012-09-20 15:55:12 -07:00
Junio C Hamano 96c2abea02 Merge branch 'jc/mailinfo-RE' into maint
* jc/mailinfo-RE:
  mailinfo: strip "RE: " prefix
2012-09-20 15:55:03 -07:00
Junio C Hamano ee70fb8e4a Merge branch 'sn/ls-remote-get-url-doc' into maint
* sn/ls-remote-get-url-doc:
  ls-remote: document the '--get-url' option
2012-09-20 15:54:57 -07:00
Junio C Hamano 9fcacaab02 Merge branch 'nd/log-n-doc' into maint
* nd/log-n-doc:
  doc: move rev-list option -<n> from git-log.txt to rev-list-options.txt
2012-09-20 15:54:43 -07:00
Junio C Hamano f9c2d2b14e Merge branch 'nd/maint-remote-remove' into maint
* nd/maint-remote-remove:
  remote: prefer subcommand name 'remove' to 'rm'
2012-09-20 15:53:31 -07:00
Junio C Hamano 3083301ead grep.c: make two symbols really file-scope static this time
Adding a declaration at the beginning is not sufficient for obvious
reasons. The definition has to be made static.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-20 14:20:09 -07:00
Stephen Boyd f2fef7b55a Documentation: Document signature showing options
The pretty formats for GPG signatures were introduced but never
documented. Use the documentation from the commit that introduced them.
Do the same for the --show-signature option added to git log and
friends.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-20 10:28:51 -07:00
Felipe Contreras 25ae7cfd19 completion: fix shell expansion of items
As reported by Jeroen Meijer[1]; the current code doesn't deal properly
with items (tags, branches, etc.) that have ${} in them because they get
expaned by bash while using compgen.

A simple solution is to quote the items so they get expanded properly
(\$\{\}).

In order to achieve that I took bash-completion's quote() function,
which is rather simple, and renamed it to __git_quote() as per Jeff
King's suggestion.

Solves the original problem for me.

[1] http://article.gmane.org/gmane.comp.version-control.git/201596

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-20 09:52:36 -07:00
Joachim Schmitz 6c109904bc Port to HP NonStop
Includes the addition of some new defines and their description for others to use.

Signed-off-by: Joachim Schmitz <jojo@schmitz-digital.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-19 17:31:25 -07:00
Dave Borowitz dd4f307561 Documentation/Makefile: Allow custom XMLTO binary
Signed-off-by: Dave Borowitz <dborowitz@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-19 16:35:10 -07:00
Philip Oakley f0970faa96 Doc branch: show -vv option and alternative
Indicate that the -v option can be given twice in the short options.
Without it users pass over the option. Also indicate the alternate
'git remote show' method.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-19 10:22:49 -07:00
Philip Oakley 068c6745fe Doc clean: add See Also link
'git clean' is controlled by gitignore. Provide See Also link for it.

Use of core.excludesfile is implied.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-18 21:49:50 -07:00
Philip Oakley a73d379063 Doc add: link gitignore
Use a gitignore link rather than the gitrepository-
layout link.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-18 21:49:46 -07:00
Philip Oakley 3f8c5a41f1 Doc: separate gitignore pattern sources
Use separate bulleted paragraphs for the three different gitignore
pattern sources.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-18 21:47:45 -07:00
Philip Oakley bc40deabbc Doc: shallow clone deepens _to_ new depth
Clarify that 'depth=' specifies the new depth from the remote's
branch tip. It does not add the depth to the existing shallow clone.
(details from pack-protocol.txt).
Clarify that tags are not fetched. (details from shallow.txt)

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-18 21:47:12 -07:00
Junio C Hamano b0576a6a6d Update draft release notes to 1.8.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-18 14:43:12 -07:00
Junio C Hamano 3d7535e424 Merge branch 'jc/maint-log-grep-all-match'
Fix a long-standing bug in "git log --grep" when multiple "--grep"
are used together with "--all-match" and "--author" or "--committer".

* jc/maint-log-grep-all-match:
  t7810-grep: test --all-match with multiple --grep and --author options
  t7810-grep: test interaction of multiple --grep and --author options
  t7810-grep: test multiple --author with --all-match
  t7810-grep: test multiple --grep with and without --all-match
  t7810-grep: bring log --grep tests in common form
  grep.c: mark private file-scope symbols as static
  log: document use of multiple commit limiting options
  log --grep/--author: honor --all-match honored for multiple --grep patterns
  grep: show --debug output only once
  grep: teach --debug option to dump the parse tree
2012-09-18 14:37:54 -07:00
Junio C Hamano 06e211acc6 Merge branch 'jc/make-static'
Turn many file-scope private symbols to static to reduce the
global namespace contamination.

* jc/make-static:
  sequencer.c: mark a private file-scope symbol as static
  ident.c: mark private file-scope symbols as static
  trace.c: mark a private file-scope symbol as static
  wt-status.c: mark a private file-scope symbol as static
  read-cache.c: mark a private file-scope symbol as static
  strbuf.c: mark a private file-scope symbol as static
  sha1-array.c: mark a private file-scope symbol as static
  symlinks.c: mark private file-scope symbols as static
  notes.c: mark a private file-scope symbol as static
  rerere.c: mark private file-scope symbols as static
  graph.c: mark private file-scope symbols as static
  diff.c: mark a private file-scope symbol as static
  commit.c: mark a file-scope private symbol as static
  builtin/notes.c: mark file-scope private symbols as static
2012-09-18 14:37:46 -07:00
Junio C Hamano 8db3865936 Merge branch 'pw/p4-submit-conflicts'
Add '--conflict' option to git-p4 subcommand to specify what action
to take when conflicts are found during 'p4 submit'.

* pw/p4-submit-conflicts:
  git-p4: add submit --conflict option and config varaiable
  git p4: add submit --prepare-p4-only option
  git p4: add submit --dry-run option
  git p4: accept -v for --verbose
  git p4: revert deleted files after submit cancel
  git p4: rearrange submit template construction
  git p4: test clean-up after failed submit, fix added files
  git p4: standardize submit cancel due to unchanged template
  git p4: move conflict prompt into run, add [q]uit input
  git p4: remove submit failure options [a]pply and [w]rite
  git p4: gracefully fail if some commits could not be applied
  git p4 test: remove bash-ism of combined export/assignment
2012-09-18 14:36:17 -07:00
Junio C Hamano 3387423870 Merge branch 'mv/cherry-pick-s'
After "git cherry-pick -s" gave control back to the user asking
help to resolve conflicts, concluding "git commit" needs to be run
with "-s" if the user wants to sign it off, but the command should
be able to remember that.

* mv/cherry-pick-s:
  cherry-pick: don't forget -s on failure
2012-09-18 14:36:00 -07:00
Junio C Hamano d71abd99f8 Merge branch 'nd/fetch-status-alignment'
The status report from "git fetch", when messages like 'up-to-date'
are translated, did not align the branch names well.

* nd/fetch-status-alignment:
  fetch: align per-ref summary report in UTF-8 locales
2012-09-18 14:35:55 -07:00