git
7 years agoMerge branch 'ls/p4-empty-file-on-lfs'
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)] 
Merge branch 'ls/p4-empty-file-on-lfs'

"git p4" LFS support was broken when LFS stores an empty blob.

* ls/p4-empty-file-on-lfs:
  git-p4: fix empty file processing for large file system backend GitLFS

7 years agoMerge branch 'ld/p4-update-shelve'
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)] 
Merge branch 'ld/p4-update-shelve'

* ld/p4-update-shelve:
  git-p4: support updating an existing shelved changelist

7 years agoMerge branch 'vk/p4-submit-shelve'
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)] 
Merge branch 'vk/p4-submit-shelve'

* vk/p4-submit-shelve:
  git-p4: allow submit to create shelved changelists.

7 years agoMerge branch 'da/mergetool-trust-exit-code'
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)] 
Merge branch 'da/mergetool-trust-exit-code'

mergetool.<tool>.trustExitCode configuration variable did not apply
to built-in tools, but now it does.

* da/mergetool-trust-exit-code:
  mergetools/vimdiff: trust Vim's exit code
  mergetool: honor mergetool.$tool.trustExitCode for built-in tools

7 years agoMerge branch 'ak/lazy-prereq-mktemp'
Junio C Hamano [Fri, 16 Dec 2016 23:27:49 +0000 (15:27 -0800)] 
Merge branch 'ak/lazy-prereq-mktemp'

Test code clean-up.

* ak/lazy-prereq-mktemp:
  t7610: clean up foo.XXXXXX tmpdir

7 years agoMerge branch 'nd/worktree-list-fixup'
Junio C Hamano [Fri, 16 Dec 2016 23:27:48 +0000 (15:27 -0800)] 
Merge branch 'nd/worktree-list-fixup'

The output from "git worktree list" was made in readdir() order,
and was unstable.

* nd/worktree-list-fixup:
  worktree list: keep the list sorted
  worktree.c: get_worktrees() takes a new flag argument
  get_worktrees() must return main worktree as first item even on error
  worktree: reorder an if statement
  worktree.c: zero new 'struct worktree' on allocation

7 years agoMerge branch 'nd/qsort-in-merge-recursive'
Junio C Hamano [Fri, 16 Dec 2016 23:27:48 +0000 (15:27 -0800)] 
Merge branch 'nd/qsort-in-merge-recursive'

Code simplification.

* nd/qsort-in-merge-recursive:
  merge-recursive.c: use string_list_sort instead of qsort

7 years agoMerge branch 'bw/push-dry-run'
Junio C Hamano [Fri, 16 Dec 2016 23:27:48 +0000 (15:27 -0800)] 
Merge branch 'bw/push-dry-run'

"git push --dry-run --recurse-submodule=on-demand" wasn't
"--dry-run" in the submodules.

* bw/push-dry-run:
  push: fix --dry-run to not push submodules
  push: --dry-run updates submodules when --recurse-submodules=on-demand

7 years agoMerge branch 'hv/submodule-not-yet-pushed-fix'
Junio C Hamano [Fri, 16 Dec 2016 23:27:47 +0000 (15:27 -0800)] 
Merge branch 'hv/submodule-not-yet-pushed-fix'

The code in "git push" to compute if any commit being pushed in the
superproject binds a commit in a submodule that hasn't been pushed
out was overly inefficient, making it unusable even for a small
project that does not have any submodule but have a reasonable
number of refs.

* hv/submodule-not-yet-pushed-fix:
  submodule_needs_pushing(): explain the behaviour when we cannot answer
  batch check whether submodule needs pushing into one call
  serialize collection of refs that contain submodule changes
  serialize collection of changed submodules

7 years agoMerge branch 'dt/empty-submodule-in-merge'
Junio C Hamano [Fri, 16 Dec 2016 23:27:47 +0000 (15:27 -0800)] 
Merge branch 'dt/empty-submodule-in-merge'

An empty directory in a working tree that can simply be nuked used
to interfere while merging or cherry-picking a change to create a
submodule directory there, which has been fixed..

* dt/empty-submodule-in-merge:
  submodules: allow empty working-tree dirs in merge/cherry-pick

7 years agoMerge branch 'jk/rev-parse-symbolic-parents-fix'
Junio C Hamano [Fri, 16 Dec 2016 23:27:47 +0000 (15:27 -0800)] 
Merge branch 'jk/rev-parse-symbolic-parents-fix'

"git rev-parse --symbolic" failed with a more recent notation like
"HEAD^-1" and "HEAD^!".

* jk/rev-parse-symbolic-parents-fix:
  rev-parse: fix parent shorthands with --symbolic

7 years agoindex-pack: skip collision check when not in repository
Jeff King [Fri, 16 Dec 2016 21:43:22 +0000 (16:43 -0500)] 
index-pack: skip collision check when not in repository

You can run "git index-pack path/to/foo.pack" outside of a
repository to generate an index file, or just to verify the
contents. There's no point in doing a collision check, since
we obviously do not have any objects to collide with.

