gitweb.git
Merge branch 'maint'Junio C Hamano Thu, 3 Apr 2014 20:40:31 +0000 (13:40 -0700)

Merge branch 'maint'

* maint:
Start preparing for 1.9.1

Start preparing for 1.9.1Junio C Hamano Thu, 3 Apr 2014 20:37:29 +0000 (13:37 -0700)

Start preparing for 1.9.1

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

Merge branch 'jk/mv-submodules-fix' into maintJunio C Hamano Thu, 3 Apr 2014 20:39:06 +0000 (13:39 -0700)

Merge branch 'jk/mv-submodules-fix' into maint

* jk/mv-submodules-fix:
mv: prevent mismatched data when ignoring errors.
builtin/mv: fix out of bounds write

Conflicts:
t/t7001-mv.sh

Merge branch 'mh/remove-subtree-long-pathname-fix'... Junio C Hamano Thu, 3 Apr 2014 20:39:05 +0000 (13:39 -0700)

Merge branch 'mh/remove-subtree-long-pathname-fix' into maint

* mh/remove-subtree-long-pathname-fix:
entry.c: fix possible buffer overflow in remove_subtree()
checkout_entry(): use the strbuf throughout the function

Merge branch 'jk/lib-terminal-lazy' into maintJunio C Hamano Thu, 3 Apr 2014 20:39:04 +0000 (13:39 -0700)

Merge branch 'jk/lib-terminal-lazy' into maint

* jk/lib-terminal-lazy:
t/lib-terminal: make TTY a lazy prerequisite

Merge branch 'nd/index-pack-error-message' into maintJunio C Hamano Thu, 3 Apr 2014 20:39:04 +0000 (13:39 -0700)

Merge branch 'nd/index-pack-error-message' into maint

* nd/index-pack-error-message:
index-pack: report error using the correct variable

Merge branch 'us/printf-not-echo' into maintJunio C Hamano Thu, 3 Apr 2014 20:39:04 +0000 (13:39 -0700)

Merge branch 'us/printf-not-echo' into maint

* us/printf-not-echo:
test-lib.sh: do not "echo" caller-supplied strings
rebase -i: do not "echo" random user-supplied strings

Merge branch 'rr/doc-merge-strategies' into maintJunio C Hamano Thu, 3 Apr 2014 20:39:03 +0000 (13:39 -0700)

Merge branch 'rr/doc-merge-strategies' into maint

* rr/doc-merge-strategies:
Documentation/merge-strategies: avoid hyphenated commands

Merge branch 'jk/shallow-update-fix' into maintJunio C Hamano Thu, 3 Apr 2014 20:39:03 +0000 (13:39 -0700)

Merge branch 'jk/shallow-update-fix' into maint

* jk/shallow-update-fix:
shallow: verify shallow file after taking lock
shallow: automatically clean up shallow tempfiles
shallow: use stat_validity to check for up-to-date file

Merge branch 'jc/stash-pop-not-popped' into maintJunio C Hamano Thu, 3 Apr 2014 20:39:03 +0000 (13:39 -0700)

Merge branch 'jc/stash-pop-not-popped' into maint

* jc/stash-pop-not-popped:
stash pop: mention we did not drop the stash upon failing to apply

Merge branch 'jn/wt-status' into maintJunio C Hamano Thu, 3 Apr 2014 20:39:02 +0000 (13:39 -0700)

Merge branch 'jn/wt-status' into maint

* jn/wt-status:
wt-status: lift the artificual "at least 20 columns" floor
wt-status: i18n of section labels
wt-status: extract the code to compute width for labels
wt-status: make full label string to be subject to l10n

Merge branch 'nd/gc-aggressive'Junio C Hamano Thu, 3 Apr 2014 19:38:46 +0000 (12:38 -0700)

Merge branch 'nd/gc-aggressive'

Allow tweaking the maximum length of the delta-chain produced by
"gc --aggressive".

* nd/gc-aggressive:
environment.c: fix constness for odb_pack_keep()
gc --aggressive: make --depth configurable

Merge branch 'jc/fix-diff-no-index-diff-opt-parse'Junio C Hamano Thu, 3 Apr 2014 19:38:42 +0000 (12:38 -0700)

Merge branch 'jc/fix-diff-no-index-diff-opt-parse'

"diff --no-index -Mq a b" fell into an infinite loop.

* jc/fix-diff-no-index-diff-opt-parse:
diff-no-index: correctly diagnose error return from diff_opt_parse()

Merge branch 'cb/aix'Junio C Hamano Thu, 3 Apr 2014 19:38:38 +0000 (12:38 -0700)

Merge branch 'cb/aix'

* cb/aix:
tests: don't rely on strerror text when testing rmdir failure
dir.c: make git_fnmatch() not inline

Merge branch 'cn/fetch-prune-overlapping-destination'Junio C Hamano Thu, 3 Apr 2014 19:38:18 +0000 (12:38 -0700)

Merge branch 'cn/fetch-prune-overlapping-destination'

Protect refs in a hierarchy that can come from more than one remote
hierarcies from incorrect removal by "git fetch --prune".

* cn/fetch-prune-overlapping-destination:
fetch: handle overlaping refspecs on --prune
fetch: add a failing test for prunning with overlapping refspecs

Merge branch 'nd/log-show-linear-break'Junio C Hamano Thu, 3 Apr 2014 19:38:11 +0000 (12:38 -0700)

Merge branch 'nd/log-show-linear-break'

Attempts to show where a single-strand-of-pearls break in "git log"
output.

* nd/log-show-linear-break:
log: add --show-linear-break to help see non-linear history
object.h: centralize object flag allocation

Merge branch 'ep/shell-command-substitution'Junio C Hamano Thu, 3 Apr 2014 19:38:04 +0000 (12:38 -0700)

Merge branch 'ep/shell-command-substitution'

