gitweb.git
send-pack: take refspecs over stdinJeff King Thu, 21 Aug 2014 12:21:20 +0000 (08:21 -0400)

send-pack: take refspecs over stdin

Pushing a large number of refs works over most transports,
because we implement send-pack as an internal function.
However, it can sometimes fail when pushing over http,
because we have to spawn "git send-pack --stateless-rpc" to
do the heavy lifting, and we pass each refspec on the
command line. This can cause us to overflow the OS limits on
the size of the command line for a large push.

We can solve this by giving send-pack a --stdin option and
using it from remote-curl. We already dealt with this on
the fetch-pack side in 078b895 (fetch-pack: new --stdin
option to read refs from stdin, 2012-04-02). The stdin
option (and in particular, its use of packet-lines for
stateless-rpc input) is modeled after that solution.

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

Makefile: drop CHECK_HEADER_DEPENDENCIES codeJeff King Fri, 22 Aug 2014 04:33:16 +0000 (00:33 -0400)

Makefile: drop CHECK_HEADER_DEPENDENCIES code

This code was useful when we kept a static list of header
files, and it was easy to forget to update it. Since the last
commit, we generate the list dynamically.

Technically this could still be used to find a dependency
that our dynamic check misses (e.g., a header file without a
".h" extension). But that is reasonably unlikely to be
added, and even less likely to be noticed by this tool
(because it has to be run manually)., It is not worth
carrying around the cruft in the Makefile.

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

Merge branch 'jk/diff-tree-t-fix'Junio C Hamano Tue, 26 Aug 2014 18:16:26 +0000 (11:16 -0700)

Merge branch 'jk/diff-tree-t-fix'

Fix (rarely used) "git diff-tree -t" regression in 2.0.

* jk/diff-tree-t-fix:
intersect_paths: respect mode in git's tree-sort

Merge branch 'jk/pack-shallow-always-without-bitmap'Junio C Hamano Tue, 26 Aug 2014 18:16:25 +0000 (11:16 -0700)

Merge branch 'jk/pack-shallow-always-without-bitmap'

Reachability bitmaps do not work with shallow operations.
Fixes regression in 2.0.

* jk/pack-shallow-always-without-bitmap:
pack-objects: turn off bitmaps when we see --shallow lines

Merge branch 'jk/fix-profile-feedback-build'Junio C Hamano Tue, 26 Aug 2014 18:16:25 +0000 (11:16 -0700)

Merge branch 'jk/fix-profile-feedback-build'

Fix profile-feedback build broken in 2.1 for tarball releases.

* jk/fix-profile-feedback-build:
Makefile: make perf tests optional for profile build

use strbuf_add_absolute_path() to add absolute pathsRené Scharfe Mon, 28 Jul 2014 18:34:42 +0000 (20:34 +0200)

use strbuf_add_absolute_path() to add absolute paths

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

abspath: convert absolute_path() to strbufRené Scharfe Mon, 28 Jul 2014 18:33:55 +0000 (20:33 +0200)

abspath: convert absolute_path() to strbuf

Move most of the code of absolute_path() into the new function
strbuf_add_absolute_path() and in the process transform it to use
struct strbuf and xgetcwd() instead of a PATH_MAX-sized buffer,
which can be too small on some file systems.

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

use xgetcwd() to set $GIT_DIRRené Scharfe Mon, 28 Jul 2014 18:31:57 +0000 (20:31 +0200)

use xgetcwd() to set $GIT_DIR

Instead of dying of a segmentation fault if getcwd() returns NULL, use
xgetcwd() to make sure to write a useful error message and then exit
in an orderly fashion.

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

use xgetcwd() to get the current directory or dieRené Scharfe Mon, 28 Jul 2014 18:30:39 +0000 (20:30 +0200)

use xgetcwd() to get the current directory or die

Convert several calls of getcwd() and die() to use xgetcwd() instead.
This way we get rid of fixed-size buffers (which can be too small
depending on the used file system) and gain consistent error messages.

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

wrapper: add xgetcwd()René Scharfe Mon, 28 Jul 2014 18:29:50 +0000 (20:29 +0200)

wrapper: add xgetcwd()

Add the helper function xgetcwd(), which returns the current directory
or dies. The returned string has to be free()d after use.

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

abspath: convert real_path_internal() to strbufRené Scharfe Mon, 28 Jul 2014 18:28:30 +0000 (20:28 +0200)

abspath: convert real_path_internal() to strbuf

Use strbuf instead of fixed-sized buffers in real_path() in order to
avoid the size limitations of the latter.

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

abspath: use strbuf_getcwd() to remember original worki... René Scharfe Mon, 28 Jul 2014 18:27:34 +0000 (20:27 +0200)

abspath: use strbuf_getcwd() to remember original working directory

Store the original working directory in a strbuf instead of in a
fixed-sized buffer, in order to be able to handle longer paths.

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

setup: convert setup_git_directory_gently_1 et al.... René Scharfe Mon, 28 Jul 2014 18:26:40 +0000 (20:26 +0200)

setup: convert setup_git_directory_gently_1 et al. to strbuf

Convert setup_git_directory_gently_1() and its helper functions
setup_explicit_git_dir(), setup_discovered_git_dir() and
setup_bare_git_dir() to use a struct strbuf to hold the current working
directory. Replacing the PATH_MAX-sized buffer used before removes a
path length limition on some file systems. The functions are converted
all in one go because they all read and write the variable cwd.

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

log-tree: make name_decoration hash staticJeff King Tue, 26 Aug 2014 10:23:54 +0000 (06:23 -0400)

log-tree: make name_decoration hash static