The current code will blindly look in .git/objects based on
the result of setup_git_env(). That effectively gives us the
right answer (since we won't find any objects), but it's a
waste of time, and it conflicts with our desire to
eventually get rid of the "fallback to .git" behavior of
setup_git_env().

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agonormalize_path_copy(): fix pushing to //server/share/dir on Windows
Johannes Sixt [Wed, 14 Dec 2016 19:37:38 +0000 (20:37 +0100)] 
normalize_path_copy(): fix pushing to //server/share/dir on Windows

normalize_path_copy() is not prepared to keep the double-slash of a
//server/share/dir kind of path, but treats it like a regular POSIX
style path and transforms it to /server/share/dir.

The bug manifests when 'git push //server/share/dir master' is run,
because tmp_objdir_add_as_alternate() uses the path in normalized
form when it registers the quarantine object database via
link_alt_odb_entries(). Needless to say that the directory cannot be
accessed using the wrongly normalized path.

Fix it by skipping all of the root part, not just a potential drive
prefix. offset_1st_component takes care of this, see the
implementation in compat/mingw.c::mingw_offset_1st_component().

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoshortlog: test and document --committer option
Jeff King [Fri, 16 Dec 2016 13:51:41 +0000 (08:51 -0500)] 
shortlog: test and document --committer option

This puts the final touches on the feature added by
fbfda15fb8 (shortlog: group by committer information,
2016-10-11).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agot: use nongit() function where applicable
Jeff King [Fri, 16 Dec 2016 02:31:59 +0000 (21:31 -0500)] 
t: use nongit() function where applicable

Many tests want to run a command outside of any git repo;
with the nongit() function this is now a one-liner. It saves
a few lines, but more importantly, it's immediately obvious
what the code is trying to accomplish.

This doesn't convert every such case in the test suite; it
just covers those that want to do a one-off command. Other
cases, such as the ones in t4035, are part of a larger
scheme of outside-repo files, and it's less confusing for
them to stay consistent with the surrounding tests.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoindex-pack: complain when --stdin is used outside of a repo
Jeff King [Fri, 16 Dec 2016 02:30:59 +0000 (21:30 -0500)] 
index-pack: complain when --stdin is used outside of a repo

The index-pack builtin is marked as RUN_SETUP_GENTLY,
because it's perfectly fine to index a pack in the
filesystem outside of any repository. However, --stdin mode
will write the result to the object database, which does not
make sense outside of a repository. Doing so creates a bogus
".git" directory with nothing in it except the newly-created
pack and its index.

Instead, let's flag this as an error and abort.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agot5000: extract nongit function to test-lib-functions.sh
Jeff King [Fri, 16 Dec 2016 02:30:12 +0000 (21:30 -0500)] 
t5000: extract nongit function to test-lib-functions.sh

This function abstracts the idea of running a command
outside of any repository (which is slightly awkward to do
because even if you make a non-repo directory, git may keep
walking up outside of the trash directory). There are
several scripts that use the same technique, so let's make
the function available for everyone.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoshortlog: group by committer information
Linus Torvalds [Tue, 11 Oct 2016 18:45:58 +0000 (11:45 -0700)] 
shortlog: group by committer information

In some situations you may want to group the commits not by author,
but by committer instead.

For example, when I just wanted to look up what I'm still missing from
linux-next in the current merge window, I don't care so much about who
wrote a patch, as what git tree it came from, which generally boils
down to "who committed it".

So make git shortlog take a "-c" or "--committer" option to switch
grouping to that.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomerge: mark usage error strings for translation
Jeff King [Thu, 15 Dec 2016 17:43:46 +0000 (12:43 -0500)] 
merge: mark usage error strings for translation

The nearby error messages are already marked for
translation, but these new ones aren't.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoREADME: replace gmane link with public-inbox
Jeff King [Thu, 15 Dec 2016 14:17:19 +0000 (09:17 -0500)] 
README: replace gmane link with public-inbox

The general status and future of gmane is unclear at this
point, but certainly it does not seem to be carrying
gmane.comp.version-control.git at all anymore. Let's point
to public-inbox.org, which seems to be the favored archive
on the list these days (and which uses message-ids in its
URLs, making the links somewhat future-proof).

Reported-by: Chiel ten Brinke <ctenbrinke@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agohttp: respect protocol.*.allow=user for http-alternates
Jeff King [Wed, 14 Dec 2016 22:39:55 +0000 (14:39 -0800)] 
http: respect protocol.*.allow=user for http-alternates

The http-walker may fetch the http-alternates (or
alternates) file from a remote in order to find more
objects. This should count as a "not from the user" use of
the protocol. But because we implement the redirection
ourselves and feed the new URL to curl, it will use the
CURLOPT_PROTOCOLS rules, not the more restrictive
CURLOPT_REDIR_PROTOCOLS.

The ideal solution would be for each curl request we make to
know whether or not is directly from the user or part of an
alternates redirect, and then set CURLOPT_PROTOCOLS as
appropriate. However, that would require plumbing that
information through all of the various layers of the http
code.

Instead, let's check the protocol at the source: when we are
parsing the remote http-alternates file. The only downside
is that if there's any mismatch between what protocol we
think it is versus what curl thinks it is, it could violate
the policy.

To address this, we'll make the parsing err on the picky
side, and only allow protocols that it can parse
definitively. So for example, you can't elude the "http"
policy by asking for "HTTP://", even though curl might
handle it; we would reject it as unknown. The only unsafe
case would be if you have a URL that starts with "http://"
but curl interprets as another protocol. That seems like an
unlikely failure mode (and we are still protected by our
base CURLOPT_PROTOCOL setting, so the worst you could do is
trigger one of https, ftp, or ftps).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agotransport: add from_user parameter to is_transport_allowed
Brandon Williams [Wed, 14 Dec 2016 22:39:54 +0000 (14:39 -0800)] 
transport: add from_user parameter to is_transport_allowed

Add a from_user parameter to is_transport_allowed() to allow http to be
able to distinguish between protocol restrictions for redirects versus
initial requests.  CURLOPT_REDIR_PROTOCOLS can now be set differently
from CURLOPT_PROTOCOLS to disallow use of protocols with the "user"
policy in redirects.

This change allows callers to query if a transport protocol is allowed,
given that the caller knows that the protocol is coming from the user
(1) or not from the user (0) such as redirects in libcurl.  If unknown a
-1 should be provided which falls back to reading
`GIT_PROTOCOL_FROM_USER` to determine if the protocol came from the
user.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agohttp: create function to get curl allowed protocols
Brandon Williams [Wed, 14 Dec 2016 22:39:53 +0000 (14:39 -0800)] 
http: create function to get curl allowed protocols

Move the creation of an allowed protocols whitelist to a helper
function. This will be useful when we need to compute the set of
allowed protocols differently for normal and redirect cases.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agotransport: add protocol policy config option
Brandon Williams [Wed, 14 Dec 2016 22:39:52 +0000 (14:39 -0800)] 
transport: add protocol policy config option

Previously the `GIT_ALLOW_PROTOCOL` environment variable was used to
specify a whitelist of protocols to be used in clone/fetch/push
commands.  This patch introduces new configuration options for more
fine-grained control for allowing/disallowing protocols.  This also has
the added benefit of allowing easier construction of a protocol
whitelist on systems where setting an environment variable is
non-trivial.

Now users can specify a policy to be used for each type of protocol via
the 'protocol.<name>.allow' config option.  A default policy for all
unconfigured protocols can be set with the 'protocol.allow' config
option.  If no user configured default is made git will allow known-safe
protocols (http, https, git, ssh, file), disallow known-dangerous
protocols (ext), and have a default policy of `user` for all other
protocols.

The supported policies are `always`, `never`, and `user`.  The `user`
policy can be used to configure a protocol to be usable when explicitly
used by a user, while disallowing it for commands which run
clone/fetch/push commands without direct user intervention (e.g.
recursive initialization of submodules).  Commands which can potentially
clone/fetch/push from untrusted repositories without user intervention
can export `GIT_PROTOCOL_FROM_USER` with a value of '0' to prevent
protocols configured to the `user` policy from being used.

Fix remote-ext tests to use the new config to allow the ext
protocol to be tested.

Based on a patch by Jeff King <peff@peff.net>

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agohttp: always warn if libcurl version is too old
Brandon Williams [Wed, 14 Dec 2016 22:39:51 +0000 (14:39 -0800)] 
http: always warn if libcurl version is too old

Always warn if libcurl version is too old because:

1. Even without a protocol whitelist, newer versions of curl have all
   non-standard protocols disabled by default.
2. A future patch will introduce default "known-good" and "known-bad"
   protocols which are allowed/disallowed by 'is_transport_allowed'
   which older version of libcurl can't respect.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agolib-proto-disable: variable name fix
Brandon Williams [Wed, 14 Dec 2016 22:39:50 +0000 (14:39 -0800)] 
lib-proto-disable: variable name fix

The test_proto function assigns the positional parameters to named
variables, but then still refers to "$desc" as "$1". Using $desc is
more readable and less error-prone.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoRevert "sequencer: remove useless get_dir() function"
Junio C Hamano [Wed, 14 Dec 2016 22:56:46 +0000 (14:56 -0800)] 
Revert "sequencer: remove useless get_dir() function"

This reverts commit 39784cd3620cc47415c9010ec58a9616f040125c.

The function had only one caller when the "remove useless" was
written, but another topic will soon make heavy use of it and more
importantly the function will return different paths depending on
the value in opts.

7 years agoi18n: difftool: mark warnings for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:39 +0000 (11:54 -0100)] 
i18n: difftool: mark warnings for translation

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: send-email: mark composing message for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:38 +0000 (11:54 -0100)] 
i18n: send-email: mark composing message for translation

