gitweb.git
Merge branch 'bc/commit-invalid-utf8'Junio C Hamano Thu, 18 Jul 2013 19:58:19 +0000 (12:58 -0700)

Merge branch 'bc/commit-invalid-utf8'

Logic to auto-detect character encodings in the commit log message
did not reject overlong and invalid UTF-8 characters.

* bc/commit-invalid-utf8:
commit: reject non-characters
commit: reject overlong UTF-8 sequences
commit: reject invalid UTF-8 codepoints

Merge branch 'es/overlapping-range-set'Junio C Hamano Thu, 18 Jul 2013 19:58:17 +0000 (12:58 -0700)

Merge branch 'es/overlapping-range-set'

* es/overlapping-range-set:
range_set: fix coalescing bug when range is a subset of another
t4211: fix broken test when one -L range is subset of another

Merge branch 'jk/maint-clone-shared-no-connectivity... Junio C Hamano Thu, 18 Jul 2013 19:48:28 +0000 (12:48 -0700)

Merge branch 'jk/maint-clone-shared-no-connectivity-validation'

"git clone -s/-l" is a filesystem level copy and does not offer any
protection against source repository being corrupt. While the
connectivity validation checks commits and trees being readable, it
made the otherwise instantaneous local modes of clone much more
expensive, without protecting blob data from bitflips.

* jk/maint-clone-shared-no-connectivity-validation:
clone: drop connectivity check for local clones

Merge branch 'bc/push-match-many-refs'Junio C Hamano Thu, 18 Jul 2013 19:48:25 +0000 (12:48 -0700)

Merge branch 'bc/push-match-many-refs'

Pushing to repositories with many refs employed O(m*n) algorithm
where n is the number of refs on the receiving end.

* bc/push-match-many-refs:
remote.c: avoid O(m*n) behavior in match_push_refs

Merge branch 'rr/rebase-reflog-message-reword'Junio C Hamano Thu, 18 Jul 2013 19:48:20 +0000 (12:48 -0700)

Merge branch 'rr/rebase-reflog-message-reword'

"git rebase [-i]" used to leave just "rebase" as its reflog message
for some operations. This rewords them to be more informative.

* rr/rebase-reflog-message-reword:
rebase -i: use a better reflog message
rebase: use a better reflog message

show-branch: fix description of --date-orderThomas Rast Thu, 18 Jul 2013 12:26:56 +0000 (14:26 +0200)

show-branch: fix description of --date-order

The existing description reads as if it somehow applies a filter.
Change it to explain that it is merely about the ordering.

Message-proposed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply, entry: speak of submodules instead of subprojectsThomas Rast Thu, 18 Jul 2013 12:26:55 +0000 (14:26 +0200)

apply, entry: speak of submodules instead of subprojects

There are only four (with some generous rounding) instances in the
current source code where we speak of "subproject" instead of
"submodule". They are as follows:

* one error message in git-apply and two in entry.c

* the patch format for submodule changes

The latter was introduced in 0478675 (Expose subprojects as special
files to "git diff" machinery, 2007-04-15), apparently before the
terminology was settled. We can of course not change the patch
format.

Let's at least change the error messages to consistently call them
"submodule".

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cygwin: Remove the Win32 l/stat() implementationRamsay Jones Sat, 22 Jun 2013 19:42:47 +0000 (20:42 +0100)

cygwin: Remove the Win32 l/stat() implementation

Commit adbc0b6b ("cygwin: Use native Win32 API for stat", 30-09-2008)
added a Win32 specific implementation of the stat functions. In order
to handle absolute paths, cygwin mount points and symbolic links, this
implementation may fall back on the standard cygwin l/stat() functions.
Also, the choice of cygwin or Win32 functions is made lazily (by the
first call(s) to l/stat) based on the state of some config variables.

Unfortunately, this "schizophrenic stat" implementation has been the
source of many problems ever since. For example, see commits 7faee6b8,
79748439, 452993c2, 085479e7, b8a97333, 924aaf3e, 05bab3ea and 0117c2f0.

In order to avoid further problems, such as the issue raised by the new
reference handling API, remove the Win32 l/stat() implementation.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

do_one_ref(): save and restore value of current_refMichael Haggerty Mon, 15 Jul 2013 15:24:17 +0000 (17:24 +0200)

do_one_ref(): save and restore value of current_ref

If do_one_ref() is called recursively, then the inner call should not
permanently overwrite the value stored in current_ref by the outer
call. Aside from the tiny optimization loss, peel_ref() expects the
value of current_ref not to change across a call to peel_entry(). But
in the presence of replace references that assumption could be
violated by a recursive call to do_one_ref:

do_for_each_entry()
do_one_ref()
builtin/describe.c:get_name()
peel_ref()
peel_entry()
peel_object ()
deref_tag_noverify()
parse_object()
lookup_replace_object()
do_lookup_replace_object()
prepare_replace_object()
do_for_each_ref()
do_for_each_entry()
do_for_each_entry_in_dir()
do_one_ref()