In the previous commit, we made add_name_decoration global
so that adders would not have to access the hash directly.
We now make the hash itself static so that callers _have_ to
add through our function, making sure that all additions go
through a single point. To do this, we have to add one more
accessor function: a way to lookup entries in the hash.

Since the only caller doesn't actually look at the returned
value, but rather only asks whether there is a decoration or
not, we could provide only a boolean "has_name_decoration".
That would allow us to make "struct name_decoration" local
to log-tree, as well.

However, it's unlikely to cause any maintainability harm
making the actual data public, and this interface is more
flexible if we need to look at decorations from other parts
of the code in the future.

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

log-tree: make add_name_decoration a public functionJeff King Tue, 26 Aug 2014 10:23:36 +0000 (06:23 -0400)

log-tree: make add_name_decoration a public function

The log-tree code keeps a "struct decoration" hash to show
text decorations for each commit during log traversals. It
makes this available to other files by providing global
access to the hash. This can result in other code adding
entries that do not conform to what log-tree expects.

For example, the bisect code adds its own "dist"
decorations to be shown. Originally the bisect code was
correct, but when the name_decoration code grew a new field
in eb3005e (commit.h: add 'type' to struct name_decoration,
2010-06-19), the bisect code was not updated. As a result,
the log-tree code can access uninitialized memory and even
segfault.

We can fix this by making name_decoration's adding function
public. If all callers use it, then any changes to struct
initialization only need to happen in one place (and because
the members come in as parameters, the compiler can notice a
caller who does not supply enough information).

As a bonus, this also means that the decoration hashes
created by the bisect code will use less memory (previously
we over-allocated space for the distance integer, but now we
format it into a temporary buffer and copy it to the final
flex-array).

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

imap-send: create target mailbox if it is missingTony Finch Fri, 1 Aug 2014 08:15:52 +0000 (09:15 +0100)

imap-send: create target mailbox if it is missing

Some MUAs delete their "drafts" folder when it is empty, so
git imap-send should be able to create it if necessary.

This change checks that the folder exists immediately after
login and tries to create it if it is missing.

There was some vestigial code to handle a [TRYCREATE] response
from the server when an APPEND target is missing. However this
code never ran (the create and trycreate flags were never set)
and when I tried to make it run I found that the code had already
thrown away the contents of the message it was trying to append.

Signed-off-by: Tony Finch <dot@dotat.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout -m: attempt merge when deletion of path was... Jonathan Nieder Wed, 13 Aug 2014 00:03:18 +0000 (17:03 -0700)

checkout -m: attempt merge when deletion of path was staged

twoway_merge() is missing an o->gently check in the case where a file
that needs to be modified is missing from the index but present in the
old and new trees. As a result, in this case 'git checkout -m' errors
out instead of trying to perform a merge.

Fix it by checking o->gently. While at it, inline the o->gently check
into reject_merge to prevent future call sites from making the same
mistake.

Noticed by code inspection. The test for the motivating case was
added by JC.

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

Merge git://github.com/git-l10n/git-poJunio C Hamano Mon, 25 Aug 2014 22:12:58 +0000 (15:12 -0700)

Merge git://github.com/git-l10n/git-po

* git://github.com/git-l10n/git-po:
l10n: de.po: improve message when switching branches
l10n: de.po: fix typo
po/TEAMS: Add Catalan team
l10n: Add Catalan translation
l10n: fr.po (2257t) update for version 2.1.0
l10n: sv.po: Update Swedish translation (2257t0f0u)
l10n: vi.po (2257t): Update translation
l10n: Updated Bulgarian translation of git (2257t,0f,0u)
l10n: zh_CN: translations for git v2.1.0-rc0
l10n: git.pot: v2.1.0 round 1 (38 new, 9 removed)
l10n: Updated Bulgarian translation of git (2247t,0f,0u)
l10n: Updated Bulgarian translation of git (2228t,0f,0u)
l10n: Fix more typos in the Swedish translations

Makefile: use `find` to determine static header depende... Jeff King Mon, 25 Aug 2014 20:00:42 +0000 (16:00 -0400)

Makefile: use `find` to determine static header dependencies

Most modern platforms will use automatically computed header
dependencies to figure out when a C file needs rebuilt due
to a header changing. With old compilers, however, we
fallback to a static list of header files. If any of them
changes, we recompile everything. This is overly
conservative, but the best we can do on older platforms.

It is unfortunately easy for our static header list to grow
stale, as none of the regular developers make use of it.
Instead of trying to keep it up to date, let's invoke "find"
to generate the list dynamically.