When composing an e-mail, there is a message for the user whose lines
begin in "GIT:" that can be marked for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: send-email: mark string with interpolation for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:37 +0000 (11:54 -0100)] 
i18n: send-email: mark string with interpolation for translation

Mark warnings, errors and other messages that are interpolated for
translation.

We call sprintf() before calling die() and in few other circumstances in
order to replace the values on the placeholders.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: send-email: mark warnings and errors for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:36 +0000 (11:54 -0100)] 
i18n: send-email: mark warnings and errors for translation

Mark warnings, errors and other messages for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: send-email: mark strings for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:35 +0000 (11:54 -0100)] 
i18n: send-email: mark strings for translation

Mark strings often displayed to the user for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: add--interactive: mark status words for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:34 +0000 (11:54 -0100)] 
i18n: add--interactive: mark status words for translation

Mark words 'nothing', 'unchanged' and 'binary' used to display what has
been staged or not, in "git add -i" status command.

Alternatively one could mark N__('nothing') no-op in order to
xgettext(1) extract the string and then trigger the translation at run
time only with __($print->{FILE}), but that has the side effect of triggering
retrieval of translations for the changes indicator too (e.g. +2/-1)
which may or may not be a problem.

To avoid that potential problem, mark only where there is certain to
trigger translation only of those words but in this case we must also
retrieve the translation for the eq tests, since the value assigned was
of the translation, not the English source.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: add--interactive: remove %patch_modes entries
Vasco Almeida [Wed, 14 Dec 2016 12:54:33 +0000 (11:54 -0100)] 
i18n: add--interactive: remove %patch_modes entries

Remove unnecessary entries from %patch_modes. After the i18n conversion,
these entries are not used anymore.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: add--interactive: mark edit_hunk_manually message for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:32 +0000 (11:54 -0100)] 
i18n: add--interactive: mark edit_hunk_manually message for translation

Mark message of edit_hunk_manually displayed in the editing file when
user chooses 'e' option.  The message had to be unfolded to allow
translation of the $participle verb.

Some messages end up being exactly the same for some use cases, but
left it for easier change in the future, e.g., wanting to change wording
of one particular use case.

The comment character is now used according to the git configuration
core.commentchar.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: add--interactive: i18n of help_patch_cmd
Vasco Almeida [Wed, 14 Dec 2016 12:54:31 +0000 (11:54 -0100)] 
i18n: add--interactive: i18n of help_patch_cmd

Mark help message of help_patch_cmd for translation.  The message must
be unfolded to be free of variables so we can have high quality
translations.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: add--interactive: mark patch prompt for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:30 +0000 (11:54 -0100)] 
i18n: add--interactive: mark patch prompt for translation

Mark prompt message assembled in place for translation, unfolding each
use case for each entry in the %patch_modes hash table.

Previously, this script relied on whether $patch_mode was set to run the
command patch_update_cmd() or show status and loop the main loop. Now,
it uses $cmd to indicate we must run patch_update_cmd() and $patch_mode
is used to tell which flavor of the %patch_modes are we on.  This is
introduced in order to be able to mark and unfold the message prompt
knowing in which context we are.