The inner call to do_one_ref() was unconditionally setting current_ref
to NULL when it was done, causing peel_ref() to perform an invalid
memory access.

So change do_one_ref() to save the old value of current_ref before
overwriting it, and restore the old value afterward rather than
setting it to NULL.

Reported-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

.mailmap: combine more (email, name) to individual... Stefan Beller Wed, 17 Jul 2013 20:16:31 +0000 (22:16 +0200)

.mailmap: combine more (email, name) to individual persons

I got more responses from people regarding the .mailmap file.
All added persons gave permission to add them to the .mailmap file.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse_object_buffer: correct freeing the bufferStefan Beller Wed, 17 Jul 2013 22:09:42 +0000 (00:09 +0200)

parse_object_buffer: correct freeing the buffer

If we exit early in the function parse_object_buffer, we did not
write to *eaten_p. Then the calling function parse_object, which looks
like the following with respect to the eaten variable, cannot rely on a
proper value set in eaten, hence the freeing of the buffer depends
on random values in memory.

struct object *parse_object(const unsigned char *sha1)
{
int eaten;
...
obj = parse_object_buffer(sha1, type, size, buffer, &eaten);
if (!eaten)
free(buffer);
}

This change makes sure, the buffer freeing condition is deterministic.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

blame-options.txt: explain that -L <start> and <end... Eric Sunshine Wed, 17 Jul 2013 21:25:32 +0000 (17:25 -0400)

blame-options.txt: explain that -L <start> and <end> are optional

The ability to omit either end of the -L range is a handy but
undocumented shortcut, and is thus not easily discovered. Fix this
shortcoming.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

blame-options.txt: place each -L option variation on... Eric Sunshine Wed, 17 Jul 2013 21:25:31 +0000 (17:25 -0400)

blame-options.txt: place each -L option variation on its own line

Standard practice in Git documentation is for each variation of an
option (such as: -p / --porcelain) to be placed on its own line in the
OPTIONS table. The -L option does not follow suit. It cuddles
"-L <start>,<end>" and "-L :<regex>", separated by a comma. This is
inconsistent and potentially confusing since the comma separating them
is typeset the same as the comma in "<start>,<end>". Fix this by placing
each variation on its own line.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t8001/t8002 (blame): add blame -L :funcname testsEric Sunshine Wed, 17 Jul 2013 21:25:30 +0000 (17:25 -0400)

t8001/t8002 (blame): add blame -L :funcname tests

git-blame inherited "-L :funcname" support when "-L :funcname:file" was
implemented for git-log. Add tests.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t8001/t8002 (blame): add blame -L testsEric Sunshine Wed, 17 Jul 2013 21:25:29 +0000 (17:25 -0400)

t8001/t8002 (blame): add blame -L tests

With the exception of a couple "corner case" checks in t8003 (and some
indirect tests in t4211 of -L parsing code shared by log -L), there is
no systematic checking of blame -L. Add tests to check blame -L
directly.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t8001/t8002 (blame): modernize styleEric Sunshine Wed, 17 Jul 2013 21:25:28 +0000 (17:25 -0400)

t8001/t8002 (blame): modernize style

In particular,

- indent with tabs
- cuddle test description and opening body quote with test_expect_foo
- normalize test descriptions and case
- remove whitepsace following redirection operator
- use standardized filenames (such as "actual", "expected")

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

line-range: fix "blame -L X,-N" regressionEric Sunshine Wed, 17 Jul 2013 21:25:27 +0000 (17:25 -0400)

line-range: fix "blame -L X,-N" regression

"blame -L X,-N" is documented as blaming "N lines ending at X". In
practice, the behavior is achieved by swapping the two range endpoints
if the second is less than the first. 25ed3412 (Refactor parse_loc;
2013-03-28) broke this interpretation by removing the swapping code from
blame.c and failing to add it to line-range.c along with other code
relocated from blame.c. Thus, such a range is effectively treated as
empty. Fix this regression.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

.mailmap: René Scharfe has a new email addressRené Scharfe Wed, 17 Jul 2013 19:54:25 +0000 (21:54 +0200)

.mailmap: René Scharfe has a new email address

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

show-ref: make --head always show the HEAD refDoug Bell Wed, 17 Jul 2013 00:05:14 +0000 (19:05 -0500)

show-ref: make --head always show the HEAD ref

The docs seem to say that doing

git show-ref --head --tags

would show both the HEAD ref and all the tag refs. However, doing
both --head and either of --tags or --heads would filter out the HEAD
ref.

Also update the documentation to describe the new behavior and add
tests for the show-ref command.

[jc: Doug did proofread the tests, but it was done by me and bugs in
it are mine].

Signed-off-by: Doug Bell <madcityzen@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-log.txt: capitalize section namesMatthieu Moy Tue, 16 Jul 2013 08:05:40 +0000 (10:05 +0200)