Since we do not use the value $(LIB_H) unless either
COMPUTE_HEADER_DEPENDENCIES is turned on or the user is
building "po/git.pot" (where it comes in via $(LOCALIZED_C),
make is smart enough to not even run this "find" in most
cases. However, we do need to stop using the "immediate"
variable assignment ":=" for $(LOCALIZED_C). That's OK,
because it was not otherwise useful here.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

i18n: treat "make pot" as an explicitly-invoked targetJonathan Nieder Fri, 22 Aug 2014 04:32:08 +0000 (00:32 -0400)

i18n: treat "make pot" as an explicitly-invoked target

po/git.pot is normally used as-is and not regenerated by people
building git, so it is okay if an explicit "make po/git.pot" always
automatically regenerates it. Depend on the magic FORCE target
instead of explicitly keeping track of dependencies.

This simplifies the makefile, in particular preparing for a moment
when $(LIB_H), which is part of $(LOCALIZED_C), can be computed on the
fly. It also fixes a slight breakage in which changes to perl and shell
scripts did not trigger a rebuild of po/git.pot.

We still need a dependency on GENERATED_H, to force those files to be
built when regenerating git.pot.

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

git-prompt: do not look for refs/stash in $GIT_DIRJeff King Sat, 23 Aug 2014 05:26:51 +0000 (01:26 -0400)

git-prompt: do not look for refs/stash in $GIT_DIR

Since dd0b72c (bash prompt: use bash builtins to check stash
state, 2011-04-01), git-prompt checks whether we have a
stash by looking for $GIT_DIR/refs/stash. Generally external
programs should never do this, because they would miss
packed-refs.

That commit claims that packed-refs does not pack
refs/stash, but that is not quite true. It does pack the
ref, but due to a bug, fails to prune the ref. When we fix
that bug, we would want to be doing the right thing here.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: fix buffer overflow in dump_tagsJeff King Sat, 23 Aug 2014 05:32:37 +0000 (01:32 -0400)

fast-import: fix buffer overflow in dump_tags

When creating a new annotated tag, we sprintf the refname
into a static-sized buffer. If we have an absurdly long
tagname, like:

git init repo &&
cd repo &&
git commit --allow-empty -m foo &&
git tag -m message mytag &&
git fast-export mytag |
perl -lpe '/^tag/ and s/mytag/"a" x 8192/e' |
git fast-import <input

we'll overflow the buffer. We can fix it by using a strbuf.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: clean up pack_data pointer in end_packfileJeff King Sat, 23 Aug 2014 05:27:41 +0000 (01:27 -0400)

fast-import: clean up pack_data pointer in end_packfile

We have a global pointer pack_data pointing to the current
pack we have open. Inside end_packfile we have two new
pointers, old_p and new_p. The latter points to pack_data,
and the former points to the new "installed" version of the
packfile we get when we hand the file off to the regular
sha1_file machinery. When then free old_p.

Presumably the extra old_p pointer was there so that we
could overwrite pack_data with new_p and still free old_p,
but we don't do that. We just leave pack_data pointing to
bogus memory, and don't overwrite it until we call
start_packfile again (if ever).

This can cause problems for our die routine, which calls
end_packfile to clean things up. If we die at the wrong
moment, we can end up looking at invalid memory in
pack_data left after the last end_packfile().

Instead, let's make sure we set pack_data to NULL after we
free it, and make calling endfile() again with a NULL
pack_data a noop (there is nothing to end).

We can further make things less confusing by dropping old_p
entirely, and moving new_p closer to its point of use.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-refs: prune top-level refs like "refs/foo"Jeff King Sat, 23 Aug 2014 05:27:07 +0000 (01:27 -0400)

pack-refs: prune top-level refs like "refs/foo"

After we have packed all refs, we prune any loose refs that
correspond to what we packed. We do so by first taking a
lock with lock_ref_sha1, and then deleting the loose ref
file.

However, lock_ref_sha1 will refuse to take a lock on any
refs that exist at the top-level of the "refs/" directory,
and we skip pruning the ref. This is almost certainly not
what we want to happen here. The criteria to be pruned
should not differ from that to be packed; if a ref makes it
to prune_ref, it's because we want it both packed and
pruned (if there are refs you do not want to be packed, they
should be omitted much earlier by pack_ref_is_possible,
which we do in this case if --all is not given).

We can fix this by switching to lock_any_ref_for_update.
This behaves exactly the same with the exception of this
top-level check.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

walker: avoid quadratic list insertion in mark_completeRené Scharfe Thu, 21 Aug 2014 18:30:24 +0000 (20:30 +0200)

walker: avoid quadratic list insertion in mark_complete

Similar to 16445242 (fetch-pack: avoid quadratic list insertion in
mark_complete), sort only after all refs are collected instead of while
inserting. The result is the same, but it's more efficient that way.
The difference will only be measurable in repositories with a large
number of refs.

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

sha1_name: avoid quadratic list insertion in handle_one_refRené Scharfe Thu, 21 Aug 2014 18:30:29 +0000 (20:30 +0200)

sha1_name: avoid quadratic list insertion in handle_one_ref

Similar to 16445242 (fetch-pack: avoid quadratic list insertion in
mark_complete), sort only after all refs are collected instead of while
inserting. The result is the same, but it's more efficient that way.
The difference will only be measurable in repositories with a large
number of refs.

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

l10n: de.po: improve message when switching branchesRalf Thielow Thu, 12 Jun 2014 18:15:55 +0000 (20:15 +0200)

l10n: de.po: improve message when switching branches

Suggested-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

l10n: de.po: fix typoRalf Thielow Wed, 11 Jun 2014 16:10:45 +0000 (18:10 +0200)

l10n: de.po: fix typo

Reported-by: Hartmut Henkel
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

po/TEAMS: Add Catalan teamAlex Henrie Sat, 23 Aug 2014 02:10:30 +0000 (20:10 -0600)

po/TEAMS: Add Catalan team

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>

l10n: Add Catalan translationAlex Henrie Sat, 23 Aug 2014 02:10:22 +0000 (20:10 -0600)

l10n: Add Catalan translation

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>

upload-pack: keep poll(2)'s timeout to -1Edward Thomson Fri, 22 Aug 2014 15:19:11 +0000 (15:19 +0000)

upload-pack: keep poll(2)'s timeout to -1

Keep poll's timeout at -1 when uploadpack.keepalive = 0, instead of
setting it to -1000, since some pedantic old systems (eg HP-UX) and
the gnulib compat/poll will treat only -1 as the valid value for
an infinite timeout.

Signed-off-by: Edward Thomson <ethomson@microsoft.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty: note that %cd respects the --date= optionThomas Braun Wed, 20 Aug 2014 12:27:10 +0000 (14:27 +0200)

pretty: note that %cd respects the --date= option

Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http: style fixes for curl_multi_init error checkJeff King Sun, 17 Aug 2014 07:35:53 +0000 (03:35 -0400)

http: style fixes for curl_multi_init error check

Unless there is a good reason, we should use die() rather than
fprintf/exit. We can also shorten the message to match other curl init
failures (and match our usual lowercase no-full-stop style).

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

intersect_paths: respect mode in git's tree-sortJeff King Wed, 20 Aug 2014 02:14:30 +0000 (22:14 -0400)

intersect_paths: respect mode in git's tree-sort

When we do a combined diff, we individually diff against
each parent, and then use intersect_paths to do a parallel
walk through the sorted results and come up with a final
list of interesting paths.

The sort order here is that returned by the diffs, which
means it is in git's tree-order which sorts sub-trees as if
their paths have "/" at the end. When we do our parallel
walk, we need to use a comparison function which provides
the same order.

Since 8518ff8 (combine-diff: optimize combine_diff_path sets
intersection, 2014-01-20), we use a simple strcmp to
compare the pathnames, and get this wrong. It's somewhat
hard to trigger because normally a diff does not produce
tree entries at all, and therefore the sort order is the
same as a strcmp. However, if the "-t" option is used with
the diff, then we will produce diff_filepairs for both trees
and files.

We can use base_name_compare to do the comparison, just as
the tree-diff code does. Even though what we have are not
technically base names (they are full paths within the
tree), the end result is the same (we do not care about
interior slashes at all, only about the final character).

However, since we do not have the length of each path
stored, we take a slight shortcut: if neither of the entries
is a sub-tree then the comparison is equivalent to a strcmp.
This lets us skip the extra strlen calls in the common case
without having to reimplement base_name_compare from
scratch.

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

imap-send.c: imap_folder -> imap_server_conf.folderBernhard Reiter Tue, 19 Aug 2014 21:27:11 +0000 (23:27 +0200)

imap-send.c: imap_folder -> imap_server_conf.folder

Rename the imap_folder variable to folder and make it a member
of struct imap_server_conf.

Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

run-command: inline prepare_run_command_v_opt()René Scharfe Tue, 19 Aug 2014 19:11:43 +0000 (21:11 +0200)

run-command: inline prepare_run_command_v_opt()

Merge prepare_run_command_v_opt() and its only caller. This removes a
pointer indirection and allows to initialize the struct child_process
using CHILD_PROCESS_INIT.

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

run-command: call run_command_v_opt_cd_env() instead... René Scharfe Tue, 19 Aug 2014 19:11:00 +0000 (21:11 +0200)

run-command: call run_command_v_opt_cd_env() instead of duplicating it

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

run-command: introduce child_process_init()René Scharfe Tue, 19 Aug 2014 19:10:48 +0000 (21:10 +0200)

run-command: introduce child_process_init()

Add a helper function for initializing those struct child_process
variables for which the macro CHILD_PROCESS_INIT can't be used.

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

run-command: introduce CHILD_PROCESS_INITRené Scharfe Tue, 19 Aug 2014 19:09:35 +0000 (21:09 +0200)

run-command: introduce CHILD_PROCESS_INIT

Most struct child_process variables are cleared using memset first after
declaration. Provide a macro, CHILD_PROCESS_INIT, that can be used to
initialize them statically instead. That's shorter, doesn't require a
function call and is slightly more readable (especially given that we
already have STRBUF_INIT, ARGV_ARRAY_INIT etc.).

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: make perf tests optional for profile buildJeff King Tue, 19 Aug 2014 06:12:03 +0000 (02:12 -0400)

Makefile: make perf tests optional for profile build

The perf tests need a repository to operate on; if none is
defined, we fall back to the repository containing our build
directory. That fails, though, for an exported tarball of
git.git, which has no repository.

Since 5d7fd6d we run the perf tests as part of "make
profile". Therefore "make profile" fails out of the box on
released tarballs of v2.1.0.

We can fix this by making the perf tests optional; if they
are skipped, we still run the regular test suite, which
should give a lot of profile data (and is what we used to do
prior to 5d7fd6d anyway).

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

subtree: make "all" default target of MakefileJeff King Sun, 17 Aug 2014 07:07:32 +0000 (03:07 -0400)

subtree: make "all" default target of Makefile

You should be able to run "make" in contrib/subtree with no
arguments and get the "all" target. This was broken by 8e2a5cc
(contrib/subtree/Makefile: use GIT-VERSION-FILE, 2014-05-06), which
put the rule for GIT-VERSION-FILE higher in the file.

We can fix this by putting an empty "all::" target at the top of the
file, just like our main Makefile does, and document that fact.
That fixes this instance and future-proofs against it happening
again.

Reported-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: shortcut for diff'ing two binary SHA-1 objectsNguyễn Thái Ngọc Duy Sat, 16 Aug 2014 03:08:06 +0000 (10:08 +0700)

diff: shortcut for diff'ing two binary SHA-1 objects

If we are given two SHA-1 and asked to determine if they are different
(but not _what_ differences), we know right away by comparing SHA-1.

A side effect of this patch is, because large files are marked binary,
diff-tree will not need to unpack them. 'diff-index --cached' will not
either. But 'diff-files' still does.

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

diff --stat: mark any file larger than core.bigfilethre... Nguyễn Thái Ngọc Duy Sat, 16 Aug 2014 03:08:05 +0000 (10:08 +0700)

diff --stat: mark any file larger than core.bigfilethreshold binary

Too large files may lead to failure to allocate memory. If it happens
here, it could impact quite a few commands that involve
diff. Moreover, too large files are inefficient to compare anyway (and
most likely non-text), so mark them binary and skip looking at their
content.

Noticed-by: Dale R. Worley <worley@alum.mit.edu>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: allow to pass more flags to diff_populate_filespecNguyễn Thái Ngọc Duy Sat, 16 Aug 2014 03:08:04 +0000 (10:08 +0700)

diff.c: allow to pass more flags to diff_populate_filespec

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

sha1_file.c: do not die failing to malloc in unpack_com... Nguyễn Thái Ngọc Duy Sat, 16 Aug 2014 03:08:03 +0000 (10:08 +0700)

sha1_file.c: do not die failing to malloc in unpack_compressed_entry

Fewer die() gives better control to the caller, provided that the
caller _can_ handle it. And in unpack_compressed_entry() case, it can,
because unpack_compressed_entry() already returns NULL if it fails to
inflate data.

A side effect from this is fsck continues to run when very large blobs
are present (and do not fit in memory).

Noticed-by: Dale R. Worley <worley@alum.mit.edu>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wrapper.c: introduce gentle xmallocz that does not... Nguyễn Thái Ngọc Duy Sat, 16 Aug 2014 03:08:02 +0000 (10:08 +0700)

wrapper.c: introduce gentle xmallocz that does not die()

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

fetch: silence git-gc if --quiet is givenNguyễn Thái Ngọc Duy Sat, 16 Aug 2014 01:19:28 +0000 (08:19 +0700)

fetch: silence git-gc if --quiet is given

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

fetch: convert argv_gc_auto to struct argv_arrayNguyễn Thái Ngọc Duy Sat, 16 Aug 2014 01:19:27 +0000 (08:19 +0700)

fetch: convert argv_gc_auto to struct argv_array

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

git-imap-send: simplify tunnel constructionBernhard Reiter Wed, 13 Aug 2014 17:30:43 +0000 (19:30 +0200)

git-imap-send: simplify tunnel construction

Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http.c: die if curl_*_init failsBernhard Reiter Wed, 13 Aug 2014 17:31:24 +0000 (19:31 +0200)

http.c: die if curl_*_init fails

Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

turn path macros into inline functionRené Scharfe Sat, 16 Aug 2014 21:48:33 +0000 (23:48 +0200)

turn path macros into inline function

Use static inline functions instead of macros for has_dos_drive_prefix,
offset_1st_component, is_dir_sep and find_last_dir_sep in order to let
the compiler do type checking.

The definitions of offset_1st_component and is_dir_sep are switched
around because the former uses the latter.

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

clean: use f(void) instead of f() to declare a pointer... René Scharfe Sat, 16 Aug 2014 11:16:56 +0000 (13:16 +0200)

clean: use f(void) instead of f() to declare a pointer to a function without arguments

Explicitly state that menu_item functions like clean_cmd don't take
any arguments by using void instead of an empty parameter list.

Found using gcc -Wstrict-prototypes.

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

Git 2.1 v2.1.0Junio C Hamano Fri, 15 Aug 2014 22:09:12 +0000 (15:09 -0700)

Git 2.1

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

config.mak.uname: add hint on uname_R for MacOS XJunio C Hamano Fri, 15 Aug 2014 17:02:46 +0000 (10:02 -0700)

config.mak.uname: add hint on uname_R for MacOS X

I always have to scratch my head every time I see this cryptic
pattern "[15678]\."; leave a short note to remind the maintainer
and the reviewers.

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

config.mak.uname: set NO_APPLE_COMMON_CRYPTO on older... Kyle J. McKay Fri, 15 Aug 2014 07:46:11 +0000 (00:46 -0700)

config.mak.uname: set NO_APPLE_COMMON_CRYPTO on older systems

Older MacOS systems prior to 10.5 do not have the CommonCrypto
support Git uses so set NO_APPLE_COMMON_CRYPTO on those systems.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: fix negated test_i18ngrep callsJohannes Sixt Wed, 13 Aug 2014 19:30:11 +0000 (21:30 +0200)

tests: fix negated test_i18ngrep calls

The helper function test_i18ngrep pretends that it found the expected
results when it is running under GETTEXT_POISON. For this reason, it must
not be used negated like so

! test_i18ngrep foo bar

because the test case would fail under GETTEXT_POISON. The function offers
a special syntax to test that a pattern is *not* found:

test_i18ngrep ! foo bar

Convert incorrect uses to this syntax.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/apply.c: replace `git_config()` with `git_confi... Tanay Abhra Wed, 13 Aug 2014 08:22:02 +0000 (01:22 -0700)

builtin/apply.c: replace `git_config()` with `git_config_get_string_const()`

Use `git_config_get_string_const()` instead of `git_config()` to take
advantage of the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive.c: replace `git_config()` with `git_con... Tanay Abhra Wed, 13 Aug 2014 08:22:01 +0000 (01:22 -0700)

merge-recursive.c: replace `git_config()` with `git_config_get_int()`

Use `git_config_get_int()` instead of `git_config()` to take advantage
of the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ll-merge.c: refactor `read_merge_config()` to use ... Tanay Abhra Wed, 13 Aug 2014 12:43:04 +0000 (18:13 +0530)

ll-merge.c: refactor `read_merge_config()` to use `git_config_string()`

There is one slight behavior change, previously "merge.default"
silently ignored a NULL value and didn't raise any error. But,
in the same function, all other values raise an error on a NULL
value. So to conform with other call sites in Git, a NULL value
for "merge.default" raises an error.

The the new config-set API is not very useful here, because much of
the function is dedicated to processing "merge.<name>.variable",
which the new API does not handle well. If it were for variables
like, "merge.summary", "merge.tool", and "merge.verbosity", we could
use the new API.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import.c: replace `git_config()` with `git_config_... Tanay Abhra Wed, 13 Aug 2014 12:22:56 +0000 (17:52 +0530)

fast-import.c: replace `git_config()` with `git_config_get_*()` family

Use `git_config_get_*()` family instead of `git_config()` to take
advantage of the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees: use 'cuddled' style for if-else cascadeJonathan Nieder Wed, 13 Aug 2014 00:00:45 +0000 (17:00 -0700)

unpack-trees: use 'cuddled' style for if-else cascade

Match the predominant style in git by following K&R style for if/else
cascades. Documentation/CodingStyle from linux.git explains:

Note that the closing brace is empty on a line of its own, _except_ in
the cases where it is followed by a continuation of the same statement,
ie a "while" in a do-statement or an "else" in an if-statement, like
this:

if (x == y) {
..
} else if (x > y) {
...
} else {
....
}

Rationale: K&R.

Also, note that this brace-placement also minimizes the number of empty
(or almost empty) lines, without any loss of readability.

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

unpack-trees: simplify 'all other failures' caseStefan Beller Tue, 12 Aug 2014 23:59:31 +0000 (16:59 -0700)

unpack-trees: simplify 'all other failures' case

In the 'if (current)' block of twoway_merge, we handle the boring
errors by checking if the entry from the old tree, current index, and
new tree are present, to get a pathname for the error message from one
of them:

if (oldtree)
return o->gently ? -1 : reject_merge(oldtree, o);
if (current)
return o->gently ? -1 : reject_merge(current, o);
if (newtree)
return o->gently ? -1 : reject_merge(newtree, o);
return -1;

Since this is guarded by 'if (current)', the second test is guaranteed
to succeed. Moreover, any of the three entries, if present, would
have the same path because there is no rename detection in this code
path. Even if some day in the future the entries' paths differ, the
'current' path used in the index and worktree would presumably be the
most recognizable for the end user.

Simplify by just using 'current'.

Noticed by coverity, Id:290002

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailsplit.c: remove dead codeStefan Beller Tue, 12 Aug 2014 21:21:27 +0000 (23:21 +0200)

mailsplit.c: remove dead code

This was found by coverity. (Id: 290001)

The variable 'output' is assigned to a value
after all gotos to the corrupt label.

Remove the goto by moving the errorhandling code to the
condition, which detects the error.

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

Documentation/git-rebase.txt: -f forces a rebase that... Sergey Organov Mon, 11 Aug 2014 20:22:48 +0000 (00:22 +0400)

Documentation/git-rebase.txt: -f forces a rebase that would otherwise be a no-op

"Current branch is a descendant of the commit you are rebasing onto"
does not necessarily mean "rebase" requires "--force". For a plain
vanilla "history flattening" rebase, the rebase can be done without
forcing if there is a merge between the tip of the branch being
rebased and the commit you are rebasing onto, even if the tip is
descendant of the other.

[jc: reworded both the text and the log description]

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: turn off bitmaps when we see --shallow... Jeff King Tue, 12 Aug 2014 04:34:53 +0000 (00:34 -0400)

pack-objects: turn off bitmaps when we see --shallow lines

Reachability bitmaps do not work with shallow operations,
because they cache a view of the object reachability that
represents the true objects. Whereas a shallow repository
(or a shallow operation in a repository) is inherently
cutting off the object graph with a graft.

We explicitly disallow the use of bitmaps in shallow
repositories by checking is_repository_shallow(), and we
should continue to do that. However, we also want to
disallow bitmaps when we are serving a fetch to a shallow
client, since we momentarily take on their grafted view of
the world.

It used to be enough to call is_repository_shallow at the
start of pack-objects. Upload-pack wrote the other side's
shallow state to a temporary file and pointed the whole
pack-objects process at this state with "git --shallow-file",
and from the perspective of pack-objects, we really were
in a shallow repo. But since b790e0f (upload-pack: send
shallow info over stdin to pack-objects, 2014-03-11), we do
it differently: we send --shallow lines to pack-objects over
stdin, and it registers them itself.

This means that our is_repository_shallow check is way too
early (we have not been told about the shallowness yet), and
that it is insufficient (calling is_repository_shallow is
not enough, as the shallow grafts we register do not change
its return value). Instead, we can just turn off bitmaps
explicitly when we see these lines.

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

builtin/blame.c: add translation to warning about faile... Stefan Beller Sun, 10 Aug 2014 21:33:25 +0000 (23:33 +0200)

builtin/blame.c: add translation to warning about failed revision walk

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

prepare_revision_walk(): check for return value in... Stefan Beller Sun, 10 Aug 2014 21:33:26 +0000 (23:33 +0200)

prepare_revision_walk(): check for return value in all places

Even the documentation tells us:

You should check if it returns any error (non-zero return
code) and if it does not, you can start using get_revision()
to do the iteration.

In preparation for this commit, I grepped all occurrences of
prepare_revision_walk and added error messages, when there were none.

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

utf8.c: fix strbuf_utf8_replace() consuming data beyond... Nguyễn Thái Ngọc Duy Sun, 10 Aug 2014 07:05:21 +0000 (14:05 +0700)

utf8.c: fix strbuf_utf8_replace() consuming data beyond input string

The main loop in strbuf_utf8_replace() could summed up as:

while ('src' is still valid) {
1) advance 'src' to copy ANSI escape sequences
2) advance 'src' to copy/replace visible characters
}

The problem is after #1, 'src' may have reached the end of the string
(so 'src' points to NUL) and #2 will continue to copy that NUL as if
it's a normal character. Because the output is stored in a strbuf,
this NUL accounted in the 'len' field as well. Check after #1 and
break the loop if necessary.

The test does not look obvious, but the combination of %>>() should
make a call trace like this

show_log()
pretty_print_commit()
format_commit_message()
strbuf_expand()
format_commit_item()
format_and_pad_commit()
strbuf_utf8_replace()

where %C(auto)%d would insert a color reset escape sequence in the end
of the string given to strbuf_utf8_replace() and show_log() uses
fwrite() to send everything to stdout (including the incorrect NUL
inserted by strbuf_utf8_replace)

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

mv: flatten error handling code blockNguyễn Thái Ngọc Duy Sun, 10 Aug 2014 02:29:30 +0000 (09:29 +0700)

mv: flatten error handling code block

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

mv: mark strings for translationsNguyễn Thái Ngọc Duy Sun, 10 Aug 2014 02:29:29 +0000 (09:29 +0700)

mv: mark strings for translations

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

clone.c: don't leak memory in cmd_cloneStefan Beller Sun, 10 Aug 2014 13:57:56 +0000 (15:57 +0200)

clone.c: don't leak memory in cmd_clone

Free the refspec.
Found by scan.coverity.com (Id: 1127806)

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

remote.c: don't leak the base branch name in format_tra... Stefan Beller Sun, 10 Aug 2014 19:43:33 +0000 (21:43 +0200)

remote.c: don't leak the base branch name in format_tracking_info

Found by scan.coverity.com (Id: 1127809)

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

read-cache: check for leading symlinks when refreshing... René Scharfe Sat, 9 Aug 2014 17:43:29 +0000 (19:43 +0200)

read-cache: check for leading symlinks when refreshing index

Don't add paths with leading symlinks to the index while refreshing; we
only track those symlinks themselves. We already ignore them while
preloading (see read_index_preload.c).

Reported-by: Nikolay Avdeev <avdeev@math.vsu.ru>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'master' of git://ozlabs.org/~paulus/gitkJunio C Hamano Sun, 10 Aug 2014 18:03:03 +0000 (11:03 -0700)

Merge branch 'master' of git://ozlabs.org/~paulus/gitk

* 'master' of git://ozlabs.org/~paulus/gitk:
gitk: Updated Bulgarian translation (302t,0f,0u)
gitk: Add keybinding to switch to parent commit

Git 2.1-rc2 v2.1.0-rc2Junio C Hamano Fri, 8 Aug 2014 20:52:16 +0000 (13:52 -0700)

Git 2.1-rc2

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

Documentation: git-init: flesh out exampleLinus Arver Fri, 8 Aug 2014 17:29:20 +0000 (10:29 -0700)

Documentation: git-init: flesh out example

Add a third step `git commit` after adding files for the first time.

Signed-off-by: Linus Arver <linusarver@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git-init: template directory: reword... Linus Arver Fri, 8 Aug 2014 17:29:19 +0000 (10:29 -0700)

Documentation: git-init: template directory: reword and cross-reference

Signed-off-by: Linus Arver <linusarver@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git-init: reword parenthetical statementsLinus Arver Fri, 8 Aug 2014 17:29:18 +0000 (10:29 -0700)

Documentation: git-init: reword parenthetical statements

Signed-off-by: Linus Arver <linusarver@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git-init: --separate-git-dir: clarifyLinus Arver Fri, 8 Aug 2014 17:29:17 +0000 (10:29 -0700)

Documentation: git-init: --separate-git-dir: clarify

Use shorter sentences to describe what actually happens. We describe
what the term "Git symbolic link" actually means.

Also, we separate out the description of the behavioral change upon
reinitialization into its own paragraph.

Signed-off-by: Linus Arver <linusarver@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git-init: template directory: rewordLinus Arver Fri, 8 Aug 2014 17:29:16 +0000 (10:29 -0700)

Documentation: git-init: template directory: reword

Signed-off-by: Linus Arver <linusarver@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git-init: list items faceliftLinus Arver Fri, 8 Aug 2014 17:29:15 +0000 (10:29 -0700)

Documentation: git-init: list items facelift

No textual change.

Signed-off-by: Linus Arver <linusarver@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git-init: typographical fixesLinus Arver Fri, 8 Aug 2014 17:29:14 +0000 (10:29 -0700)

Documentation: git-init: typographical fixes

Use backticks when we quote something that the user should literally
use.

Signed-off-by: Linus Arver <linusarver@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitk: Updated Bulgarian translation (302t,0f,0u)Alexander Shopov Sun, 3 Aug 2014 12:36:43 +0000 (15:36 +0300)

gitk: Updated Bulgarian translation (302t,0f,0u)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

gitk: Add keybinding to switch to parent commitMax Kirillov Tue, 8 Jul 2014 20:45:35 +0000 (23:45 +0300)

gitk: Add keybinding to switch to parent commit

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>

bundle: fix exclusion of annotated tagsLukas Fleischer Sat, 2 Aug 2014 08:39:06 +0000 (10:39 +0200)

bundle: fix exclusion of annotated tags

In commit c9a42c4 (bundle: allow rev-list options to exclude annotated
tags, 2009-01-02), support for excluding annotated tags outside the
specified date range was added. However, the wrong order of parameters
was chosen when calling memchr().

Fix this by swapping the character to search for with the maximum length
parameter. Also cover this behavior with an additional test.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash: default listing to working-tree diffJeff King Wed, 6 Aug 2014 18:35:25 +0000 (14:35 -0400)

stash: default listing to working-tree diff

When you list stashes, you can provide arbitrary git-log
options to change the display. However, adding just "-p"
does nothing, because each stash is actually a merge commit.

This implementation detail is easy to forget, leading to
confused users who think "-p" is not working. We can make
this easier by defaulting to "--first-parent -m", which will
show the diff against the working tree. This omits the
index portion of the stash entirely, but it's simple and it
matches what "git stash show" provides.

People who are more clueful about stash's true form can use
"--cc" to override the "-m", and the "--first-parent" will
then do nothing. For diffs, it only affects non-combined
diffs, so "--cc" overrides it. And for the traversal, we are
walking the linear reflog anyway, so we do not even care
about the parents.

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

branch.c: replace `git_config()` with `git_config_get_s... Tanay Abhra Thu, 7 Aug 2014 17:56:42 +0000 (23:26 +0530)

branch.c: replace `git_config()` with `git_config_get_string()

Use `git_config_get_string()` instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow. While we are at
it, return -1 if we find no value for the queried variable. Original code
returned 0 for all cases, which was checked by `add_branch_desc()` in
fmt-merge-msg.c resulting in addition of a spurious newline to the `out`
strbuf. Now, the newline addition is skipped as -1 is returned to the caller
if no value is found.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

alias.c: replace `git_config()` with `git_config_get_st... Tanay Abhra Thu, 7 Aug 2014 16:21:25 +0000 (09:21 -0700)

alias.c: replace `git_config()` with `git_config_get_string()`

Use `git_config_get_string()` instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send.c: replace `git_config()` with `git_config_ge... Tanay Abhra Thu, 7 Aug 2014 16:21:24 +0000 (09:21 -0700)

imap-send.c: replace `git_config()` with `git_config_get_*()` family

Use `git_config_get_*()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pager.c: replace `git_config()` with `git_config_get_va... Tanay Abhra Thu, 7 Aug 2014 16:21:23 +0000 (09:21 -0700)

pager.c: replace `git_config()` with `git_config_get_value()`

Use `git_config_get_value()` instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/gc.c: replace `git_config()` with `git_config_g... Tanay Abhra Thu, 7 Aug 2014 16:21:22 +0000 (09:21 -0700)

builtin/gc.c: replace `git_config()` with `git_config_get_*()` family

Use `git_config_get_*()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rerere.c: replace `git_config()` with `git_config_get_... Tanay Abhra Thu, 7 Aug 2014 16:21:21 +0000 (09:21 -0700)

rerere.c: replace `git_config()` with `git_config_get_*()` family

Use `git_config_get_*()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetchpack.c: replace `git_config()` with `git_config_ge... Tanay Abhra Thu, 7 Aug 2014 16:21:20 +0000 (09:21 -0700)

fetchpack.c: replace `git_config()` with `git_config_get_*()` family

Use `git_config_get_*()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

archive.c: replace `git_config()` with `git_config_get_... Tanay Abhra Thu, 7 Aug 2014 16:21:19 +0000 (09:21 -0700)

archive.c: replace `git_config()` with `git_config_get_bool()` family

Use `git_config_get_bool()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache.c: replace `git_config()` with `git_config_g... Tanay Abhra Thu, 7 Aug 2014 16:21:18 +0000 (09:21 -0700)

read-cache.c: replace `git_config()` with `git_config_get_*()` family

Use `git_config_get_*()` family instead of `git_config()` to take
advantage of the config-set API which provides a cleaner control flow.

Use an intermediate value, as `version` can not be used directly in
git_config_get_int() due to incompatible type.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-backend.c: replace `git_config()` with `git_config... Tanay Abhra Thu, 7 Aug 2014 16:21:17 +0000 (09:21 -0700)

http-backend.c: replace `git_config()` with `git_config_get_bool()` family

Use `git_config_get_bool()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon.c: replace `git_config()` with `git_config_get_b... Tanay Abhra Thu, 7 Aug 2014 16:21:16 +0000 (09:21 -0700)

daemon.c: replace `git_config()` with `git_config_get_bool()` family

Use `git_config_get_bool()` family instead of `git_config()` to take advantage of
the config-set API which provides a cleaner control flow.

Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/log.c: fix minor memory leakMatthieu Moy Thu, 7 Aug 2014 17:13:37 +0000 (19:13 +0200)

builtin/log.c: fix minor memory leak

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>

apply: omit ws check for excluded pathsJunio C Hamano Wed, 6 Aug 2014 20:09:05 +0000 (13:09 -0700)

apply: omit ws check for excluded paths

Whitespace breakages are checked while the patch is being parsed.
Disable them at the beginning of parse_chunk(), where each
individual patch is parsed, immediately after we learn the name of
the file the patch applies to and before we start parsing the diff
contained in the patch.

One may naively think that we should be able to not just skip the
whitespace checks but simply fast-forward to the next patch without
doing anything once use_patch() tells us that this patch is not
going to be used. But in reality we cannot really skip much of the
parsing in order to do such a "fast-forward", primarily because
parsing "@@ -k,l +m,n @@" lines and counting the input lines is how
we determine the boundaries of individual patches.

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

apply: hoist use_patch() helper for path exclusion upJunio C Hamano Wed, 6 Aug 2014 20:11:17 +0000 (13:11 -0700)

apply: hoist use_patch() helper for path exclusion up

We will be adding a caller to the function a bit earlier in this
file in a later patch.

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