The tracking of context was done previously by point %patch_mode_flavour
hash table to the correct entry of %patch_modes, focusing only on value
of %patch_modes. Now, we are also interested in the key ('staged',
'stash', 'checkout_head', ...).

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: add--interactive: mark plural strings
Vasco Almeida [Wed, 14 Dec 2016 12:54:29 +0000 (11:54 -0100)] 
i18n: add--interactive: mark plural strings

Mark plural strings for translation.  Unfold each action case in one
entire sentence.

Pass new keyword for xgettext to extract.

Update test to include new subroutine __n() for plural strings handling.

Update documentation to include a description of the new __n()
subroutine.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: clean.c: match string with git-add--interactive.perl
Vasco Almeida [Wed, 14 Dec 2016 12:54:28 +0000 (11:54 -0100)] 
i18n: clean.c: match string with git-add--interactive.perl

Change strings for help to match the ones in git-add--interactive.perl.
The strings now represent one entry to translate each rather then two
entries each different only by an ending newline character.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: add--interactive: mark strings with interpolation for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:27 +0000 (11:54 -0100)] 
i18n: add--interactive: mark strings with interpolation for translation

Since at this point Git::I18N.perl lacks support for Perl i18n
placeholder substitution, use of sprintf following die or error_msg is
necessary for placeholder substitution take place.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: add--interactive: mark simple here-documents for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:26 +0000 (11:54 -0100)] 
i18n: add--interactive: mark simple here-documents for translation

Mark messages in here-documents without interpolation for translation.

The here-document delimiter \EOF, which is the same as 'EOF', indicates
that the text is to be treated literally without interpolation of its
content.  Unfortunately xgettext is not able to extract here-documents
delimited with \EOF but it is with delimiter enclosed in single quotes.
So change \EOF to 'EOF', although in this case does not make
difference what variation of here-document to use since there is nothing
to interpolate.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoi18n: add--interactive: mark strings for translation
Vasco Almeida [Wed, 14 Dec 2016 12:54:25 +0000 (11:54 -0100)] 
i18n: add--interactive: mark strings for translation

Mark simple strings (without interpolation) for translation.

Brackets around first parameter of ternary operator is necessary because
otherwise xgettext fails to extract strings marked for translation from
the rest of the file.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoGit.pm: add subroutines for commenting lines
Vasco Almeida [Wed, 14 Dec 2016 12:54:24 +0000 (11:54 -0100)] 
Git.pm: add subroutines for commenting lines

Add subroutines prefix_lines and comment_lines.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomerge: ensure '--abort' option takes no arguments
Chris Packham [Wed, 14 Dec 2016 08:37:57 +0000 (21:37 +1300)] 
merge: ensure '--abort' option takes no arguments

Like '--continue', the '--abort' option doesn't make any sense with
other options or arguments to 'git merge' so ensure that none are
present.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agocompletion: add --continue option for merge
Chris Packham [Wed, 14 Dec 2016 08:37:56 +0000 (21:37 +1300)] 
completion: add --continue option for merge

Add 'git merge --continue' option when completing.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomerge: add '--continue' option as a synonym for 'git commit'
Chris Packham [Wed, 14 Dec 2016 08:37:55 +0000 (21:37 +1300)] 
merge: add '--continue' option as a synonym for 'git commit'

Teach 'git merge' the --continue option which allows 'continuing' a
merge by completing it. The traditional way of completing a merge after
resolving conflicts is to use 'git commit'. Now with commands like 'git
rebase' and 'git cherry-pick' having a '--continue' option adding such
an option to 'git merge' presents a consistent UI.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoparse-options: print "fatal:" before usage_msg_opt()
Jeff King [Wed, 14 Dec 2016 15:10:10 +0000 (10:10 -0500)] 
parse-options: print "fatal:" before usage_msg_opt()

Programs may use usage_msg_opt() to print a brief message
followed by the program usage, and then exit. The message
isn't prefixed at all, though, so it doesn't match our usual
error output and is easy to overlook:

    $ git clone 1 2 3
    Too many arguments.

    usage: git clone [<options>] [--] <repo> [<dir>]

    -v, --verbose         be more verbose
    -q, --quiet           be more quiet
    --progress            force progress reporting
    -n, --no-checkout     don't create a checkout
    --bare                create a bare repository
    [...and so on for another 31 lines...]

It looks especially bad when the message starts with an
option, like:

    $ git replace -e
    -e needs exactly one argument

    usage: git replace [-f] <object> <replacement>
       or: git replace [-f] --edit <object>
    [...etc...]

Let's put our usual "fatal:" prefix in front of it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMakefile: exclude contrib from FIND_SOURCE_FILES
Jeff King [Wed, 14 Dec 2016 14:32:35 +0000 (09:32 -0500)] 
Makefile: exclude contrib from FIND_SOURCE_FILES

When you're working on the git project, you're unlikely to
care about random bits in contrib/ (e.g., you would not want
to jump to the copy of xmalloc in the wincred credential
helper). Nobody has really complained because there are
relatively few C files in contrib.

Now that we're matching shell scripts, too, we get quite a
few more hits, especially in the obsolete contrib/examples
directory. Looking for usage() should turn up the one in
git-sh-setup, not in some long-dead version of git-clone.

Let's just exclude all of contrib. Any specific projects
there which are big enough to want tags can generate them
separately.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMakefile: match shell scripts in FIND_SOURCE_FILES
Jeff King [Wed, 14 Dec 2016 14:29:44 +0000 (09:29 -0500)] 
Makefile: match shell scripts in FIND_SOURCE_FILES

We feed FIND_SOURCE_FILES to ctags to help developers
navigate to particular functions, but we only feed C source
code. The same feature can be helpful when working with
shell scripts (especially the test suite). Modern versions
of ctags know how to parse shell scripts; we just need to
feed the filenames to it.

This patch specifically avoids including the individual test
scripts themselves. Those are unlikely to be of interest,
and there are a lot of them to process. It does pick up
test-lib.sh and test-lib-functions.sh.