Documentation/git-log.txt: capitalize section names

This is the convention in most other files and even at the beginning of
git-log.txt

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: move description of -s, --no-patch to... Matthieu Moy Tue, 16 Jul 2013 08:05:39 +0000 (10:05 +0200)

Documentation: move description of -s, --no-patch to diff-options.txt

Technically, "-s, --no-patch" is implemented in diff.c ("git diff
--no-patch" is essentially useless, but valid). From the user point of
view, this allows the documentation to show up in "git show --help",
which is one of the most useful use of the option.

While we're there, add a sentence explaining why the option can be
useful.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-show.txt: include common diff options... Matthieu Moy Tue, 16 Jul 2013 08:05:38 +0000 (10:05 +0200)

Documentation/git-show.txt: include common diff options, like git-log.txt

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: allow --patch & cie to override -s/--no-patchMatthieu Moy Tue, 16 Jul 2013 08:05:37 +0000 (10:05 +0200)

diff: allow --patch & cie to override -s/--no-patch

All options that trigger a patch output now override --no-patch.

The case of --binary deserves extra attention: the name may suggest that
it turns a normal patch into a binary patch, but it actually already
enables patch output when normally disabled (e.g. "git log --binary"
displays a patch), hence it makes sense for "git show --no-patch
--binary" to display the binary patch.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: allow --no-patch as synonym for -sMatthieu Moy Tue, 16 Jul 2013 08:05:36 +0000 (10:05 +0200)

diff: allow --no-patch as synonym for -s

This follows the usual convention of having a --no-foo option to negate
--foo.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4000-diff-format.sh: modernize styleMatthieu Moy Tue, 16 Jul 2013 08:05:35 +0000 (10:05 +0200)

t4000-diff-format.sh: modernize style

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: allow lowercase letter to specify what change... Junio C Hamano Wed, 17 Jul 2013 23:19:19 +0000 (16:19 -0700)

diff: allow lowercase letter to specify what change class to exclude

In order to express "we do not care about deletions", we had to say
"--diff-filter=ACMRTXUB", giving all the possible change class
except for the one we do not want, "D".

This is cumbersome. As all the change classes are in uppercase,
allow their lowercase counterpart to selectively exclude the class
from the output. When such a negated change class is in the input,
start the filter option with the full bits set.

This would allow us to express the old "show-diff -q" with
"git diff-files --diff-filter=d".

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

diff: reject unknown change class given to --diff-filterJunio C Hamano Wed, 17 Jul 2013 22:27:19 +0000 (15:27 -0700)

diff: reject unknown change class given to --diff-filter

We used to accept "git diff --diff-filter=Q" (note that there is no
such change class 'Q') silently and showed no output (because there
is no such change class 'Q').

Error out when such an input is given.

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

diff: preparse --diff-filter string argumentJunio C Hamano Wed, 17 Jul 2013 22:05:46 +0000 (15:05 -0700)

diff: preparse --diff-filter string argument

Instead of running strchr() on the list of status characters over
and over again, parse the --diff-filter option into bitfields and
use the bits to see if the change to the filepair matches the status
requested.

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

diff: factor out match_filter()Junio C Hamano Wed, 17 Jul 2013 22:09:34 +0000 (15:09 -0700)

diff: factor out match_filter()

diffcore_apply_filter() checks if a filepair matches the filter
given with the "--diff-filter" option for each input filepairs with
a fairly complex expression in two places.

Create a helper function and call it.

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

diff: pass the whole diff_options to diffcore_apply_fil... Junio C Hamano Wed, 17 Jul 2013 21:19:24 +0000 (14:19 -0700)

diff: pass the whole diff_options to diffcore_apply_filter()

The --diff-filter=<arg> option given by the user is kept as a
string, and passed to the underlying diffcore_apply_filter()
function as a string for each resulting path we run number of
strchr() to see if each class of change among ACDMRTXUB is meant to
be given.

Change the function signature to pass the whole diff_options, so
that we can pre-parse this string in the next patch.

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

git-log.txt: fix typesetting of example "git-log -L... Eric Sunshine Tue, 16 Jul 2013 00:10:36 +0000 (20:10 -0400)

git-log.txt: fix typesetting of example "git-log -L" invocation

All surrounding examples are typeset as monospaced text. Follow suit.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Acked-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git: ensure 0/1/2 are open in main()Thomas Rast Tue, 16 Jul 2013 09:27:37 +0000 (11:27 +0200)

git: ensure 0/1/2 are open in main()

Not having an open FD in the 0--2 range can lead to strange results,
for example, a subsequent open() may return 2 (stderr) and then a
die() would clobber this file.

git-daemon and git-shell already guarded against this, but apparently
users also manage to trip over it in other git commands. So we call
sanitize_stdfds() during main git startup.

Since these FDs are inherited, this covers all use of 'git foo ...',
and all internal C commands when called directly. It does not fix
shell/perl commands called directly.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon/shell: refactor redirection of 0/1/2 from /dev... Thomas Rast Tue, 16 Jul 2013 09:27:36 +0000 (11:27 +0200)

daemon/shell: refactor redirection of 0/1/2 from /dev/null

Both daemon.c and shell.c contain logic to open FDs 0/1/2 from
/dev/null if they are not already open. Move the function in daemon.c
to setup.c and use it in shell.c, too.

While there, remove a 'not' that inverted the meaning of the comment.
The point is indeed to *avoid* messing up.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6131 - skip tests if on case-insensitive file systemMark Levedahl Wed, 17 Jul 2013 13:22:16 +0000 (09:22 -0400)

t6131 - skip tests if on case-insensitive file system

This test fails on Cygwin where the default system configuration does not
support case sensitivity (only case retention), so don't run the test on
such systems.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

request-pull: improve error message for invalid revisio... Dirk Wallenstein Wed, 17 Jul 2013 17:28:11 +0000 (19:28 +0200)

request-pull: improve error message for invalid revision args

Currently, when an invalid revision is specified, the error message is:

fatal: Needed a single revision

This is misleading because, you might think there is something wrong
with the command line as a whole.

Now the user gets a more meaningful error message, showing the invalid
revision.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-multimail: an improved replacement for post-receive... Michael Haggerty Sun, 14 Jul 2013 08:09:02 +0000 (10:09 +0200)

git-multimail: an improved replacement for post-receive-email

Add git-multimail, a tool for generating notification emails for
pushes to a Git repository. It is largely plug-in compatible with
post-receive-email, and is proposed to eventually replace that script.
The advantages of git-multimail relative to post-receive-email are
described in README.migrate-from-post-receive-email.

git-multimail is organized in a directory contrib/hooks/multimail.
The directory contains:

* git_multimail.py -- a Python module that can generate notification
emails for pushes to a Git repository. The file can be used
directly as a post-receive script (configured via git config
settings), or it can be imported as a Python module and configured
via arbitrary Python code.

* README -- user-level documentation for configuring and using
git-multimail.

* post-receive -- an example of building a post-receive script that
imports git_multimail.py as a Python module, with an example of how
to change the email templates.

* README.migrate-from-post-receive-email -- documentation targeted at
current users of post-receive-email, explaining the differences and
how to migrate a post-receive-email configuration to git-multimail.

* migrate-mailhook-config -- a script that can migrate a user's
post-receive-email configuration options to the equivalent
git-multimail options.

* README.Git -- a short explanation of the relationship between
git-multimail and the rest of the Git project, plus the exact date
and revision when this version was taken from the upstream project.

All but the last file are taken verbatim from the upstream
git-multimail project.

git-multimail is originally derived from post-receive-email and also
incorporates suggestions from the mailing list as well as patches by
the people listed below.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Contributions-by: Ramkumar Ramachandra <artagnon@gmail.com>
Contributions-by: Chris Hiestand <chrishiestand@gmail.com>
Contributions-by: Michiel Holtkamp <git@elfstone.nl>
Contributions-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse_pathspec: accept :(icase)path syntaxNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:09 +0000 (15:36 +0700)

parse_pathspec: accept :(icase)path syntax

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

pathspec: support :(glob) syntaxNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:08 +0000 (15:36 +0700)

pathspec: support :(glob) syntax

:(glob)path differs from plain pathspec that it uses wildmatch with
WM_PATHNAME while the other uses fnmatch without FNM_PATHNAME. The
difference lies in how '*' (and '**') is processed.

With the introduction of :(glob) and :(literal) and their global
options --[no]glob-pathspecs, the user can:

- make everything literal by default via --noglob-pathspecs
--literal-pathspecs cannot be used for this purpose as it
disables _all_ pathspec magic.

- individually turn on globbing with :(glob)

- make everything globbing by default via --glob-pathspecs

- individually turn off globbing with :(literal)

The implication behind this is, there is no way to gain the default
matching behavior (i.e. fnmatch without FNM_PATHNAME). You either get
new globbing or literal. The old fnmatch behavior is considered
deprecated and discouraged to use.

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

pathspec: make --literal-pathspecs disable pathspec... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:07 +0000 (15:36 +0700)

pathspec: make --literal-pathspecs disable pathspec magic

--literal-pathspecs and its equivalent environment variable are
probably used for scripting. In that setting, pathspec magic may be
unwanted. Disabling globbing in individual pathspec can be done via
:(literal) magic.

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

pathspec: support :(literal) syntax for noglob pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:06 +0000 (15:36 +0700)

pathspec: support :(literal) syntax for noglob pathspec

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

kill limit_pathspec_to_literal() as it's only used... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:05 +0000 (15:36 +0700)

kill limit_pathspec_to_literal() as it's only used by parse_pathspec()

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

parse_pathspec: preserve prefix length via PATHSPEC_PRE... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:04 +0000 (15:36 +0700)

parse_pathspec: preserve prefix length via PATHSPEC_PREFIX_ORIGIN

The prefix length is passed from one command to another via the new
magic 'prefix'. The magic is for parse_pathspec's internal use only,
not visible to parse_pathspec's callers.

Prefix length is not preserved across commands when --literal-pathspecs
is specified (no magic is allowed, including 'prefix'). That's OK
because we know all paths are literal. No magic, no special treatment
regarding prefix. (This may be no longer true if we make :(glob)
default)

Other options to preserve the prefix include saving it to env variable
or quoting. Env var way (at least _one_ env var) is not suitable
because the prefix is not the same for all pathspecs. Pathspecs
starting with "../" will eat into the prefix part.

We could also preserve 'prefix' across commands by quoting the prefix
part, then dequoting on receiving. But it may not be 100% accurate, we
may dequote longer than the original prefix part, for example. That
may be good or not, but it's not the purpose.

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

parse_pathspec: make sure the prefix part is wildcard... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:03 +0000 (15:36 +0700)

parse_pathspec: make sure the prefix part is wildcard-free

Prepending prefix to pathspec is a trick to workaround the fact that
commands can be executed in a subdirectory, but all git commands run
at worktree's root. The prefix part should always be treated as
literal string. Make it so.

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

rename field "raw" to "_raw" in struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:02 +0000 (15:36 +0700)

rename field "raw" to "_raw" in struct pathspec

This patch is essentially no-op. It helps catching new use of this
field though. This field is introduced as an intermediate step for the
pathspec conversion and will be removed eventually. At this stage no
more access sites should be introduced.

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

tree-diff: remove the use of pathspec's raw[] in follow... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:01 +0000 (15:36 +0700)

tree-diff: remove the use of pathspec's raw[] in follow-rename codepath

Put a checkpoint to guard unsupported pathspec features in future.

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

remove match_pathspec() in favor of match_pathspec_depth()Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:36:00 +0000 (15:36 +0700)

remove match_pathspec() in favor of match_pathspec_depth()

match_pathspec_depth was created to replace match_pathspec (see
61cf282 (pathspec: add match_pathspec_depth() - 2010-12-15). It took
more than two years, but the replacement finally happens :-)

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

remove init_pathspec() in favor of parse_pathspec()Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:59 +0000 (15:35 +0700)

remove init_pathspec() in favor of parse_pathspec()

While at there, move free_pathspec() to pathspec.c

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

remove diff_tree_{setup,release}_pathsNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:58 +0000 (15:35 +0700)

remove diff_tree_{setup,release}_paths

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

convert common_prefix() to use struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:57 +0000 (15:35 +0700)

convert common_prefix() to use struct pathspec

The code now takes advantage of nowildcard_len field.

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

convert add_files_to_cache to take struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:56 +0000 (15:35 +0700)

convert add_files_to_cache to take struct pathspec

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

convert {read,fill}_directory to take struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:55 +0000 (15:35 +0700)

convert {read,fill}_directory to take struct pathspec

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

convert refresh_index to take struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:54 +0000 (15:35 +0700)

convert refresh_index to take struct pathspec

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

convert report_path_error to take struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:53 +0000 (15:35 +0700)

convert report_path_error to take struct pathspec

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

checkout: convert read_tree_some to take struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:52 +0000 (15:35 +0700)

checkout: convert read_tree_some to take struct pathspec

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

convert unmerge_cache to take struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:51 +0000 (15:35 +0700)

convert unmerge_cache to take struct pathspec

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

convert run_add_interactive to use struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:50 +0000 (15:35 +0700)

convert run_add_interactive to use struct pathspec

This passes the pathspec, more or less unmodified, to
git-add--interactive. The command itself does not process pathspec. It
simply passes the pathspec to other builtin commands. So if all those
commands support pathspec, we're good.

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

convert read_cache_preload() to take struct pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:49 +0000 (15:35 +0700)

convert read_cache_preload() to take struct pathspec

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

line-log: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:48 +0000 (15:35 +0700)

line-log: convert to use parse_pathspec

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

reset: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:47 +0000 (15:35 +0700)

reset: convert to use parse_pathspec

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

add: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:46 +0000 (15:35 +0700)

add: convert to use parse_pathspec

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

check-ignore: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:45 +0000 (15:35 +0700)

check-ignore: convert to use parse_pathspec

check-ignore (at least the test suite) seems to rely on the pattern
order. PATHSPEC_KEEP_ORDER is introduced to explictly express this.
The lack of PATHSPEC_MAXDEPTH_VALID is sufficient because it's the
only flag that reorders pathspecs, but it's less obvious that way.

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

archive: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:44 +0000 (15:35 +0700)

archive: convert to use parse_pathspec

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

ls-files: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:43 +0000 (15:35 +0700)

ls-files: convert to use parse_pathspec

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

rm: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:42 +0000 (15:35 +0700)

rm: convert to use parse_pathspec

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

checkout: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:41 +0000 (15:35 +0700)

checkout: convert to use parse_pathspec

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

rerere: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:40 +0000 (15:35 +0700)

rerere: convert to use parse_pathspec

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

status: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:39 +0000 (15:35 +0700)

status: convert to use parse_pathspec

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

commit: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:38 +0000 (15:35 +0700)

commit: convert to use parse_pathspec

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

clean: convert to use parse_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:37 +0000 (15:35 +0700)

clean: convert to use parse_pathspec

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

guard against new pathspec magic in pathspec matching... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:36 +0000 (15:35 +0700)

guard against new pathspec magic in pathspec matching code

GUARD_PATHSPEC() marks pathspec-sensitive code, basically all those
that touch anything in 'struct pathspec' except fields "nr" and
"original". GUARD_PATHSPEC() is not supposed to fail. It's mainly to
help the designers catch unsupported codepaths.

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

parse_pathspec: support prefixing original patternsNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:35 +0000 (15:35 +0700)

parse_pathspec: support prefixing original patterns

This makes 'original' suitable for passing to an external command
because all pathspec magic is left in place, provided that the
external command understands pathspec. The prefixing is needed because
we usually launch a subcommand at worktree's top directory and the
subcommand can no longer calculate the prefix itself.

This slightly affects the original purpose of 'original'
(i.e. reporting). We should report without prefixing. So only turn
this flag on when you know you are about to pass the result straight
away to an external command.

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

parse_pathspec: support stripping/checking submodule... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:34 +0000 (15:35 +0700)

parse_pathspec: support stripping/checking submodule paths

PATHSPEC_SYMLINK_LEADING_PATH and _STRIP_SUBMODULE_SLASH_EXPENSIVE are
respectively the alternate implementation of
pathspec.c:die_if_path_beyond_symlink() and
pathspec.c:check_path_for_gitlink(). They are intended to replace
those functions when builtin/add.c and builtin/check-ignore.c are
converted to use parse_pathspec.

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

parse_pathspec: support stripping submodule trailing... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:33 +0000 (15:35 +0700)

parse_pathspec: support stripping submodule trailing slashes

This flag is equivalent to builtin/ls-files.c:strip_trailing_slashes()
and is intended to replace that function when ls-files is converted to
use parse_pathspec.

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

parse_pathspec: add special flag for max_depth featureNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:32 +0000 (15:35 +0700)

parse_pathspec: add special flag for max_depth feature

match_pathspec_depth() and tree_entry_interesting() check max_depth
field in order to support "git grep --max-depth". The feature
activation is tied to "recursive" field, which led to some unwanted
activation, e.g. 5c8eeb8 (diff-index: enable recursive pathspec
matching in unpack_trees - 2012-01-15).

This patch decouples the activation from "recursive" field, puts it in
"magic" field instead. This makes sure that only "git grep" can
activate this feature. And because parse_pathspec knows when the
feature is not used, it does not need to sort pathspec (required for
max_depth to work correctly). A small win for non-grep cases.

Even though a new magic flag is introduced, no magic syntax is. The
magic can be only enabled by parse_pathspec() caller. We might someday
want to support ":(maxdepth:10)src." It all depends on actual use
cases.

max_depth feature cannot be enabled via init_pathspec() anymore. But
that's ok because init_pathspec() is on its way to /dev/null.

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

convert some get_pathspec() calls to parse_pathspec()Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:31 +0000 (15:35 +0700)

convert some get_pathspec() calls to parse_pathspec()

These call sites follow the pattern:

paths = get_pathspec(prefix, argv);
init_pathspec(&pathspec, paths);

which can be converted into a single parse_pathspec() call.

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

parse_pathspec: add PATHSPEC_PREFER_{CWD,FULL} flagsNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:30 +0000 (15:35 +0700)

parse_pathspec: add PATHSPEC_PREFER_{CWD,FULL} flags

We have two ways of dealing with empty pathspec:

1. limit it to current prefix
2. match the entire working directory

Some commands go with #1, some #2. get_pathspec() and parse_pathspec()
only support #1. Make parse_pathspec() reject empty pathspec by
default. #1 and #2 can be specified via new flags. This makes it more
expressive about default behavior at command level.

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

parse_pathspec: save original pathspec for reportingNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:29 +0000 (15:35 +0700)

parse_pathspec: save original pathspec for reporting

We usually use pathspec_item's match field for pathspec error
reporting. However "match" (or "raw") does not show the magic part,
which will play more important role later on. Preserve exact user
input for reporting.

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

add parse_pathspec() that converts cmdline args to... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:28 +0000 (15:35 +0700)

add parse_pathspec() that converts cmdline args to struct pathspec

Currently to fill a struct pathspec, we do:

const char **paths;
paths = get_pathspec(prefix, argv);
...
init_pathspec(&pathspec, paths);

"paths" can only carry bare strings, which loses information from
command line arguments such as pathspec magic or the prefix part's
length for each argument.

parse_pathspec() is introduced to combine the two calls into one. The
plan is gradually replace all get_pathspec() and init_pathspec() with
parse_pathspec(). get_pathspec() now becomes a thin wrapper of
parse_pathspec().

parse_pathspec() allows the caller to reject the pathspec magics that
it does not support. When a new pathspec magic is introduced, we can
enable it per command after making sure that all underlying code has no
problem with the new magic.

"flags" parameter is currently unused. But it would allow callers to
pass certain instructions to parse_pathspec, for example forcing
literal pathspec when no magic is used.

With the introduction of parse_pathspec, there are now two functions
that can initialize struct pathspec: init_pathspec and
parse_pathspec. Any semantic changes in struct pathspec must be
reflected in both functions. init_pathspec() will be phased out in
favor of parse_pathspec().

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

pathspec: add copy_pathspecNguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:27 +0000 (15:35 +0700)

pathspec: add copy_pathspec

Because free_pathspec wants to free "items" pointer in the pathspec
structure, a simple structure assignment is not enough if you want to
copy an existing pathspec into another. Freeing the original will
damage the copy unless a deep copy is made.

Note that the strings in pathspec->items->match and the array
pathspec->raw[] are still shared between the original and the copy.

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

pathspec: i18n-ize error strings in pathspec parsing... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:26 +0000 (15:35 +0700)

pathspec: i18n-ize error strings in pathspec parsing code

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

move struct pathspec and related functions to pathspec... Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:25 +0000 (15:35 +0700)

move struct pathspec and related functions to pathspec.[ch]

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

clean: remove unused variable "seen"Nguyễn Thái Ngọc Duy Sun, 14 Jul 2013 08:35:24 +0000 (15:35 +0700)

clean: remove unused variable "seen"

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

upload-pack: remove a piece of dead codeMatthijs Kooijman Thu, 11 Jul 2013 11:25:52 +0000 (13:25 +0200)

upload-pack: remove a piece of dead code

Commit 682c7d2 (upload-pack: fix off-by-one depth calculation in shallow
clone) introduced a new check in get_shallow_commits to decide when to
stop traversing the history and mark the current commit as a shallow
root.

With this new check in place, the old check can no longer be true, since
the first check always fires first. This commit removes that check,
making the code a bit more simple again.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.8.4Junio C Hamano Mon, 15 Jul 2013 17:33:21 +0000 (10:33 -0700)

Update draft release notes to 1.8.4

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

Sync with 1.8.3.3Junio C Hamano Mon, 15 Jul 2013 17:45:02 +0000 (10:45 -0700)

Sync with 1.8.3.3

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

Git 1.8.3.3 v1.8.3.3Junio C Hamano Mon, 15 Jul 2013 17:39:43 +0000 (10:39 -0700)

Git 1.8.3.3

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

Merge branch 'tr/maint-apply-non-git-patch-parsefix... Junio C Hamano Mon, 15 Jul 2013 17:36:14 +0000 (10:36 -0700)

Merge branch 'tr/maint-apply-non-git-patch-parsefix' into maint

"git apply" parsed patches that add new files, generated by programs
other than Git, incorrectly. This is an old breakage in v1.7.11.

* tr/maint-apply-non-git-patch-parsefix:
apply: carefully strdup a possibly-NULL name

Merge branch 'bc/http-keep-memory-given-to-curl' into... Junio C Hamano Mon, 15 Jul 2013 17:36:01 +0000 (10:36 -0700)

Merge branch 'bc/http-keep-memory-given-to-curl' into maint

Older cURL wanted piece of memory we call it with to be stable, but
we updated the auth material after handing it to a call.

* bc/http-keep-memory-given-to-curl:
http.c: don't rewrite the user:passwd string multiple times

Merge branch 'jk/pull-into-dirty-unborn' into maintJunio C Hamano Mon, 15 Jul 2013 17:35:43 +0000 (10:35 -0700)

Merge branch 'jk/pull-into-dirty-unborn' into maint

"git pull" into nothing trashed "local changes" that were in the
index.

* jk/pull-into-dirty-unborn:
pull: merge into unborn by fast-forwarding from empty tree
pull: update unborn branch tip after index

Merge branch 'fg/submodule-non-ascii-path' into maintJunio C Hamano Mon, 15 Jul 2013 17:35:17 +0000 (10:35 -0700)

Merge branch 'fg/submodule-non-ascii-path' into maint

Many "git submodule" operations did not work on a submodule at a
path whose name is not in ASCII.

* fg/submodule-non-ascii-path:
t7400: test of UTF-8 submodule names pass under Mac OS
handle multibyte characters in name

Merge branch 'fc/sequencer-plug-leak' into maintJunio C Hamano Mon, 15 Jul 2013 17:35:04 +0000 (10:35 -0700)

Merge branch 'fc/sequencer-plug-leak' into maint

"cherry-pick" had a small leak in its error codepath.

* fc/sequencer-plug-leak:
sequencer: avoid leaking message buffer when refusing to create an empty commit
sequencer: remove useless indentation

Merge branch 'mt/send-email-cc-match-fix' into maintJunio C Hamano Mon, 15 Jul 2013 17:34:36 +0000 (10:34 -0700)

Merge branch 'mt/send-email-cc-match-fix' into maint

Logic used by git-send-email to suppress cc mishandled names like "A
U. Thor" <author@example.xz>, where the human readable part needs to
be quoted (the user input may not have the double quotes around the
name, and comparison was done between quoted and unquoted strings).
It also mishandled names that need RFC2047 quoting.

* mt/send-email-cc-match-fix:
send-email: sanitize author when writing From line
send-email: add test for duplicate utf8 name
test-send-email: test for pre-sanitized self name
t/send-email: test suppress-cc=self with non-ascii
t/send-email: add test with quoted sender
send-email: make --suppress-cc=self sanitize input
t/send-email: test suppress-cc=self on cccmd
send-email: fix suppress-cc=self on cccmd
t/send-email.sh: add test for suppress-cc=self

Merge branch 'bc/send-email-use-port-as-separate-param'Junio C Hamano Mon, 15 Jul 2013 17:28:50 +0000 (10:28 -0700)

Merge branch 'bc/send-email-use-port-as-separate-param'

Pass port number as a separate argument when send-email initializes
Net::SMTP, instead of as a part of the hostname, i.e. host:port.
This allows GSSAPI codepath to match with the hostname given.

* bc/send-email-use-port-as-separate-param:
send-email: provide port separately from hostname

Merge branch 'fg/submodule-clone-depth'Junio C Hamano Mon, 15 Jul 2013 17:28:48 +0000 (10:28 -0700)

Merge branch 'fg/submodule-clone-depth'

Allow shallow-cloning of submodules with "git submodule update".

* fg/submodule-clone-depth:
Add --depth to submodule update/add

Merge branch 'cp/submodule-custom-update'Junio C Hamano Mon, 15 Jul 2013 17:28:44 +0000 (10:28 -0700)

Merge branch 'cp/submodule-custom-update'

In addition to the choice from "rebase, merge, or checkout-detach",
allow a custom command to be used in "submodule update" to update
the working tree of submodules.

* cp/submodule-custom-update:
submodule update: allow custom command to update submodule working tree

Merge branch 'jk/format-patch-from'Junio C Hamano Mon, 15 Jul 2013 17:28:39 +0000 (10:28 -0700)

Merge branch 'jk/format-patch-from'

"git format-patch" learned "--from[=whom]" option, which sets the
"From: " header to the specified person (or the person who runs the
command, if "=whom" part is missing) and move the original author
information to an in-body From: header as necessary.

* jk/format-patch-from:
teach format-patch to place other authors into in-body "From"
pretty.c: drop const-ness from pretty_print_context

Merge branch 'mv/merge-ff-tristate'Junio C Hamano Mon, 15 Jul 2013 17:28:34 +0000 (10:28 -0700)

Merge branch 'mv/merge-ff-tristate'

The configuration variable "merge.ff" was cleary a tri-state to
choose one from "favor fast-forward when possible", "always create
a merge even when the history could fast-forward" and "do not
create any merge, only update when the history fast-forwards", but
the command line parser did not implement the usual convention of
"last one wins, and command line overrides the configuration"
correctly.

* mv/merge-ff-tristate:
merge: handle --ff/--no-ff/--ff-only as a tri-state option

Merge branch 'jk/fetch-pack-many-refs'Junio C Hamano Mon, 15 Jul 2013 17:28:31 +0000 (10:28 -0700)

Merge branch 'jk/fetch-pack-many-refs'

Fetching between repositories with many refs employed O(n^2)
algorithm to match up the common objects, which has been corrected.

* jk/fetch-pack-many-refs:
fetch-pack: avoid quadratic behavior in rev_list_push
commit.c: make compare_commits_by_commit_date global
fetch-pack: avoid quadratic list insertion in mark_complete

templates: spell ASCII in uppercase in pre-commit hookRichard Hartmann Sun, 14 Jul 2013 16:21:16 +0000 (18:21 +0200)

templates: spell ASCII in uppercase in pre-commit hook

The name of the encoding is ASCII, not ascii.

Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

templates: Reformat pre-commit hook's messageRichard Hartmann Sun, 14 Jul 2013 16:21:15 +0000 (18:21 +0200)

templates: Reformat pre-commit hook's message

Now that we're using heredoc, the message can span the full 80 chars.

Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>