* ep/shell-command-substitution:
git-am.sh: use the $(...) construct for command substitution
check-builtins.sh: use the $(...) construct for command substitution

Merge branch 'ap/remote-hg-skip-null-bookmarks'Junio C Hamano Wed, 2 Apr 2014 21:18:23 +0000 (14:18 -0700)

Merge branch 'ap/remote-hg-skip-null-bookmarks'

* ap/remote-hg-skip-null-bookmarks:
remote-hg: do not fail on invalid bookmarks

Merge branch 'rs/pickaxe-i'Junio C Hamano Wed, 2 Apr 2014 21:18:19 +0000 (14:18 -0700)

Merge branch 'rs/pickaxe-i'

Allow the options -i/--regexp-ignore-case, --pickaxe-regex, and -S
to be used together and work as expected to perform a pickaxe
search using case-insensitive regular expression matching.

* rs/pickaxe-i:
pickaxe: simplify kwset loop in contains()
pickaxe: call strlen only when necessary in diffcore_pickaxe_count()
pickaxe: move pickaxe() after pickaxe_match()
pickaxe: merge diffcore_pickaxe_grep() and diffcore_pickaxe_count() into diffcore_pickaxe()
pickaxe: honor -i when used with -S and --pickaxe-regex
t4209: use helper functions to test --author
t4209: use helper functions to test --grep
t4209: factor out helper function test_log_icase()
t4209: factor out helper function test_log()
t4209: set up expectations up front