Note that our negative pathspec already excludes the
individual scripts for the ls-files case, but we need to
loosen the `find` rule to match it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMakefile: exclude test cruft from FIND_SOURCE_FILES
Jeff King [Wed, 14 Dec 2016 14:28:04 +0000 (09:28 -0500)] 
Makefile: exclude test cruft from FIND_SOURCE_FILES

The test directory may contain three types of files that
match our patterns:

  1. Helper programs in t/helper.

  2. Sample data files (e.g., t/t4051/hello.c).

  3. Untracked cruft in trash directories and t/perf/build.

We want to match (1), but not the other two, as they just
clutter up the list.

For the ls-files method, we can drop (2) with a negative
pathspec. We do not have to care about (3), since ls-files
will not list untracked files.

For `find`, we can match both cases with `-prune` patterns.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMakefile: reformat FIND_SOURCE_FILES
Jeff King [Wed, 14 Dec 2016 14:26:55 +0000 (09:26 -0500)] 
Makefile: reformat FIND_SOURCE_FILES

As we add to this in future commits, the formatting is going
to make it harder and harder to read. Let's write it more as
we would in a shell script, putting each logical block on
its own line.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agounicode_width.h: update the width tables to Unicode 9.0
Beat Bolli [Tue, 13 Dec 2016 23:31:44 +0000 (00:31 +0100)] 
unicode_width.h: update the width tables to Unicode 9.0

Rerunning update-unicode.sh that we fixed in the previous commits
produces these new tables.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoupdate_unicode.sh: remove the plane filter
Beat Bolli [Tue, 13 Dec 2016 23:31:43 +0000 (00:31 +0100)] 
update_unicode.sh: remove the plane filter

The uniset upstream has accepted my patches that eliminate the Unicode
plane offsets from the output in '--32' mode.

Remove the corresponding filter in update_unicode.sh.

This also fixes the issue that the plane offsets were not removed from
the second uniset call.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoupdate_unicode.sh: automatically download newer definition files
Beat Bolli [Tue, 13 Dec 2016 23:31:42 +0000 (00:31 +0100)] 
update_unicode.sh: automatically download newer definition files

Checking just for the unicode data files' existence is not sufficient;
we should also download them if a newer version exists on the Unicode
consortium's servers. Option -N of wget does this nicely for us.

Reviewed-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoSync with master
Junio C Hamano [Wed, 14 Dec 2016 00:23:24 +0000 (16:23 -0800)] 
Sync with master

* master:
  Early fixes for 2.11.x series

7 years agoMerge branch 'sb/t3600-cleanup' into next
Junio C Hamano [Wed, 14 Dec 2016 00:23:15 +0000 (16:23 -0800)] 
Merge branch 'sb/t3600-cleanup' into next

Code cleanup.

* sb/t3600-cleanup:
  t3600: slightly modernize style

7 years agoMerge branch 'lr/doc-fix-cet' into next
Junio C Hamano [Wed, 14 Dec 2016 00:23:11 +0000 (16:23 -0800)] 
Merge branch 'lr/doc-fix-cet' into next

* lr/doc-fix-cet:
  date-formats.txt: Typo fix

7 years agoMerge branch 'jk/xdiff-drop-xdl-fast-hash' into next
Junio C Hamano [Wed, 14 Dec 2016 00:23:10 +0000 (16:23 -0800)] 
Merge branch 'jk/xdiff-drop-xdl-fast-hash' into next

Retire the "fast hash" that had disastrous performance issues in
some corner cases.

* jk/xdiff-drop-xdl-fast-hash:
  xdiff: drop XDL_FAST_HASH

7 years agoMerge branch 'vs/submodule-clone-nested-submodules-alternates' into next
Junio C Hamano [Wed, 14 Dec 2016 00:23:10 +0000 (16:23 -0800)] 
Merge branch 'vs/submodule-clone-nested-submodules-alternates' into next

"git clone --reference $there --recurse-submodules $super" has been
taught to guess repositories usable as references for submodules of
$super that are embedded in $there while making a clone of the
superproject borrow objects from $there; extend the mechanism to
also allow submodules of these submodules to borrow repositories
embedded in these clones of the submodules embedded in the clone of
the superproject.

* vs/submodule-clone-nested-submodules-alternates:
  submodule--helper: set alternateLocation for cloned submodules

7 years agoupdate_unicode.sh: pin the uniset repo to a known good commit
Beat Bolli [Tue, 13 Dec 2016 23:31:41 +0000 (00:31 +0100)] 
update_unicode.sh: pin the uniset repo to a known good commit

The uniset upstream has added more commits that for example change the
hexadecimal output in '--32' mode to decimal. Let's pin the repo to a
commit that still outputs the width tables in the format we want.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoupdate_unicode.sh: remove an unnecessary subshell level
Beat Bolli [Tue, 13 Dec 2016 23:31:40 +0000 (00:31 +0100)] 
update_unicode.sh: remove an unnecessary subshell level

After the move into contrib/update-unicode, we no longer create the
unicode directory to have a clean working folder. Instead, the directory
of the script is used. This means that the subshell can be removed.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoupdate_unicode.sh: move it into contrib/update-unicode
Beat Bolli [Tue, 13 Dec 2016 23:31:39 +0000 (00:31 +0100)] 
update_unicode.sh: move it into contrib/update-unicode

As it's used only by a tiny minority of the Git developer population,
this script does not belong into the main Git source directory.

Move it into contrib/ and adjust the paths to account for the new
location.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'da/mergetool-xxdiff-hotkey' into next
Junio C Hamano [Wed, 14 Dec 2016 00:09:40 +0000 (16:09 -0800)] 
Merge branch 'da/mergetool-xxdiff-hotkey' into next

The way to specify hotkeys to "xxdiff" that is used by "git
mergetool" has been modernized to match recent versions of xxdiff.

* da/mergetool-xxdiff-hotkey:
  mergetools: fix xxdiff hotkeys

7 years agoMerge branch 'kh/tutorial-grammofix' into next
Junio C Hamano [Wed, 14 Dec 2016 00:09:39 +0000 (16:09 -0800)] 
Merge branch 'kh/tutorial-grammofix' into next

* kh/tutorial-grammofix:
  doc: omit needless "for"
  doc: make the intent of sentence clearer
  doc: add verb in front of command to run
  doc: add articles (grammar)

7 years agoMerge branch 'nd/shallow-fixup' into next
Junio C Hamano [Wed, 14 Dec 2016 00:09:39 +0000 (16:09 -0800)] 
Merge branch 'nd/shallow-fixup' into next

Code cleanup in shallow boundary computation.

* nd/shallow-fixup:
  shallow.c: remove useless code
  shallow.c: bit manipulation tweaks
  shallow.c: avoid theoretical pointer wrap-around
  shallow.c: make paint_alloc slightly more robust
  shallow.c: stop abusing COMMIT_SLAB_SIZE for paint_info's memory pools
  shallow.c: rename fields in paint_info to better express their purposes

7 years agoMerge branch 'sb/sequencer-abort-safety' into next
Junio C Hamano [Wed, 14 Dec 2016 00:09:39 +0000 (16:09 -0800)] 
Merge branch 'sb/sequencer-abort-safety' into next

Unlike "git am --abort", "git cherry-pick --abort" moved HEAD back
to where cherry-pick started while picking multiple changes, when
the cherry-pick stopped to ask for help from the user, and the user
did "git reset --hard" to a different commit in order to re-attempt
the operation.

* sb/sequencer-abort-safety:
  sequencer: remove useless get_dir() function
  sequencer: make sequencer abort safer
  t3510: test that cherry-pick --abort does not unsafely change HEAD
  am: change safe_to_abort()'s not rewinding error into a warning
  am: fix filename in safe_to_abort() error message

7 years agoMerge branch 'jc/lock-report-on-error' into next
Junio C Hamano [Wed, 14 Dec 2016 00:09:38 +0000 (16:09 -0800)] 
Merge branch 'jc/lock-report-on-error' into next

Git 2.11 had a minor regression in "merge --ff-only" that competed
with another process that simultanously attempted to update the
index. We used to explain what went wrong with an error message,
but the new code silently failed.  This resurrects the error
message.

* jc/lock-report-on-error:
  lockfile: LOCK_REPORT_ON_ERROR
  hold_locked_index(): align error handling with hold_lockfile_for_update()
  wt-status: implement opportunisitc index update correctly

7 years agogit-p4: support git worktrees
Luke Diamand [Tue, 13 Dec 2016 21:51:28 +0000 (21:51 +0000)] 
git-p4: support git worktrees

git-p4 would attempt to find the git directory using
its own specific code, which did not know about git
worktrees.

Rework it to use "git rev-parse --git-dir" instead.

Add test cases for worktree usage and specifying
git directory via --git-dir and $GIT_DIR.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoEarly fixes for 2.11.x series
Junio C Hamano [Tue, 13 Dec 2016 22:13:17 +0000 (14:13 -0800)] 
Early fixes for 2.11.x series

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'ew/svn-fixes'
Junio C Hamano [Tue, 13 Dec 2016 22:09:27 +0000 (14:09 -0800)] 
Merge branch 'ew/svn-fixes'

* ew/svn-fixes:
  git-svn: document useLogAuthor and addAuthorFrom config keys
  git-svn: allow "0" in SVN path components

7 years agoMerge branch 'js/mingw-isatty'
Junio C Hamano [Tue, 13 Dec 2016 22:09:27 +0000 (14:09 -0800)] 
Merge branch 'js/mingw-isatty'

We often decide if a session is interactive by checking if the
standard I/O streams are connected to a TTY, but isatty() emulation
on Windows incorrectly returned true if it is used on NUL (i.e. an
equivalent to /dev/null). This has been fixed.

* js/mingw-isatty:
  mingw: intercept isatty() to handle /dev/null as Git expects it

7 years agot5547-push-quarantine: run the path separator test on Windows, too
Johannes Sixt [Tue, 13 Dec 2016 19:09:31 +0000 (20:09 +0100)] 
t5547-push-quarantine: run the path separator test on Windows, too

To perform the test case on Windows in a way that corresponds to the
POSIX version, inject the semicolon in a directory name.

Typically, an absolute POSIX style path, such as the one in $PWD, is
translated into a Windows style path by bash when it invokes git.exe.
However, the presence of the semicolon suppresses this translation;
but the untranslated POSIX style path is useless for git.exe.
Therefore, instead of $PWD pass the Windows style path that $(pwd)
produces.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agot3600: slightly modernize style
Stefan Beller [Mon, 12 Dec 2016 23:54:55 +0000 (15:54 -0800)] 
t3600: slightly modernize style

Remove the space between redirection and file name.
Also remove unnecessary invocations of subshells, such as

(cd submod &&
echo X >untracked
) &&

as there is no point of having the shell for functional purposes.
In case of a single Git command use the `-C` option to let Git cd into
the directory.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoreal_path: have callers use real_pathdup and strbuf_realpath
Brandon Williams [Mon, 12 Dec 2016 18:16:55 +0000 (10:16 -0800)] 
real_path: have callers use real_pathdup and strbuf_realpath

Migrate callers of real_path() who duplicate the retern value to use
real_pathdup or strbuf_realpath.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoreal_path: create real_pathdup
Brandon Williams [Mon, 12 Dec 2016 18:16:54 +0000 (10:16 -0800)] 
real_path: create real_pathdup

Create real_pathdup which returns a caller owned string of the resolved
realpath based on the provide path.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoreal_path: convert real_path_internal to strbuf_realpath
Brandon Williams [Mon, 12 Dec 2016 18:16:53 +0000 (10:16 -0800)] 
real_path: convert real_path_internal to strbuf_realpath

Change the name of real_path_internal to strbuf_realpath.  In addition
push the static strbuf up to its callers and instead take as a
parameter a pointer to a strbuf to use for the final result.