Revert part of 384364b (Start preparing for Git 2.0... Junio C Hamano Tue, 1 Apr 2014 18:55:56 +0000 (11:55 -0700)

Revert part of 384364b (Start preparing for Git 2.0, 2014-03-07)

As we are not shipping with the submodule change, remove the
entry for it.

Revert "submodule: explicit local branch creation in... Junio C Hamano Wed, 2 Apr 2014 21:15:36 +0000 (14:15 -0700)

Revert "submodule: explicit local branch creation in module_clone"

This reverts commit 23d25e48f5ead73c9ce233986f90791abec9f1e8, as it is
broken for users who haven't opted into the new feature of checking
out submodule.*.branch with update mode set to checkout.

update-ref: fail create operation over stdin if ref... Aman Gupta Wed, 2 Apr 2014 08:09:54 +0000 (10:09 +0200)

update-ref: fail create operation over stdin if ref already exists

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4212: loosen far-in-future test for AIXJeff King Tue, 1 Apr 2014 07:43:06 +0000 (03:43 -0400)

t4212: loosen far-in-future test for AIX

One of the tests in t4212 checks our behavior when we feed
gmtime a date so far in the future that it gives up and
returns NULL. Some implementations, like AIX, may actually
just provide us a bogus result instead.

It's not worth it for us to come up with heuristics that
guess whether the return value is sensible or not. On good
platforms where gmtime reports the problem to us with NULL,
we will print the epoch value. On bad platforms, we will
print garbage. But our test should be written for the
lowest common denominator so that it passes everywhere.

Reported-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

date: recognize bogus FreeBSD gmtime outputJeff King Tue, 1 Apr 2014 21:28:42 +0000 (17:28 -0400)

date: recognize bogus FreeBSD gmtime output

Most gmtime implementations return a NULL value when they
encounter an error (and this behavior is specified by ANSI C
and POSIX). FreeBSD's implementation, however, will simply
leave the "struct tm" untouched. Let's also recognize this
and convert it to a NULL (with this patch, t4212 should pass
on FreeBSD).

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

rev-parse: fix typo in example on manpageRené Scharfe Tue, 1 Apr 2014 19:27:23 +0000 (21:27 +0200)

rev-parse: fix typo in example on manpage

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

Revert "Merge branch 'wt/doc-submodule-name-path-confus... Junio C Hamano Tue, 1 Apr 2014 18:52:37 +0000 (11:52 -0700)

Revert "Merge branch 'wt/doc-submodule-name-path-confusion-2'"

This reverts commit 00d4ff1a69883e24b095f45251d99143b5bc0320, reversing
changes made to d3badc6eb0961382788c2670129d5ee133d079fd.

Update draft release notes to 2.0Junio C Hamano Mon, 31 Mar 2014 23:41:23 +0000 (16:41 -0700)

Update draft release notes to 2.0

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

Merge branch 'mm/status-porcelain-format-i18n-fix'Junio C Hamano Mon, 31 Mar 2014 23:31:25 +0000 (16:31 -0700)

Merge branch 'mm/status-porcelain-format-i18n-fix'

* mm/status-porcelain-format-i18n-fix:
status: disable translation when --porcelain is used

Merge branch 'an/branch-config-message'Junio C Hamano Mon, 31 Mar 2014 23:31:19 +0000 (16:31 -0700)

Merge branch 'an/branch-config-message'

* an/branch-config-message:
branch.c: install_branch_config: simplify if chain

Merge branch 'jk/tests-cleanup'Junio C Hamano Mon, 31 Mar 2014 23:31:17 +0000 (16:31 -0700)

Merge branch 'jk/tests-cleanup'

* jk/tests-cleanup:
t0001: drop subshells just for "cd"
t0001: drop useless subshells
t0001: use test_must_fail
t0001: use test_config_global
t0001: use test_path_is_*
t0001: make symlink reinit test more careful
t: prefer "git config --file" to GIT_CONFIG
t: prefer "git config --file" to GIT_CONFIG with test_must_fail
t: stop using GIT_CONFIG to cross repo boundaries
t: drop useless sane_unset GIT_* calls
t/test-lib: drop redundant unset of GIT_CONFIG
t/Makefile: stop setting GIT_CONFIG

Merge branch 'wt/doc-submodule-name-path-confusion-2'Junio C Hamano Mon, 31 Mar 2014 23:31:16 +0000 (16:31 -0700)

Merge branch 'wt/doc-submodule-name-path-confusion-2'

* wt/doc-submodule-name-path-confusion-2:
doc: submodule.*.branch config is keyed by name

Merge branch 'wt/doc-submodule-name-path-confusion-1'Junio C Hamano Mon, 31 Mar 2014 23:31:13 +0000 (16:31 -0700)

Merge branch 'wt/doc-submodule-name-path-confusion-1'

* wt/doc-submodule-name-path-confusion-1:
doc: submodule.* config are keyed by submodule names

Merge branch 'mr/msvc-link-with-lcurl'Junio C Hamano Mon, 31 Mar 2014 23:31:07 +0000 (16:31 -0700)

Merge branch 'mr/msvc-link-with-lcurl'

* mr/msvc-link-with-lcurl:
MSVC: allow linking with the cURL library

Merge branch 'ib/rev-parse-parseopt-argh'Junio C Hamano Mon, 31 Mar 2014 23:30:59 +0000 (16:30 -0700)

Merge branch 'ib/rev-parse-parseopt-argh'

Teaches the "rev-parse --parseopt" mechanism used by scripted
Porcelains to parse command line options and give help text how to
supply argv-help (the placeholder string for an option parameter,
e.g. "key-id" in "--gpg-sign=<key-id>").

* ib/rev-parse-parseopt-argh:
t1502: protect runs of SPs used in the indentation
rev-parse --parseopt: option argument name hints

Merge branch 'dp/makefile-charset-lib-doc'Junio C Hamano Mon, 31 Mar 2014 23:30:57 +0000 (16:30 -0700)

Merge branch 'dp/makefile-charset-lib-doc'

* dp/makefile-charset-lib-doc:
Makefile: describe CHARSET_LIB better

Merge branch 'js/userdiff-cc'Junio C Hamano Mon, 31 Mar 2014 23:30:54 +0000 (16:30 -0700)

Merge branch 'js/userdiff-cc'

Improves the pattern to match the hunk-header for C/C++.

* js/userdiff-cc:
userdiff: have 'cpp' hunk header pattern catch more C++ anchor points
t4018: test cases showing that the cpp pattern misses many anchor points
t4018: test cases for the built-in cpp pattern
t4018: reduce test files for pattern compilation tests
t4018: convert custom pattern test to the new infrastructure
t4018: convert java pattern test to the new infrastructure
t4018: convert perl pattern tests to the new infrastructure
t4018: an infrastructure to test hunk headers
userdiff: support unsigned and long long suffixes of integer constants
userdiff: support C++ ->* and .* operators in the word regexp

Merge branch 'dw/doc-status-no-longer-shows-pound-prefix'Junio C Hamano Mon, 31 Mar 2014 23:30:52 +0000 (16:30 -0700)

Merge branch 'dw/doc-status-no-longer-shows-pound-prefix'

* dw/doc-status-no-longer-shows-pound-prefix:
doc: status, remove leftover statement about '#' prefix

Merge branch 'ca/doc-config-third-party'Junio C Hamano Mon, 31 Mar 2014 23:30:49 +0000 (16:30 -0700)

Merge branch 'ca/doc-config-third-party'

* ca/doc-config-third-party:
config.txt: third-party tools may and do use their own variables

Merge branch 'hs/simplify-bit-setting-in-fsck-tree'Junio C Hamano Mon, 31 Mar 2014 23:30:44 +0000 (16:30 -0700)

Merge branch 'hs/simplify-bit-setting-in-fsck-tree'

* hs/simplify-bit-setting-in-fsck-tree:
fsck: use bitwise-or assignment operator to set flag

Merge branch 'dt/tests-with-env-not-subshell'Junio C Hamano Mon, 31 Mar 2014 23:30:40 +0000 (16:30 -0700)

Merge branch 'dt/tests-with-env-not-subshell'

* dt/tests-with-env-not-subshell:
tests: use "env" to run commands with temporary env-var settings

code and test: fix misuses of "nor"Justin Lebar Mon, 31 Mar 2014 22:11:47 +0000 (15:11 -0700)

code and test: fix misuses of "nor"

Signed-off-by: Justin Lebar <jlebar@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

comments: fix misuses of "nor"Justin Lebar Mon, 31 Mar 2014 22:11:46 +0000 (15:11 -0700)

comments: fix misuses of "nor"

Signed-off-by: Justin Lebar <jlebar@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib: fix misuses of "nor"Justin Lebar Mon, 31 Mar 2014 22:11:45 +0000 (15:11 -0700)

contrib: fix misuses of "nor"

Signed-off-by: Justin Lebar <jlebar@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: fix misuses of "nor"Justin Lebar Mon, 31 Mar 2014 22:11:44 +0000 (15:11 -0700)

Documentation: fix misuses of "nor"

Signed-off-by: Justin Lebar <jlebar@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse-options: remove unused OPT_SET_PTRMarat Radchenko Sun, 30 Mar 2014 11:08:23 +0000 (15:08 +0400)

parse-options: remove unused OPT_SET_PTR

OPT_SET_PTR was never used since its creation at db7244bd
(parse-options new features., 2007-11-07).

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

parse-options: add cast to correct pointer type to... Junio C Hamano Sun, 30 Mar 2014 02:01:54 +0000 (19:01 -0700)

parse-options: add cast to correct pointer type to OPT_SET_PTR

Do not force users of OPT_SET_PTR to cast pointer to correct
underlying pointer type by integrating cast into OPT_SET_PTR macro.

Cast is required to prevent 'initialization makes integer from pointer
without a cast' compiler warning.

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

MSVC: fix t0040-parse-options crashMarat Radchenko Sun, 30 Mar 2014 11:08:21 +0000 (15:08 +0400)

MSVC: fix t0040-parse-options crash

On 64-bit MSVC, pointers are 64 bit but `long` is only 32.
Thus, casting string to `unsigned long`, which is redundand on other
platforms, throws away important bits and when later cast to `intptr_t`
results in corrupt pointer.

This patch fixes test-parse-options by replacing harming cast with
correct one.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: don't rely on strerror text when testing rmdir... Charles Bailey Sat, 29 Mar 2014 15:39:01 +0000 (15:39 +0000)

tests: don't rely on strerror text when testing rmdir failure

AIX doesn't make a distiction between EEXIST and ENOTEMPTY; relying
on the strerror string for the rmdir failure is fragile. Just test
that the start of the string matches the Git controlled "failed to
rmdir..." error. The exact text of the OS generated error string
isn't important to the test.

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: make git_fnmatch() not inlineCharles Bailey Sat, 29 Mar 2014 15:39:00 +0000 (15:39 +0000)

dir.c: make git_fnmatch() not inline

Now that it calls a static inline function, it cannot be an inline
definition with external linkage. Remove inline and make it an
external definition.

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff-no-index: correctly diagnose error return from... Junio C Hamano Mon, 31 Mar 2014 18:47:17 +0000 (11:47 -0700)

diff-no-index: correctly diagnose error return from diff_opt_parse()

diff_opt_parse() returns the number of options parsed, or often
returns error() which is defined to return -1. Yes, return value of
0 is "I did not process that option at all", which should cause the
caller to say that, but negative return should not be forgotten.

This bug caused "diff --no-index" to infinitely show the same error
message because the returned value was used to decrement the loop
control variable, e.g.

$ git diff --no-index --color=words a b
error: option `color' expects "always", "auto", or "never"
error: option `color' expects "always", "auto", or "never"
...

Instead, make it act like so:

$ git diff --no-index --color=words a b
error: option `color' expects "always", "auto", or "never"
fatal: invalid diff option/value: --color=words

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

environment.c: fix constness for odb_pack_keep()Nguyễn Thái Ngọc Duy Sun, 16 Mar 2014 13:35:00 +0000 (20:35 +0700)

environment.c: fix constness for odb_pack_keep()

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

gc --aggressive: make --depth configurableNguyễn Thái Ngọc Duy Sun, 16 Mar 2014 13:35:03 +0000 (20:35 +0700)

gc --aggressive: make --depth configurable

When 1c192f3 (gc --aggressive: make it really aggressive - 2007-12-06)
made --depth=250 the default value, it didn't really explain the
reason behind, especially the pros and cons of --depth=250.

An old mail from Linus below explains it at length. Long story short,
--depth=250 is a disk saver and a performance killer. Not everybody
agrees on that aggressiveness. Let the user configure it.

From: Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] gc --aggressive: make it really aggressive
Date: Thu, 6 Dec 2007 08:19:24 -0800 (PST)
Message-ID: <alpine.LFD.0.9999.0712060803430.13796@woody.linux-foundation.org>
Gmane-URL: http://article.gmane.org/gmane.comp.gcc.devel/94637

On Thu, 6 Dec 2007, Harvey Harrison wrote:
>
> 7:41:25elapsed 86%CPU

Heh. And this is why you want to do it exactly *once*, and then just
export the end result for others ;)

> -r--r--r-- 1 hharrison hharrison 324094684 2007-12-06 07:26 pack-1d46...pack

But yeah, especially if you allow longer delta chains, the end result can
be much smaller (and what makes the one-time repack more expensive is the
window size, not the delta chain - you could make the delta chains longer
with no cost overhead at packing time)

HOWEVER.

The longer delta chains do make it potentially much more expensive to then
use old history. So there's a trade-off. And quite frankly, a delta depth
of 250 is likely going to cause overflows in the delta cache (which is
only 256 entries in size *and* it's a hash, so it's going to start having
hash conflicts long before hitting the 250 depth limit).

So when I said "--depth=250 --window=250", I chose those numbers more as
an example of extremely aggressive packing, and I'm not at all sure that
the end result is necessarily wonderfully usable. It's going to save disk
space (and network bandwidth - the delta's will be re-used for the network
protocol too!), but there are definitely downsides too, and using long
delta chains may simply not be worth it in practice.

(And some of it might just want to have git tuning, ie if people think
that long deltas are worth it, we could easily just expand on the delta
hash, at the cost of some more memory used!)

That said, the good news is that working with *new* history will not be
affected negatively, and if you want to be _really_ sneaky, there are ways
to say "create a pack that contains the history up to a version one year
ago, and be very aggressive about those old versions that we still want to
have around, but do a separate pack for newer stuff using less aggressive
parameters"

So this is something that can be tweaked, although we don't really have
any really nice interfaces for stuff like that (ie the git delta cache
size is hardcoded in the sources and cannot be set in the config file, and
the "pack old history more aggressively" involves some manual scripting
and knowing how "git pack-objects" works rather than any nice simple
command line switch).

So the thing to take away from this is:
- git is certainly flexible as hell
- .. but to get the full power you may need to tweak things
- .. happily you really only need to have one person to do the tweaking,
and the tweaked end results will be available to others that do not
need to know/care.

And whether the difference between 320MB and 500MB is worth any really
involved tweaking (considering the potential downsides), I really don't
know. Only testing will tell.

Linus

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

Update draft release notes to 2.0Junio C Hamano Fri, 28 Mar 2014 20:56:29 +0000 (13:56 -0700)

Update draft release notes to 2.0

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

Merge branch 'ys/fsck-commit-parsing'Junio C Hamano Fri, 28 Mar 2014 20:51:24 +0000 (13:51 -0700)

Merge branch 'ys/fsck-commit-parsing'

* ys/fsck-commit-parsing:
fsck.c:fsck_commit(): use skip_prefix() to verify and skip constant
fsck.c:fsck_ident(): ident points at a const string

Merge branch 'bg/rebase-off-of-previous-branch'Junio C Hamano Fri, 28 Mar 2014 20:51:20 +0000 (13:51 -0700)

Merge branch 'bg/rebase-off-of-previous-branch'

* bg/rebase-off-of-previous-branch:
rebase: allow "-" short-hand for the previous branch

Merge branch 'bp/commit-p-editor'Junio C Hamano Fri, 28 Mar 2014 20:51:11 +0000 (13:51 -0700)

Merge branch 'bp/commit-p-editor'

When it is not necessary to edit a commit log message (e.g. "git
commit -m" is given a message without specifying "-e"), we used to
disable the spawning of the editor by overriding GIT_EDITOR, but
this means all the uses of the editor, other than to edit the
commit log message, are also affected.

* bp/commit-p-editor:
run-command: mark run_hook_with_custom_index as deprecated
merge hook tests: fix and update tests
merge: fix GIT_EDITOR override for commit hook
commit: fix patch hunk editing with "commit -p -m"
test patch hunk editing with "commit -p -m"
merge hook tests: use 'test_must_fail' instead of '!'
merge hook tests: fix missing '&&' in test

Merge branch 'ah/doc-gitk-config'Junio C Hamano Fri, 28 Mar 2014 20:51:08 +0000 (13:51 -0700)

Merge branch 'ah/doc-gitk-config'

* ah/doc-gitk-config:
Documentation/gitk: document the location of the configulation file

Merge branch 'fr/add-interactive-argv-array'Junio C Hamano Fri, 28 Mar 2014 20:51:04 +0000 (13:51 -0700)

Merge branch 'fr/add-interactive-argv-array'

* fr/add-interactive-argv-array:
add: use struct argv_array in run_add_interactive()

Merge branch 'jk/subtree-prefix'Junio C Hamano Fri, 28 Mar 2014 20:50:59 +0000 (13:50 -0700)

Merge branch 'jk/subtree-prefix'

A stray environment variable $prefix could have leaked into and
affected the behaviour of the "subtree" script.

* jk/subtree-prefix:
subtree: initialize "prefix" variable

Merge branch 'jk/pack-bitmap-progress'Junio C Hamano Fri, 28 Mar 2014 20:50:56 +0000 (13:50 -0700)

Merge branch 'jk/pack-bitmap-progress'

The progress output while repacking and transferring objects showed
an apparent large silence while writing the objects out of existing
packfiles, when the reachability bitmap was in use.

* jk/pack-bitmap-progress:
pack-objects: show reused packfile objects in "Counting objects"
pack-objects: show progress for reused packfiles

Merge branch 'jk/pack-bitmap'Junio C Hamano Fri, 28 Mar 2014 20:50:50 +0000 (13:50 -0700)

Merge branch 'jk/pack-bitmap'

Instead of dying when asked to (re)pack with the reachability
bitmap when a bitmap cannot be built, just (re)pack without
producing a bitmap in such a case, with a warning.

* jk/pack-bitmap:
pack-objects: turn off bitmaps when skipping objects

MSVC: link in invalidcontinue.obj for better POSIX... Marat Radchenko Fri, 28 Mar 2014 20:08:02 +0000 (00:08 +0400)

MSVC: link in invalidcontinue.obj for better POSIX compatibility

By default, Windows abort()'s instead of setting
errno=EINVAL when invalid arguments are passed to standard functions.

For example, when PAGER quits and git detects it with
errno=EPIPE on write(), check_pipe() in write_or_die.c tries raise(SIGPIPE)
but since there is no SIGPIPE on Windows, it is treated as invalid argument,
causing abort() and crash report window.

Linking in invalidcontinue.obj (provided along with MS compiler) allows
raise(SIGPIPE) to return with errno=EINVAL.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: submodule.*.branch config is keyed by nameW. Trevor King Thu, 27 Mar 2014 21:06:20 +0000 (14:06 -0700)

doc: submodule.*.branch config is keyed by name

Ever since 941987a5 (git-submodule: give submodules proper names,
2007-06-11) introduced the ability to move a submodule from one path
to another inside its superproject tree without losing its identity,
we should have consistently used submodule.<name>.* to access
settings related to the named submodule.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: submodule.* config are keyed by submodule namesW. Trevor King Thu, 27 Mar 2014 21:06:20 +0000 (14:06 -0700)

doc: submodule.* config are keyed by submodule names

Ever since 941987a5 (git-submodule: give submodules proper names,
2007-06-11) introduced the ability to move a submodule from one path
to another inside its superproject tree without losing its identity,
we should have consistently used submodule.<name>.* to access
settings related to the named submodule.

Reported-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

MSVC: allow linking with the cURL libraryMarat Radchenko Thu, 27 Mar 2014 07:34:27 +0000 (11:34 +0400)

MSVC: allow linking with the cURL library

Teach the clink.pl script that -lcurl is a request to link with the
cURL library, and drop NO_CURL from config.mak.uname for the MSVC
platform.

Signed-off-by: Marat Radchenko <marat@slonopotamus.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Portable alloca for GitKirill Smelkov Thu, 27 Mar 2014 14:22:50 +0000 (18:22 +0400)

Portable alloca for Git

In the next patch we'll have to use alloca() for performance reasons,
but since alloca is non-standardized and is not portable, let's have a
trick with compatibility wrappers:

1. at configure time, determine, do we have working alloca() through
alloca.h, and define

#define HAVE_ALLOCA_H

if yes.

2. in code

#ifdef HAVE_ALLOCA_H
# include <alloca.h>
# define xalloca(size) (alloca(size))
# define xalloca_free(p) do {} while(0)
#else
# define xalloca(size) (xmalloc(size))
# define xalloca_free(p) (free(p))
#endif

and use it like

func() {
p = xalloca(size);
...

xalloca_free(p);
}

This way, for systems, where alloca is available, we'll have optimal
on-stack allocations with fast executions. On the other hand, on
systems, where alloca is not available, this gracefully fallbacks to
xmalloc/free.

Both autoconf and config.mak.uname configurations were updated. For
autoconf, we are not bothering considering cases, when no alloca.h is
available, but alloca() works some other way - its simply alloca.h is
available and works or not, everything else is deep legacy.

For config.mak.uname, I've tried to make my almost-sure guess for where
alloca() is available, but since I only have access to Linux it is the
only change I can be sure about myself, with relevant to other changed
systems people Cc'ed.

NOTE

SunOS and Windows had explicit -DHAVE_ALLOCA_H in their configurations.
I've changed that to now-common HAVE_ALLOCA_H=YesPlease which should be
correct.

Cc: Brandon Casey <drafnel@gmail.com>
Cc: Marius Storm-Olsen <mstormo@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Gerrit Pape <pape@smarden.org>
Cc: Petr Salinger <Petr.Salinger@seznam.cz>
Cc: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Thomas Schwinge <thomas@codesourcery.com> (GNU Hurd changes)
Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree-diff: reuse base str(buf) memory on sub-tree recursionKirill Smelkov Thu, 27 Mar 2014 14:22:07 +0000 (18:22 +0400)

tree-diff: reuse base str(buf) memory on sub-tree recursion

Instead of allocating it all the time for every subtree in
ll_diff_tree_sha1, let's allocate it once in diff_tree_sha1, and then
all callee just use it in stacking style, without memory allocations.

This should be faster, and for me this change gives the following
slight speedups for

git log --raw --no-abbrev --no-renames --format='%H'

navy.git linux.git v3.10..v3.11

before 0.618s 1.903s
after 0.611s 1.889s
speedup 1.1% 0.7%

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree-diff: no need to call "full" diff_tree_sha1 from... Kirill Smelkov Thu, 27 Mar 2014 14:21:29 +0000 (18:21 +0400)

tree-diff: no need to call "full" diff_tree_sha1 from show_path()

As described in previous commit, when recursing into sub-trees, we can
use lower-level tree walker, since its interface is now sha1 based.

The change is ok, because diff_tree_sha1() only invokes
ll_diff_tree_sha1(), and also, if base is empty, try_to_follow_renames().
But base is not empty here, as we have added a path and '/' before
recursing.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree-diff: rework diff_tree interface to be sha1 basedKirill Smelkov Thu, 27 Mar 2014 14:24:38 +0000 (18:24 +0400)

tree-diff: rework diff_tree interface to be sha1 based

In the next commit this will allow to reduce intermediate calls, when
recursing into subtrees - at that stage we know only subtree sha1, and
it is natural for tree walker to start from that phase. For now we do

diff_tree
show_path
diff_tree_sha1
diff_tree
...

and the change will allow to reduce it to

diff_tree
show_path
diff_tree

Also, it will allow to omit allocating strbuf for each subtree, and just
reuse the common strbuf via playing with its len.

The above-mentioned improvements go in the next 2 patches.

The downside is that try_to_follow_renames(), if active, we cause
re-reading of 2 initial trees, which was negligible based on my timings,
and which is outweighed cogently by the upsides.

NOTE To keep with the current interface and semantics, I needed to
rename the function from diff_tree() to diff_tree_sha1(). As
diff_tree_sha1() was already used, and the function we are talking here
is its more low-level helper, let's use convention for prefixing
such helpers with "ll_". So the final renaming is

diff_tree() -> ll_diff_tree_sha1()

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree-diff: diff_tree() should now be staticKirill Smelkov Mon, 24 Feb 2014 16:21:45 +0000 (20:21 +0400)

tree-diff: diff_tree() should now be static

We reworked all its users to use the functionality through
diff_tree_sha1 variant in recent patches (see "tree-diff: allow
diff_tree_sha1 to accept NULL sha1" and what comes next).

diff_tree() is now not used outside tree-diff.c - make it static.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tree-diff: remove special-case diff-emitting code for... Kirill Smelkov Mon, 24 Feb 2014 16:21:44 +0000 (20:21 +0400)

tree-diff: remove special-case diff-emitting code for empty-tree cases

While walking trees, we iterate their entries from lowest to highest in
sort order, so empty tree means all entries were already went over.

If we artificially assign +infinity value to such tree "entry", it will
go after all usual entries, and through the usual driver loop we will be
taking the same actions, which were hand-coded for special cases, i.e.

t1 empty, t2 non-empty
pathcmp(+∞, t2) -> +1
show_path(/*t1=*/NULL, t2); /* = t1 > t2 case in main loop */

t1 non-empty, t2-empty
pathcmp(t1, +∞) -> -1
show_path(t1, /*t2=*/NULL); /* = t1 < t2 case in main loop */

In other words when we have t1 and t2, we return a sign that tells the
caller to indicate the "earlier" one to be emitted, and by returning the
sign that causes the non-empty side to be emitted, we will automatically
cause the entries from the remaining side to be emitted, without
attempting to touch the empty side at all. We can teach
tree_entry_pathcmp() to pretend that an empty tree has an element that
sorts after anything else to achieve this.

Right now we never go to when compared tree descriptors are both
infinity, as this condition is checked in the loop beginning as
finishing criteria, but will do so in the future, when there will be
several parents iterated simultaneously, and some pair of them would run
to the end.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply --ignore-space-change: lines with and without... Junio C Hamano Wed, 26 Mar 2014 20:42:06 +0000 (13:42 -0700)

apply --ignore-space-change: lines with and without leading whitespaces do not match

The fuzzy_matchlines() function is used when attempting to resurrect
a patch that is whitespace-damaged, or when applying a patch that
was produced against an old codebase to the codebase after
indentation change.

The patch may want to change a line "a_bc" ("_" is used throught
this description for a whitespace to make it stand out) in the
original into something else, and we may not find "a_bc" in the
current source, but there may be "a__bc" (two spaces instead of one
the whitespace-damaged patch claims to expect). By ignoring the
amount of whitespaces, it forces "git apply" to consider that "a_bc"
in the broken patch meant to refer to "a__bc" in reality.

However, the implementation special cases a run of whitespaces at
the beginning of a line and makes "abc" match "_abc", even though a
whitespace in the middle of string never matches a 0-width gap,
e.g. "a_bc" does not match "abc". A run of whitespace at the end of
one string does not match a 0-width end of line on the other line,
either, e.g. "abc_" does not match "abc".

Fix this inconsistency by making the code skip leading whitespaces
only when both strings begin with a whitespace. This makes the
option mean the same as the option of the same name in "diff" and
"git diff".

Note that I am not sure if anybody sane should use this option in
the first place. The fuzzy match logic may be able to find the
original line that the patch author may have meant to touch because
it does not fully trust what the original lines say (i.e. context
lines prefixed by " " and old lines prefixed by "-" does not have to
exactly match the contents the patch is applied to). There is no
reason for us to trust what the replacement lines (i.e. new lines
prefixed by "+") say, either, but with this option enabled, we end
up copying these new lines with suspicious whitespace distributions
literally into the patched result. But as long as we keep it, we
should make it do its insane thing consistently.

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

fetch: handle overlaping refspecs on --pruneCarlos Martín Nieto Thu, 27 Feb 2014 09:00:10 +0000 (10:00 +0100)

fetch: handle overlaping refspecs on --prune

We need to consider that a remote-tracking branch may match more than
one rhs of a fetch refspec. In such a case, it is not enough to stop at
the first match but look at all of the matches in order to determine
whether a head is stale.

To this goal, introduce a variant of query_refspecs which returns all of
the matching refspecs and loop over those answers to check for
staleness.

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

status: disable translation when --porcelain is usedMatthieu Moy Thu, 20 Mar 2014 12:12:41 +0000 (13:12 +0100)

status: disable translation when --porcelain is used

"git status --branch --porcelain" displays the status of the branch
(ahead, behind, gone), and used gettext to translate the string.

Use hardcoded strings when --porcelain is used, but keep the gettext
translation for "git status --short" which is essentially the same, but
meant to be read by a human.

Reported-by: Anarky <ghostanarky@gmail.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log: add --show-linear-break to help see non-linear... Nguyễn Thái Ngọc Duy Tue, 25 Mar 2014 13:23:27 +0000 (20:23 +0700)

log: add --show-linear-break to help see non-linear history

Option explanation is in rev-list-options.txt. The interaction with -z
is left undecided.

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

object.h: centralize object flag allocationNguyễn Thái Ngọc Duy Tue, 25 Mar 2014 13:23:26 +0000 (20:23 +0700)

object.h: centralize object flag allocation

While the field "flags" is mainly used by the revision walker, it is
also used in many other places. Centralize the whole flag allocation to
one place for a better overview (and easier to move flags if we have
too).

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

git-am.sh: use the $(...) construct for command substit... Elia Pinto Tue, 25 Mar 2014 17:22:22 +0000 (10:22 -0700)

git-am.sh: use the $(...) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

check-builtins.sh: use the $(...) construct for command... Elia Pinto Tue, 25 Mar 2014 17:22:22 +0000 (10:22 -0700)

check-builtins.sh: use the $(...) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX. However, all but the
simplest uses become complicated quickly. In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-hg: do not fail on invalid bookmarksMax Horn Fri, 21 Mar 2014 11:36:36 +0000 (12:36 +0100)

remote-hg: do not fail on invalid bookmarks

Mercurial can have bookmarks pointing to "nullid" (the empty root
revision), while Git can not have references to it. When cloning or
fetching from a Mercurial repository that has such a bookmark, the
import failed because git-remote-hg was not be able to create the
corresponding reference.

Warn the user about the invalid reference, and do not advertise these
bookmarks as head refs, but otherwise continue the import. In
particular, we still keep track of the fact that the remote repository
has a bookmark of the given name, in case the user wants to modify that
bookmark.

Also add some test cases for this issue.

Reported-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 2.0Junio C Hamano Tue, 25 Mar 2014 19:01:39 +0000 (12:01 -0700)

Update draft release notes to 2.0

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

Merge branch 'ss/test-on-mingw-rsync-path-no-absolute'Junio C Hamano Tue, 25 Mar 2014 18:08:35 +0000 (11:08 -0700)

Merge branch 'ss/test-on-mingw-rsync-path-no-absolute'

* ss/test-on-mingw-rsync-path-no-absolute:
t5510: Do not use $(pwd) when fetching / pushing / pulling via rsync

Merge branch 'bb/diff-no-index-dotdot'Junio C Hamano Tue, 25 Mar 2014 18:08:31 +0000 (11:08 -0700)

Merge branch 'bb/diff-no-index-dotdot'

* bb/diff-no-index-dotdot:
diff-no-index: replace manual "."/".." check with is_dot_or_dotdot()
diff-no-index: rename read_directory()

Merge branch 'us/printf-not-echo'Junio C Hamano Tue, 25 Mar 2014 18:08:26 +0000 (11:08 -0700)

Merge branch 'us/printf-not-echo'

* us/printf-not-echo:
test-lib.sh: do not "echo" caller-supplied strings
rebase -i: do not "echo" random user-supplied strings

Merge branch 'rr/doc-merge-strategies'Junio C Hamano Tue, 25 Mar 2014 18:08:23 +0000 (11:08 -0700)

Merge branch 'rr/doc-merge-strategies'

* rr/doc-merge-strategies:
Documentation/merge-strategies: avoid hyphenated commands

Merge branch 'nd/index-pack-error-message'Junio C Hamano Tue, 25 Mar 2014 18:08:19 +0000 (11:08 -0700)

Merge branch 'nd/index-pack-error-message'

* nd/index-pack-error-message:
index-pack: report error using the correct variable

Merge branch 'jk/lib-terminal-lazy'Junio C Hamano Tue, 25 Mar 2014 18:08:09 +0000 (11:08 -0700)

Merge branch 'jk/lib-terminal-lazy'

The test helper lib-terminal always run an actual test_expect_* when
included, which screwed up with the use of skil-all that may have to
be done later.

* jk/lib-terminal-lazy:
t/lib-terminal: make TTY a lazy prerequisite

Merge branch 'dm/configure-iconv-locale-charset'Junio C Hamano Tue, 25 Mar 2014 18:07:51 +0000 (11:07 -0700)

Merge branch 'dm/configure-iconv-locale-charset'

* dm/configure-iconv-locale-charset:
configure.ac: link with -liconv for locale_charset()

Merge branch 'nd/commit-editor-cleanup'Junio C Hamano Tue, 25 Mar 2014 18:07:47 +0000 (11:07 -0700)

Merge branch 'nd/commit-editor-cleanup'

"git commit --cleanup=<mode>" learned a new mode, scissors.

* nd/commit-editor-cleanup:
commit: add --cleanup=scissors
wt-status.c: move cut-line print code out to wt_status_add_cut_line
wt-status.c: make cut_line[] const to shrink .data section a bit

Merge branch 'jk/warn-on-object-refname-ambiguity'Junio C Hamano Tue, 25 Mar 2014 18:07:36 +0000 (11:07 -0700)

Merge branch 'jk/warn-on-object-refname-ambiguity'

* jk/warn-on-object-refname-ambiguity:
rev-list: disable object/refname ambiguity check with --stdin
cat-file: restore warn_on_object_refname_ambiguity flag
cat-file: fix a minor memory leak in batch_objects
cat-file: refactor error handling of batch_objects

Merge branch 'mh/remove-subtree-long-pathname-fix'Junio C Hamano Tue, 25 Mar 2014 18:07:09 +0000 (11:07 -0700)

Merge branch 'mh/remove-subtree-long-pathname-fix'

* mh/remove-subtree-long-pathname-fix:
entry.c: fix possible buffer overflow in remove_subtree()
checkout_entry(): use the strbuf throughout the function

Merge branch 'nd/indent-fix-connect-c'Junio C Hamano Tue, 25 Mar 2014 18:07:05 +0000 (11:07 -0700)

Merge branch 'nd/indent-fix-connect-c'

* nd/indent-fix-connect-c:
connect.c: SP after "}", not TAB

Merge branch 'jk/mv-submodules-fix'Junio C Hamano Tue, 25 Mar 2014 18:02:01 +0000 (11:02 -0700)

Merge branch 'jk/mv-submodules-fix'

"git mv" that moves a submodule forgot to adjust the array that uses
to keep track of which submodules were to be moved to update its
configuration.

* jk/mv-submodules-fix:
mv: prevent mismatched data when ignoring errors.
builtin/mv: fix out of bounds write

Merge branch 'cp/am-patch-format-doc'Junio C Hamano Tue, 25 Mar 2014 18:01:31 +0000 (11:01 -0700)

Merge branch 'cp/am-patch-format-doc'

* cp/am-patch-format-doc:
Documentation/git-am: typofix
Documentation/git-am: Document supported --patch-format options

pickaxe: simplify kwset loop in contains()René Scharfe Sat, 22 Mar 2014 17:16:00 +0000 (18:16 +0100)

pickaxe: simplify kwset loop in contains()

Inlining the variable "found" actually makes the code shorter and
easier to read.

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

pickaxe: call strlen only when necessary in diffcore_pi... René Scharfe Sat, 22 Mar 2014 17:15:59 +0000 (18:15 +0100)

pickaxe: call strlen only when necessary in diffcore_pickaxe_count()

We need to determine the search term's length only when fixed-string
matching is used; regular expression compilation takes a NUL-terminated
string directly. Only call strlen() in the former case.

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

pickaxe: move pickaxe() after pickaxe_match()René Scharfe Sat, 22 Mar 2014 17:15:58 +0000 (18:15 +0100)

pickaxe: move pickaxe() after pickaxe_match()

pickaxe() calls pickaxe_match(); moving the definition of the former
after the latter allows us to do without an explicit function
declaration.

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

pickaxe: merge diffcore_pickaxe_grep() and diffcore_pic... René Scharfe Sat, 22 Mar 2014 17:15:57 +0000 (18:15 +0100)

pickaxe: merge diffcore_pickaxe_grep() and diffcore_pickaxe_count() into diffcore_pickaxe()

diffcore_pickaxe_count() initializes the regular expression or kwset for
the search term, calls pickaxe() with the callback has_changes() and
cleans up afterwards. diffcore_pickaxe_grep() does the same, only it
doesn't support kwset and uses the callback diff_grep() instead. Merge
the two functions to form the new diffcore_pickaxe() and thus get rid of
the duplicate regex setup and cleanup code.

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

pickaxe: honor -i when used with -S and --pickaxe-regexRené Scharfe Sat, 22 Mar 2014 17:15:56 +0000 (18:15 +0100)

pickaxe: honor -i when used with -S and --pickaxe-regex

accccde4 (pickaxe: allow -i to search in patch case-insensitively)
allowed case-insenitive matching for -G and -S, but for the latter
only if fixed string matching is used. Allow it for -S and regular
expression matching as well to make the support complete.

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

t4209: use helper functions to test --authorRené Scharfe Sat, 22 Mar 2014 17:15:55 +0000 (18:15 +0100)

t4209: use helper functions to test --author

Also add tests for case sensitive and non-matching cases.

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

t4209: use helper functions to test --grepRené Scharfe Sat, 22 Mar 2014 17:15:54 +0000 (18:15 +0100)

t4209: use helper functions to test --grep

Also add tests for non-matching cases.

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