This change makes strbuf_realpath reentrant.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoreal_path: resolve symlinks by hand
Brandon Williams [Mon, 12 Dec 2016 18:16:52 +0000 (10:16 -0800)] 
real_path: resolve symlinks by hand

The current implementation of real_path uses chdir() in order to resolve
symlinks.  Unfortunately this isn't thread-safe as chdir() affects a
process as a whole and not just an individual thread.  Instead perform
the symlink resolution by hand so that the calls to chdir() can be
removed, making real_path one step closer to being reentrant.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agosubmodule: add absorb-git-dir function
Stefan Beller [Mon, 12 Dec 2016 19:04:35 +0000 (11:04 -0800)] 
submodule: add absorb-git-dir function

When a submodule has its git dir inside the working dir, the submodule
support for checkout that we plan to add in a later patch will fail.

Add functionality to migrate the git directory to be absorbed
into the superprojects git directory.

The newly added code in this patch is structured such that other areas of
Git can also make use of it. The code in the submodule--helper is a mere
wrapper and option parser for the function
`absorb_git_dir_into_superproject`, that takes care of embedding the
submodules git directory into the superprojects git dir. That function
makes use of the more abstract function for this use case
`relocate_gitdir`, which can be used by e.g. the worktree code eventually
to move around a git directory.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agomove connect_work_tree_and_git_dir to dir.h
Stefan Beller [Mon, 12 Dec 2016 19:04:34 +0000 (11:04 -0800)] 
move connect_work_tree_and_git_dir to dir.h

That function was primarily used by submodule code, but the function
itself is not inherently about submodules. In the next patch we'll
introduce relocate_git_dir, which can be used by worktrees as well,
so find a neutral middle ground in dir.h.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoworktree: check if a submodule uses worktrees
Stefan Beller [Mon, 12 Dec 2016 19:04:33 +0000 (11:04 -0800)] 
worktree: check if a submodule uses worktrees

In a later patch we want to move around the the git directory of
a submodule. Both submodules as well as worktrees are involved in
placing git directories at unusual places, so their functionality
may collide. To react appropriately to situations where worktrees
in submodules are in use, offer a new function to query the
a submodule if it uses the worktree feature.

An earlier approach:
  "Implement submodule_get_worktrees and just count them", however:
  This can be done cheaply (both in new code to write as well as run time)
  by obtaining the list of worktrees based off that submodules git
  directory. However as we have loaded the variables for the current
  repository, the values in the submodule worktree
  can be wrong, e.g.
  * core.ignorecase may differ between these two repositories
  * the ref resolution is broken (refs/heads/branch in the submodule
    resolves to the sha1 value of the `branch` in the current repository
    that may not exist or have another sha1)

The implementation here is just checking for any files in
$GIT_COMMON_DIR/worktrees for the submodule, which ought to be sufficient
if the submodule is using the current repository format, which we also
check.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agotmp-objdir: quote paths we add to alternates
Jeff King [Mon, 12 Dec 2016 19:53:55 +0000 (14:53 -0500)] 
tmp-objdir: quote paths we add to alternates

Commit 722ff7f87 (receive-pack: quarantine objects until
pre-receive accepts, 2016-10-03) regressed pushes to
repositories with colon (or semi-colon in Windows in them)
because it adds the repository's main object directory to
GIT_ALTERNATE_OBJECT_DIRECTORIES. The receiver interprets
the colon as a delimiter, not as part of the path, and
index-pack is unable to find objects which it needs to
resolve deltas.

The previous commit introduced a quoting mechanism for the
alternates list; let's use it here to cover this case. We'll
avoid quoting when we can, though. This alternate setup is
also used when calling hooks, so it's possible that the user
may call older git implementations which don't understand
the quoting mechanism. By quoting only when necessary, this
setup will continue to work unless the user _also_ has a
repository whose path contains the delimiter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoalternates: accept double-quoted paths
Jeff King [Mon, 12 Dec 2016 19:52:22 +0000 (14:52 -0500)] 
alternates: accept double-quoted paths

We read lists of alternates from objects/info/alternates
files (delimited by newline), as well as from the
GIT_ALTERNATE_OBJECT_DIRECTORIES environment variable
(delimited by colon or semi-colon, depending on the
platform).

There's no mechanism for quoting the delimiters, so it's
impossible to specify an alternate path that contains a
colon in the environment, or one that contains a newline in
a file. We've lived with that restriction for ages because
both alternates and filenames with colons are relatively
rare, and it's only a problem when the two meet. But since
722ff7f87 (receive-pack: quarantine objects until
pre-receive accepts, 2016-10-03), which builds on the
alternates system, every push causes the receiver to set
GIT_ALTERNATE_OBJECT_DIRECTORIES internally.

It would be convenient to have some way to quote the
delimiter so that we can represent arbitrary paths.

The simplest thing would be an escape character before a
quoted delimiter (e.g., "\:" as a literal colon). But that
creates a backwards compatibility problem: any path which
uses that escape character is now broken, and we've just
shifted the problem. We could choose an unlikely escape
character (e.g., something from the non-printable ASCII
range), but that's awkward to use.

Instead, let's treat names as unquoted unless they begin
with a double-quote, in which case they are interpreted via
our usual C-stylke quoting rules. This also breaks
backwards-compatibility, but in a smaller way: it only
matters if your file has a double-quote as the very _first_
character in the path (whereas an escape character is a
problem anywhere in the path).  It's also consistent with
many other parts of git, which accept either a bare pathname
or a double-quoted one, and the sender can choose to quote
or not as required.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'jk/alt-odb-cleanup' into jk/quote-env-path-list-component
Junio C Hamano [Mon, 12 Dec 2016 23:09:57 +0000 (15:09 -0800)] 
Merge branch 'jk/alt-odb-cleanup' into jk/quote-env-path-list-component

* jk/alt-odb-cleanup:
  alternates: re-allow relative paths from environment

7 years agodate-formats.txt: Typo fix
Luis Ressel [Mon, 12 Dec 2016 16:45:02 +0000 (17:45 +0100)] 
date-formats.txt: Typo fix

Last time I checked, I was living in the UTC+01:00 time zone. UTC+02:00
would be Central European _Summer_ Time.

Signed-off-by: Luis Ressel <aranea@aixah.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 years agoMerge branch 'ew/svn-fixes' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:22 +0000 (10:57 -0800)] 
Merge branch 'ew/svn-fixes' into next

* ew/svn-fixes:
  git-svn: document useLogAuthor and addAuthorFrom config keys
  git-svn: allow "0" in SVN path components

7 years agoMerge branch 'js/mingw-isatty' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:22 +0000 (10:57 -0800)] 
Merge branch 'js/mingw-isatty' into next

We often decide if a session is interactive by checking if the
standard I/O streams are connected to a TTY, but isatty() emulation
on Windows incorrectly returned true if it is used on NUL (i.e. an
equivalent to /dev/null). This has been fixed.

* js/mingw-isatty:
  mingw: intercept isatty() to handle /dev/null as Git expects it

7 years agoMerge branch 'rj/git-version-gen-do-not-force-abbrev' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:21 +0000 (10:57 -0800)] 
Merge branch 'rj/git-version-gen-do-not-force-abbrev' into next

A minor build update.

* rj/git-version-gen-do-not-force-abbrev:
  GIT-VERSION-GEN: do not force abbreviation length used by 'describe'

7 years agoMerge branch 'ls/filter-process' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:21 +0000 (10:57 -0800)] 
Merge branch 'ls/filter-process' into next

Doc update.

* ls/filter-process:
  docs: warn about possible '=' in clean/smudge filter process values

7 years agoMerge branch 'jk/stash-disable-renames-internally' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:21 +0000 (10:57 -0800)] 
Merge branch 'jk/stash-disable-renames-internally' into next

When diff.renames configuration is on (and with Git 2.9 and later,
it is enabled by default, which made it worse), "git stash"
misbehaved if a file is removed and another file with a very
similar content is added.

* jk/stash-disable-renames-internally:
  stash: prefer plumbing over git-diff

7 years agoMerge branch 'da/difftool-dir-diff-fix' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:20 +0000 (10:57 -0800)] 
Merge branch 'da/difftool-dir-diff-fix' into next

"git difftool --dir-diff" had a minor regression when started from
a subdirectory, which has been fixed.

* da/difftool-dir-diff-fix:
  difftool: fix dir-diff index creation when in a subdirectory

7 years agoMerge branch 'jk/http-walker-limit-redirect' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:19 +0000 (10:57 -0800)] 
Merge branch 'jk/http-walker-limit-redirect' into next

Update the error messages from the dumb-http client when it fails
to obtain loose objects; we used to give sensible error message
only upon 404 but we now forbid unexpected redirects that needs to
be reported with something sensible.

* jk/http-walker-limit-redirect:
  http-walker: complain about non-404 loose object errors

7 years agoMerge branch 'jk/http-walker-limit-redirect-2.9' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:18 +0000 (10:57 -0800)] 
Merge branch 'jk/http-walker-limit-redirect-2.9' into next

Transport with dumb http can be fooled into following foreign URLs
that the end user does not intend to, especially with the server
side redirects and http-alternates mechanism, which can lead to
security issues.  Tighten the redirection and make it more obvious
to the end user when it happens.

* jk/http-walker-limit-redirect-2.9:
  http: treat http-alternates like redirects
  http: make redirects more obvious
  remote-curl: rename shadowed options variable
  http: always update the base URL for redirects
  http: simplify update_url_from_redirect

7 years agoMerge branch 'nd/for-each-ref-ignore-case' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:18 +0000 (10:57 -0800)] 
Merge branch 'nd/for-each-ref-ignore-case' into next

"git branch --list" and friends learned "--ignore-case" option to
optionally sort branches and tags case insensitively.

* nd/for-each-ref-ignore-case:
  tag, branch, for-each-ref: add --ignore-case for sorting and filtering

7 years agoMerge branch 'sb/unpack-trees-grammofix' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:17 +0000 (10:57 -0800)] 
Merge branch 'sb/unpack-trees-grammofix' into next

* sb/unpack-trees-grammofix:
  unpack-trees: fix grammar for untracked files in directories

7 years agoMerge branch 'sb/t3600-cleanup' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:17 +0000 (10:57 -0800)] 
Merge branch 'sb/t3600-cleanup' into next

Code cleanup.

* sb/t3600-cleanup:
  t3600: remove useless redirect

7 years agoMerge branch 'ls/travis-update-p4-and-lfs' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:16 +0000 (10:57 -0800)] 
Merge branch 'ls/travis-update-p4-and-lfs' into next

The default Travis-CI configuration specifies newer P4 and GitLFS.

* ls/travis-update-p4-and-lfs:
  travis-ci: update P4 to 16.2 and GitLFS to 1.5.2 in Linux build

7 years agoMerge branch 'ls/t0021-fixup' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:15 +0000 (10:57 -0800)] 
Merge branch 'ls/t0021-fixup' into next

* ls/t0021-fixup:
  t0021: minor filter process test cleanup

7 years agoMerge branch 'ls/p4-retry-thrice' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:15 +0000 (10:57 -0800)] 
Merge branch 'ls/p4-retry-thrice' into next

* ls/p4-retry-thrice:
  git-p4: add config to retry p4 commands; retry 3 times by default

7 years agoMerge branch 'ls/p4-empty-file-on-lfs' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:15 +0000 (10:57 -0800)] 
Merge branch 'ls/p4-empty-file-on-lfs' into next

"git p4" LFS support was broken when LFS stores an empty blob.

* ls/p4-empty-file-on-lfs:
  git-p4: fix empty file processing for large file system backend GitLFS

7 years agoMerge branch 'ld/p4-update-shelve' into next
Junio C Hamano [Mon, 12 Dec 2016 18:57:14 +0000 (10:57 -0800)] 
Merge branch 'ld/p4-update-shelve' into next

* ld/p4-update-shelve:
  git-p4: support updating an existing shelved changelist