gitweb.git
Documentation: use "command-line" when used as a compou... Jason St. John Wed, 21 May 2014 18:52:26 +0000 (14:52 -0400)

Documentation: use "command-line" when used as a compound adjective, and fix other minor grammatical issues

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 2.0Junio C Hamano Wed, 21 May 2014 18:50:35 +0000 (11:50 -0700)

Update draft release notes to 2.0

Hopefully for the last time ;-)

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

Git 2.0-rc4 v2.0.0-rc4Junio C Hamano Tue, 20 May 2014 19:07:35 +0000 (12:07 -0700)

Git 2.0-rc4

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

RelNotes/2.0.0.txt: Fix several grammar issues, notably... Jason St. John Sat, 17 May 2014 03:30:34 +0000 (23:30 -0400)

RelNotes/2.0.0.txt: Fix several grammar issues, notably a lack of hyphens, double quotes, or articles

Signed-off-by: Jason St. John <jstjohn@purdue.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "Merge branch 'jc/graduate-remote-hg-bzr' (early... Junio C Hamano Tue, 20 May 2014 21:18:11 +0000 (14:18 -0700)

Revert "Merge branch 'jc/graduate-remote-hg-bzr' (early part)"

Instead of showing a warning and working as before, fail and show
the message and force immediate upgrade from their upstream
repositories when these tools are run, per request from their
primary author.

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

rebase -i: test "Nothing to do" case with autostashMatthieu Moy Tue, 20 May 2014 07:49:31 +0000 (09:49 +0200)

rebase -i: test "Nothing to do" case with autostash

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

CodingGuidelines: avoid "test <cond> -a/-o <cond>"Junio C Hamano Tue, 20 May 2014 18:12:02 +0000 (11:12 -0700)

CodingGuidelines: avoid "test <cond> -a/-o <cond>"

The construct is error-prone; "test" being built-in in most modern
shells, the reason to avoid "test <cond> && test <cond>" spawning
one extra process by using a single "test <cond> -a <cond>" no
longer exists.

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

Merge branch 'jc/graduate-remote-hg-bzr' (early part)Junio C Hamano Tue, 20 May 2014 00:12:36 +0000 (17:12 -0700)

Merge branch 'jc/graduate-remote-hg-bzr' (early part)

* 'jc/graduate-remote-hg-bzr' (early part):
remote-helpers: point at their upstream repositories
contrib: remote-helpers: add move warnings (v2.0)
Revert "Merge branch 'fc/transport-helper-sync-error-fix'"

remote-helpers: point at their upstream repositoriesJunio C Hamano Thu, 15 May 2014 21:58:16 +0000 (14:58 -0700)

remote-helpers: point at their upstream repositories

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

contrib: remote-helpers: add move warnings (v2.0)Felipe Contreras Tue, 13 May 2014 21:29:56 +0000 (16:29 -0500)

contrib: remote-helpers: add move warnings (v2.0)

The tools are now maintained out-of-tree, and they have a regression
in v2.0. It's better to start warning the users as soon as possible.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "Merge branch 'fc/transport-helper-sync-error... Junio C Hamano Wed, 14 May 2014 19:06:35 +0000 (12:06 -0700)

Revert "Merge branch 'fc/transport-helper-sync-error-fix'"

This reverts commit d508e4a8e2391ae2596403b6478d01cf3d5f928f,
reversing changes made to e42552135a2a396f37053a89f44952ea907870b2.

The author of the original topic says he broke the upcoming 2.0
release with something that relates to "synchronization crash
regression" while refusing to give further specifics, so this would
unfortunately be the safest option for the upcoming release.

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

Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname'Junio C Hamano Mon, 19 May 2014 23:10:10 +0000 (16:10 -0700)

Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname'

* rh/prompt-pcmode-avoid-eval-on-refname:
git-prompt.sh: don't assume the shell expands the value of PS1

git-prompt.sh: don't assume the shell expands the value... Richard Hansen Mon, 19 May 2014 22:55:37 +0000 (18:55 -0400)

git-prompt.sh: don't assume the shell expands the value of PS1

Not all shells subject the prompt string to parameter expansion. Test
whether the shell will expand the value of PS1, and use the result to
control whether raw ref names are included directly in PS1.

This fixes a regression introduced in commit 8976500 ("git-prompt.sh:
don't put unsanitized branch names in $PS1"): zsh does not expand PS1
by default, but that commit assumed it did. The bug resulted in
prompts containing the literal string '${__git_ps1_branch_name}'
instead of the actual branch name.

Reported-by: Caleb Thompson <caleb@calebthompson.io>
Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: handle "Nothing to do" case with autostashRamkumar Ramachandra Mon, 19 May 2014 22:05:20 +0000 (18:05 -0400)

rebase -i: handle "Nothing to do" case with autostash

When a user invokes

$ git rebase -i @~3

with dirty files and rebase.autostash turned on, and exits the $EDITOR
with an empty buffer, the autostash fails to apply. Although the primary
focus of rr/rebase-autostash was to get the git-rebase--backend.sh
scripts to return control to git-rebase.sh, it missed this case in
git-rebase--interactive.sh. Since this case is unlike the other cases
which return control for housekeeping, assign it a special return status
and handle that return value explicitly in git-rebase.sh.

Reported-by: Karen Etheridge <ether@cpan.org>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase --keep-empty -i: add testMichael S. Tsirkin Sun, 18 May 2014 20:28:39 +0000 (23:28 +0300)

rebase --keep-empty -i: add test

There's some special code in rebase -i to deal
with --keep-empty.
Add test for this combination.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: replace: describe new --edit optionChristian Couder Sat, 17 May 2014 12:16:39 +0000 (14:16 +0200)

Documentation: replace: describe new --edit option

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

replace: add --edit to usage stringChristian Couder Sat, 17 May 2014 12:16:38 +0000 (14:16 +0200)

replace: add --edit to usage string

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

replace: add tests for --editChristian Couder Sat, 17 May 2014 12:16:37 +0000 (14:16 +0200)

replace: add tests for --edit

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

replace: die early if replace ref already existsChristian Couder Sat, 17 May 2014 12:16:36 +0000 (14:16 +0200)

replace: die early if replace ref already exists

If a replace ref already exists for an object, it is
much better for the user if we error out before we
let the user edit the object, rather than after.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

replace: refactor checking ref validityChristian Couder Sat, 17 May 2014 12:16:35 +0000 (14:16 +0200)

replace: refactor checking ref validity

This will be useful in a following commit when we will
want to check if the ref already exists before we let the
user edit an object.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

replace: make sure --edit results in a different objectChristian Couder Sat, 17 May 2014 12:16:34 +0000 (14:16 +0200)

replace: make sure --edit results in a different object

It's a bad idea to create a replace ref for an object
that points to the original object itself.

That's why we have to check if the result from editing
the original object is a different object and error out
if it isn't.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: allow core.commentChar=auto for character auto... Nguyễn Thái Ngọc Duy Sat, 17 May 2014 01:52:23 +0000 (08:52 +0700)

commit: allow core.commentChar=auto for character auto selection

When core.commentChar is "auto", the comment char starts with '#' as
in default but if it's already in the prepared message, find another
char in a small subset. This should stop surprises because git strips
some lines unexpectedly.

Note that git is not smart enough to recognize '#' as the comment char
in custom templates and convert it if the final comment char is
different. It thinks '#' lines in custom templates as part of the
commit message. So don't use this with custom templates.

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

config: be strict on core.commentCharNguyễn Thái Ngọc Duy Sat, 17 May 2014 01:52:22 +0000 (08:52 +0700)

config: be strict on core.commentChar

We don't support comment _strings_ (at least not yet). And multi-byte
character encoding could also be misinterpreted.

The test with two commas is updated because it violates this. It's
added with the patch that introduces core.commentChar in eff80a9
(Allow custom "comment char" - 2013-01-16). It's not clear to me _why_
that behavior is wanted.

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

Merge branch 'lt/request-pull'Junio C Hamano Mon, 19 May 2014 17:35:36 +0000 (10:35 -0700)

Merge branch 'lt/request-pull'

* lt/request-pull:
request-pull: resurrect for-linus -> tags/for-linus DWIM

Merge branch 'jl/use-vsatisfy-correctly-for-2.0'Junio C Hamano Mon, 19 May 2014 17:35:24 +0000 (10:35 -0700)

Merge branch 'jl/use-vsatisfy-correctly-for-2.0'

* jl/use-vsatisfy-correctly-for-2.0:
git-gui: tolerate major version changes when comparing the git version

Merge git://github.com/git-l10n/git-poJunio C Hamano Mon, 19 May 2014 17:32:56 +0000 (10:32 -0700)

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

* git://github.com/git-l10n/git-po:
fr: a lot of good fixups

Merge branch 'kb/fast-hashmap'Junio C Hamano Mon, 19 May 2014 17:32:25 +0000 (10:32 -0700)

Merge branch 'kb/fast-hashmap'

* kb/fast-hashmap:
Documentation/technical/api-hashmap: remove source highlighting

Documentation/technical/api-hashmap: remove source... Anders Kaseorg Sat, 17 May 2014 11:08:55 +0000 (07:08 -0400)

Documentation/technical/api-hashmap: remove source highlighting

The highlighting was pretty, but unfortunately, the failure mode
when source-highlight is not installed was that the entire code
block disappears.

See https://bugs.debian.org/745591,
https://bugs.launchpad.net/bugs/1316810.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-gui: tolerate major version changes when comparing... Jens Lehmann Sat, 17 May 2014 19:49:05 +0000 (21:49 +0200)

git-gui: tolerate major version changes when comparing the git version

Since git 2.0.0 starting git gui in a submodule using a gitfile fails with
the following error:

No working directory ../../../<path>

couldn't change working directory
to "../../../<path>": no such file or
directory

This is because "git rev-parse --show-toplevel" is only run when git gui
sees a git version of at least 1.7.0 (which is the version in which the
--show-toplevel option was introduced). But "package vsatisfies" returns
false when the major version changes, which is not what we want here.

Fix that for both places where the git version is checked using vsatisfies
by appending a '-' to the version number. This tells vsatisfies that a
change of the major version is not considered to be a problem, as long as
the new major version is larger. This is done for both the place that
caused the reported bug and another spot where the git version is tested
for another feature.

Reported-by: Chris Packham <judge.packham@gmail.com>
Reported-by: Yann Dirson <ydirson@free.fr>
Helped-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Tested-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fr: a lot of good fixupsGrégoire Paris Tue, 6 May 2014 21:29:57 +0000 (23:29 +0200)

fr: a lot of good fixups

Signed-off-by: Grégoire Paris <postmaster@greg0ire.fr>
Acked-by: Jean-Noel Avila <jn.avila@free.fr>

request-pull: resurrect for-linus -> tags/for-linus... Junio C Hamano Fri, 16 May 2014 17:18:25 +0000 (10:18 -0700)

request-pull: resurrect for-linus -> tags/for-linus DWIM

Older versions of Git before v1.7.10 did not DWIM

$ git pull $URL for-linus

to the tag "tags/for-linus" and the users were required to say

$ git pull $URL tags/for-linus

instead. Because newer versions of Git works either way,
request-pull used to show tags/for-linus when asked

$ git request-pull origin/master $URL for-linus

The recent updates broke this and in the output we see "for-linus"
without the "tags/" prefix.

As v1.7.10 is more than 2 years old, this should matter very little
in practice, but resurrecting it is very simple.

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

git grep -O -i: if the pager is 'less', pass the '... Johannes Schindelin Tue, 8 Feb 2011 06:17:24 +0000 (00:17 -0600)

git grep -O -i: if the pager is 'less', pass the '-I' option

When <command> happens to be the magic string "less", today

git grep -O<command> -e<pattern>

helpfully passes +/<pattern> to less so you can navigate through
the results within a file using the n and shift+n keystrokes.

Alas, that doesn't do the right thing for a case-insensitive match,
i.e.

git grep -i -O<command> -e<pattern>

For that case we should pass --IGNORE-CASE to "less" so that n and
shift+n can move between results ignoring case in the pattern.

The original patch came from msysgit and used "-i", but that was not
due to lack of support for "-I" but it merely overlooked that it
ought to work even when the pattern contains capital letters.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

open_sha1_file: report "most interesting" errnoJeff King Thu, 15 May 2014 08:54:06 +0000 (04:54 -0400)

open_sha1_file: report "most interesting" errno

When we try to open a loose object file, we first attempt to
open in the local object database, and then try any
alternates. This means that the errno value when we return
will be from the last place we looked (and due to the way
the code is structured, simply ENOENT if we do not have have
any alternates).

This can cause confusing error messages, as read_sha1_file
checks for ENOENT when reporting a missing object. If errno
is something else, we report that. If it is ENOENT, but
has_loose_object reports that we have it, then we claim the
object is corrupted. For example:

$ chmod 0 .git/objects/??/*
$ git rev-list --all
fatal: loose object b2d6fab18b92d49eac46dc3c5a0bcafabda20131 (stored in .git/objects/b2/d6fab18b92d49eac46dc3c5a0bcafabda20131) is corrupt

This patch instead keeps track of the "most interesting"
errno we receive during our search. We consider ENOENT to be
the least interesting of all, and otherwise report the first
error found (so problems in the object database take
precedence over ones in alternates). Here it is with this
patch:

$ git rev-list --all
fatal: failed to read object b2d6fab18b92d49eac46dc3c5a0bcafabda20131: Permission denied

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

argv-array: drop "detach" codeJeff King Thu, 15 May 2014 08:41:03 +0000 (04:41 -0400)

argv-array: drop "detach" code

The argv_array_detach function (and associated free() function) was
really only useful for transferring ownership of the memory to a "struct
child_process". Now that we have an internal argv_array in that struct,
there are no callers left.

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

get_importer: use run-command's internal argv_arrayJeff King Thu, 15 May 2014 08:35:06 +0000 (04:35 -0400)

get_importer: use run-command's internal argv_array

This saves a few lines and lets us avoid having to clean up
the memory manually when the command finishes.

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

get_exporter: use argv_arrayJeff King Thu, 15 May 2014 08:34:44 +0000 (04:34 -0400)

get_exporter: use argv_array

This simplifies the code and avoids a fixed array size that
we might accidentally overflow. It also prevents a leak
after finish_command is run, by using the argv_array that
run-command manages for us.

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

get_helper: use run-command's internal argv_arrayJeff King Thu, 15 May 2014 08:34:18 +0000 (04:34 -0400)

get_helper: use run-command's internal argv_array

The get_helper functions dynamically allocates an
argv_array, feeds it to start_command, and then returns. We
then have to later clean up the memory manually after
calling finish_command. We can make this simpler by just
using run-command's internal argv_array, which handles
cleanup for us.

This also prevents a memory leak in the case that
transport_take_over is used, in which case we free the child
in finish_connect, which does not manually free the array.

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

git_connect: use argv_arrayJeff King Thu, 15 May 2014 08:34:09 +0000 (04:34 -0400)

git_connect: use argv_array

This avoids magic numbers when we allocate fixed-size argv
arrays, and makes it more obvious that we are not
overflowing.

It is also the first step to fixing a memory leak. When
git_connect returns a child_process struct, the argv array
in the struct is dynamically allocated, but the individual
strings are not (they are either owned elsewhere, or are
freed). Later, in finish_connect, we free the array but
leave the strings alone.

This works for the child_process created by git_connect, but
if we use transport_take_over, we may also end up with a
child_process created by transport-helper's get_helper.
In that case, the strings are freshly allocated, and we
would want to free them. However, we have no idea in
finish_connect which type we have.

By consistently using run-command's internal argv-array, we
do not have to worry about this issue at all; finish_command
takes care of it for us, and we can drop our manual free
entirely.

Note that this actually makes the get_helper leak slightly
worse; now we are leaking both the strings and the array.
But when we adjust it in a future patch, that leak will go
away entirely.

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

run_column_filter: use argv_arrayJeff King Thu, 15 May 2014 08:33:40 +0000 (04:33 -0400)

run_column_filter: use argv_array

We currently set up the argv array by hand in a fixed-size
stack-local array. Using an argv array is more readable, as
it handles buffer allocation us (not to mention makes it
obvious we do not overflow the array).

However, there's a more subtle benefit, too. We leave the
function having run start_command (with the child_process
in a static global), and then later run finish_command from
another function. That means when we run finish_command,
neither column_process.argv nor the memory it points to is
valid any longer.

Most of the time finish_command does not bother looking at
argv, but it may if it encounters an error (e.g., waitpid
failure or signal death). This is unusual, which is why
nobody has noticed. But by using run-command's built-in
argv_array, the memory ownership is handled for us
automatically.

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

run-command: store an optional argv_arrayJeff King Thu, 15 May 2014 08:33:26 +0000 (04:33 -0400)

run-command: store an optional argv_array

All child_process structs need to point to an argv. For
flexibility, we do not mandate the use of a dynamic
argv_array. However, because the child_process does not own
the memory, this can make memory management with a
separate argv_array difficult.

For example, if a function calls start_command but not
finish_command, the argv memory must persist. The code needs
to arrange to clean up the argv_array separately after
finish_command runs. As a result, some of our code in this
situation just leaks the memory.

To help such cases, this patch adds a built-in argv_array to
the child_process, which gets cleaned up automatically (both
in finish_command and when start_command fails). Callers
may use it if they choose, but can continue to use the raw
argv if they wish.

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

run_diff_files: do not look at uninitialized stat dataJeff King Wed, 14 May 2014 22:13:06 +0000 (18:13 -0400)

run_diff_files: do not look at uninitialized stat data

If we try to diff an index entry marked CE_VALID (because it
was marked with --assume-unchanged), we do not bother even
running stat() on the file to see if it was removed. This
started long ago with 540e694 (Prevent diff machinery from
examining assume-unchanged entries on worktree, 2009-08-11).

However, the subsequent code may look at our "struct stat"
and expect to find actual data; currently it will find
whatever cruft was left on the stack. This can cause
problems in two situations:

1. We call match_stat_with_submodule with the stat data,
so a submodule may be erroneously marked as changed.

2. If --find-copies-harder is in effect, we pass all
entries, even unchanged ones, to diff_change, so it can
list them as rename/copy sources. Since we found no
change, we assume that function will realize it and not
actually display any diff output. However, we end up
feeding it a bogus mode, leading it to sometimes claim
there was a mode change.

We can fix both by splitting the CE_VALID and regular code
paths, and making sure only to look at the stat information
in the latter. Furthermore, we push the declaration of our
"struct stat" down into the code paths that actually set it,
so we cannot accidentally access it uninitialized in future
code.

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

git-show: fix 'git show -s' to not add extra terminator... Max Kirillov Wed, 14 May 2014 22:12:45 +0000 (01:12 +0300)

git-show: fix 'git show -s' to not add extra terminator after merge commit

When git show -s is called for merge commit it prints extra newline
after any merge commit. This differs from output for commits with one
parent. Fix it by more thorough checking that diff output is disabled.

The code in question exists since commit 3969cf7db1. The additional
newline is really needed for cases when patch is requested, test
t4013-diff-various.sh contains cases which can demonstrate behavior when
the condition is restricted further.

Tests:

Added merge commit to 'set up a bit of history' case in t7007-show.sh to
cover the fix.

Existing tests are updated to demonstrate the new behaviour. Earlier,
the tests that used "git show -s --pretty=format:%s", even though
"--pretty=format:%s" calls for item separator semantics and does not ask
for the terminating newline after the last item, expected the output to
end with such a newline. They were relying on the buggy behaviour. Use
of "--format=%s", which is equivalent to "--pretty=tformat:%s" that asks
for a terminating newline after each item, is a more realistic way to
use the command.

In the test 'merge log messages' the expected data is changed, because
it was explicitly listing the extra newline. Also the msg.nologff and
msg.nolognoff expected files are replaced by one msg.nolog, because they
were diffing because of the bug, and now there should be no difference.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wincred: avoid overwriting configured variablesPat Thoyts Tue, 23 Oct 2012 23:15:29 +0000 (00:15 +0100)

wincred: avoid overwriting configured variables

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Acked-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wincred: add install targetPat Thoyts Tue, 23 Oct 2012 23:15:29 +0000 (00:15 +0100)

wincred: add install target

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Acked-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: mention config sources for @{upstream}W. Trevor King Tue, 13 May 2014 18:46:57 +0000 (11:46 -0700)

Documentation: mention config sources for @{upstream}

The earlier documentation made vague references to "is set to build
on". Flesh that out with references to the config settings, so folks
can use git-config(1) to get more detail on what @{upstream} means.
For example, @{upstream} does not care about remote.pushdefault or
branch.<name>.pushremote.

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

contrib/subtree: allow adding an annotated tagJames Denholm Tue, 13 May 2014 04:08:58 +0000 (14:08 +1000)

contrib/subtree: allow adding an annotated tag

cmd_add_commit() is passed FETCH_HEAD by cmd_add_repository, which
is then rev-parsed into an object name. However, if the user is
fetching a tag rather than a branch HEAD, such as by executing:

$ git subtree add -P oldGit https://github.com/git/git.git tags/v1.8.0

the object name refers to a tag and is never peeled, and the git
commit-tree call (line 561) slaps us in the face because it doesn't
peel tags to commits.

Because peeling a committish doesn't do anything if it's already a
commit, fix by peeling the object name before assigning it to $rev
using peel_committish() from git:git-sh-setup.sh, a pre-existing
dependency of git-subtree.

Reported-by: Kevin Cagle <kcagle@micron.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: James Denholm <nod.helm@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'fc/prompt-zsh-read-from-file'Junio C Hamano Tue, 13 May 2014 18:53:14 +0000 (11:53 -0700)

Merge branch 'fc/prompt-zsh-read-from-file'

* fc/prompt-zsh-read-from-file:
contrib: completion: fix 'eread()' namespace

contrib: completion: fix 'eread()' namespaceFelipe Contreras Tue, 13 May 2014 13:21:19 +0000 (08:21 -0500)

contrib: completion: fix 'eread()' namespace

Otherwise it might collide with a function of the same name in the
user's environment.

Suggested-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

svn-fe: conform to pep8William Giokas Fri, 9 May 2014 02:36:50 +0000 (21:36 -0500)

svn-fe: conform to pep8

Quite a large change, most of this was whitespace changes, though there
were a few places where I removed a comma or added a few characters.
Should pass through pep8 and pass every test.

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

index-pack: distinguish missing objects from type errorsJeff King Mon, 12 May 2014 04:38:39 +0000 (00:38 -0400)

index-pack: distinguish missing objects from type errors

When we fetch a pack that does not contain an object we
expected to receive, we get an error like:

$ git init --bare tmp.git && cd tmp.git
$ git fetch ../parent.git
[...]
error: Could not read 964953ec7bcc0245cb1d0db4095455edd21a2f2e
fatal: Failed to traverse parents of commit b8247b40caf6704fe52736cdece6d6aae87471aa
error: ../parent.git did not send all necessary objects

This comes from the check_everything_connected rev-list. If
we try cloning the same repo (rather than a fetch), we end
up using index-pack's --check-self-contained-and-connected
option instead, which produces output like:

$ git clone --no-local --bare parent.git tmp.git
[...]
fatal: object of unexpected type
fatal: index-pack failed

Not only is the sha1 missing, but it's a misleading message.
There's no type problem, but rather a missing object
problem; we don't notice the difference because we simply
compare OBJ_BAD != OBJ_BLOB. Let's provide a different
message for this case:

$ git clone --no-local --bare parent.git tmp.git
fatal: did not receive expected object 6b00a8c61ed379d5f925a72c1987c9c52129d364
fatal: index-pack failed

While we're at it, let's also improve a true type mismatch
error to look like

fatal: object 6b00a8c61ed379d5f925a72c1987c9c52129d364: expected type blob, got tree

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

utf8: make it easier to auto-update git_wcwidth()Torsten Bögershausen Fri, 9 May 2014 21:51:44 +0000 (23:51 +0200)

utf8: make it easier to auto-update git_wcwidth()

The function git_wcwidth() returns for a given unicode code point the
width on the display:

-1 for control characters,
0 for combining or other non-visible code points
1 for e.g. ASCII
2 for double-width code points.

This table had been originally been extracted for one Unicode
version, probably 3.2.

We now use two tables these days, one for zero-width and another for
double-width. Make it easier to update these tables to a later
version of Unicode by factoring out the table from utf8.c into
unicode_width.h and add the script update_unicode.sh to update the
table based on the latest Unicode specification files.

Thanks to Peter Krefting <peter@softwolves.pp.se> and Kevin Bracey
<kevin@bracey.fi> for helping with their Unicode knowledge.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

utf8.c: use a table for double_widthTorsten Bögershausen Fri, 9 May 2014 21:51:38 +0000 (23:51 +0200)

utf8.c: use a table for double_width

Refactor git_wcwidth() and replace the if-else-if chain.
Use the table double_width which is scanned by the bisearch() function,
which is already used to find combining code points.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-httpd: require SANITY prereqJeff King Sat, 10 May 2014 14:02:59 +0000 (10:02 -0400)

t/lib-httpd: require SANITY prereq

Our test httpd setup will not generally run as root, because
Apache will want to setuid, and we do not set up the "User"
config directive. On some systems, like current Debian
unstable, Apache fails to start, and we skip the tests:

$ sudo ./t5539-fetch-http-shallow.sh --debug
1..0 # SKIP web server setup failed
$ cat trash*t5539*/httpd/error.log
[...]
(22)Invalid argument: AH00024: Couldn't set permissions on
the rewrite-map mutex; check User and Group directives
AH00016: Configuration Failed

However, on other systems (reportedly Ubuntu 11.04), Apache
seems to start, and then bails during our tests with:

getpwuid: couldn't determine user name from uid 4294967295,
you probably need to modify the User directive
Child 12037 returned a Fatal error... Apache is exiting!

This may be related to the pre-fork/threading model in use
(note that the second one complains of the child dying).
However, it's not even worth investigating; in either case
we just want to skip the tests, and we already recommend
against running the test suite as root. Let's just
explicitly check this condition and skip the tests rather
than expecting Apache to do the right thing.

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

Merge git://github.com/git-l10n/git-poJunio C Hamano Mon, 12 May 2014 17:12:05 +0000 (10:12 -0700)

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

* git://github.com/git-l10n/git-po:
l10n: Updated Bulgarian translation of git (1307t0f921u)

l10n: Updated Bulgarian translation of git (1307t0f921u)Alexander Shopov Wed, 29 Jan 2014 13:08:40 +0000 (15:08 +0200)

l10n: Updated Bulgarian translation of git (1307t0f921u)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>

contrib: remove git-diffallJonathan Nieder Fri, 9 May 2014 20:12:46 +0000 (13:12 -0700)

contrib: remove git-diffall

The functionality of the "git diffall" script in contrib/ was
incorporated into "git difftool" when the --dir-diff option was added
in v1.7.11 (ca. June, 2012). Once difftool learned those features,
the diffall script became obsolete.

The only difference in behavior is that when comparing to the working
tree, difftool copies any files modified by the user back to the
working tree when the diff tool exits. "git diffall" required the
--copy-back option to do the same. All other diffall options have the
same meaning in difftool.

Make life easier for people choosing a tool to use by removing the old
diffall script. A pointer in the release notes should be enough to
help current users migrate.

Helped-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.0-rc3 v2.0.0-rc3Junio C Hamano Fri, 9 May 2014 18:23:25 +0000 (11:23 -0700)

Git 2.0-rc3

contrib: remove vim support instructionsJonathan Nieder Fri, 9 May 2014 02:23:50 +0000 (19:23 -0700)

contrib: remove vim support instructions

The git support scripts started shipping in upstream vim in version
7.2 (2008-08-09). Clean up contrib/ a little by removing the
instructions for people on older versions of vim.

RHEL 6 already has vim 7.2.something, so anyone on a reasonably modern
operating system should not be affected. Users on RHEL 5 presumably
know that means sometimes missing out on niceties like syntax
highlighting, so this should be safe.

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

Sync with 1.9.3Junio C Hamano Fri, 9 May 2014 18:00:48 +0000 (11:00 -0700)

Sync with 1.9.3

Git 1.9.3 v1.9.3Junio C Hamano Fri, 9 May 2014 17:59:07 +0000 (10:59 -0700)

Git 1.9.3

The third maintenance release for Git 1.9; contains all the fixes
that are scheduled to appear in Git 2.0 since 1.9.2.

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

blame: correctly handle files regardless of autocrlfbrian m. carlson Sat, 26 Apr 2014 23:10:40 +0000 (23:10 +0000)

blame: correctly handle files regardless of autocrlf

If a file contained CRLF line endings in a repository with
core.autocrlf=input, then blame always marked lines as "Not
Committed Yet", even if they were unmodified. Don't attempt to
convert the line endings when creating the fake commit so that blame
works correctly regardless of the autocrlf setting.

Reported-by: Ephrim Khong <dr.khong@gmail.com>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mv: allow renaming to fix case on case insensitive... David Turner Thu, 8 May 2014 17:23:34 +0000 (10:23 -0700)

mv: allow renaming to fix case on case insensitive filesystems

"git mv hello.txt Hello.txt" on a case insensitive filesystem
always triggers "destination already exists" error, because these
two names refer to the same path from the filesystem's point of
view, and requires the user to give "--force" when correcting the
case of the path recorded in the index and in the next commit.

Detect this case and allow it without requiring "--force".

Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout.c: use ref_exists instead of file_existRonnie Sahlberg Tue, 6 May 2014 22:45:53 +0000 (15:45 -0700)

checkout.c: use ref_exists instead of file_exist

Change checkout.c to check if a ref exists instead of checking if a loose ref
file exists when deciding if to delete an orphaned log file. Otherwise, if a
ref only exists as a packed ref without a corresponding loose ref for the
currently checked out branch, we risk that the reflog will be deleted when we
switch to a different branch.

Update the reflog tests to check for this bug.

The following reproduces the bug:
$ git init-db
$ git config core.logallrefupdates true
$ git commit -m Initial --allow-empty
[master (root-commit) bb11abe] Initial
$ git reflog master
[8561dcb master@{0}: commit (initial): Initial]
$ find .git/{refs,logs} -type f | grep master
[.git/refs/heads/master]
[.git/logs/refs/heads/master]
$ git branch foo
$ git pack-refs --all
$ find .git/{refs,logs} -type f | grep master
[.git/logs/refs/heads/master]
$ git checkout foo
$ find .git/{refs,logs} -type f | grep master
... reflog file is missing ...
$ git reflog master
... nothing ...

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

refs.c: add new functions reflog_exists and delete_reflogRonnie Sahlberg Tue, 6 May 2014 22:45:52 +0000 (15:45 -0700)

refs.c: add new functions reflog_exists and delete_reflog

Add two new functions, reflog_exists and delete_reflog, to hide the internal
reflog implementation (that they are files under .git/logs/...) from callers.
Update checkout.c to use these functions in update_refs_for_switch instead of
building pathnames and calling out to file access functions. Update reflog.c
to use these to check if the reflog exists. Now there are still many places
in reflog.c where we are still leaking the reflog storage implementation but
this at least reduces the number of such dependencies by one. Finally
change two places in refs.c itself to use the new function to check if a ref
exists or not isntead of build-path-and-stat(). Now, this is strictly not all
that important since these are in parts of refs that are implementing the
actual file storage backend but on the other hand it will not hurt either.

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

Revert "submodules: fix ambiguous absolute paths under... Stepan Kasal Thu, 8 May 2014 20:36:57 +0000 (22:36 +0200)

Revert "submodules: fix ambiguous absolute paths under Windows"

This reverts commit 4dce7d9b408b2935b85721b54a2010eda7ec1be9,
which was originally done to help Windows but was almost
immediately reverted in msysGit, and the codebase kept this
unnecessary divergence for almost two years.

Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with maintJunio C Hamano Thu, 8 May 2014 18:59:51 +0000 (11:59 -0700)

Sync with maint

* maint:
shell doc: remove stray "+" in example
Start preparing for 1.9.3

shell doc: remove stray "+" in exampleJonathan Nieder Wed, 7 May 2014 23:44:01 +0000 (16:44 -0700)

shell doc: remove stray "+" in example

The git-shell(1) manpage says

EXAMPLE
To disable interactive logins, displaying a greeting
instead:

+

$ chsh -s /usr/bin/git-shell
$ mkdir $HOME/git-shell-commands
[...]

The stray "+" has been there ever since the example was added in
v1.8.3-rc0~210^2 (shell: new no-interactive-login command to print a
custom message, 2013-03-09). The "+" sign between paragraphs is
needed in asciidoc to attach extra paragraphs to a list item but here
it is not needed and ends up rendered as a literal "+". Remove it.

A quick search with "grep -e '<p>+' /usr/share/doc/git/html/*.html"
doesn't find any other instances of this problem.

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 Thu, 8 May 2014 17:25:37 +0000 (10:25 -0700)

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

* 'master' of git://github.com/git-l10n/git-po:
l10n: Fix a couple of typos in the Swedish translation

Start preparing for 1.9.3Junio C Hamano Thu, 8 May 2014 17:05:22 +0000 (10:05 -0700)

Start preparing for 1.9.3

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

Merge branch 'cl/p4-use-diff-tree' into maintJunio C Hamano Thu, 8 May 2014 17:01:32 +0000 (10:01 -0700)

Merge branch 'cl/p4-use-diff-tree' into maint

"git p4" dealing with changes in binary files were broken by a
change in 1.9 release.

* cl/p4-use-diff-tree:
git-p4: format-patch to diff-tree change breaks binary patches

Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname... Junio C Hamano Thu, 8 May 2014 17:01:18 +0000 (10:01 -0700)

Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname' into maint

The shell prompt script (in contrib/), when using the PROMPT_COMMAND
interface, used an unsafe construct when showing the branch name in
$PS1.

* rh/prompt-pcmode-avoid-eval-on-refname:
git-prompt.sh: don't put unsanitized branch names in $PS1

Merge branch 'km/avoid-non-function-return-in-rebase... Junio C Hamano Thu, 8 May 2014 17:01:06 +0000 (10:01 -0700)

Merge branch 'km/avoid-non-function-return-in-rebase' into maint

"git rebase" used a POSIX shell construct FreeBSD /bin/sh does not
work well with.

* km/avoid-non-function-return-in-rebase:
Revert "rebase: fix run_specific_rebase's use of "return" on FreeBSD"
rebase: avoid non-function use of "return" on FreeBSD

Merge branch 'tb/unicode-6.3-zero-width' into maintJunio C Hamano Thu, 8 May 2014 17:00:45 +0000 (10:00 -0700)

Merge branch 'tb/unicode-6.3-zero-width' into maint

Some more Unicode codepoints defined in Unicode 6.3 as having zero
width have been taught to our display column counting logic.

* tb/unicode-6.3-zero-width:
utf8.c: partially update to version 6.3

Merge branch 'km/avoid-bs-in-shell-glob' into maintJunio C Hamano Thu, 8 May 2014 17:00:36 +0000 (10:00 -0700)

Merge branch 'km/avoid-bs-in-shell-glob' into maint

Some tests used shell constructs that did not work well on FreeBSD

* km/avoid-bs-in-shell-glob:
test: fix t5560 on FreeBSD

Merge branch 'km/avoid-cp-a' into maintJunio C Hamano Thu, 8 May 2014 16:59:41 +0000 (09:59 -0700)

Merge branch 'km/avoid-cp-a' into maint

Some tests used shell constructs that did not work well on FreeBSD

* km/avoid-cp-a:
test: fix t7001 cp to use POSIX options

Update draft release notes for 2.0Junio C Hamano Wed, 7 May 2014 22:50:15 +0000 (15:50 -0700)

Update draft release notes for 2.0

Describe one last minute one-liner fix for regression introduced in
1.9, and fix a grave mischaracterization on a recent remote-hg/bzr
change, pointed out by Felipe.

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

Merge branch 'cl/p4-use-diff-tree'Junio C Hamano Wed, 7 May 2014 21:39:29 +0000 (14:39 -0700)

Merge branch 'cl/p4-use-diff-tree'

Fixes a regression in 1.9.0 with an obviously correct single-liner.

* cl/p4-use-diff-tree:
git-p4: format-patch to diff-tree change breaks binary patches

builtin/tag.c: show tag name to hint in the message... Thorsten Glaser Thu, 29 Aug 2013 22:03:10 +0000 (00:03 +0200)

builtin/tag.c: show tag name to hint in the message editor

Display the tag name about to be added to the user during interactive
editing.

Signed-off-by: Thorsten Glaser <tg@debian.org>
Signed-off-by: Richard Hartmann <richih@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive.c: fix case-changing merge bugDavid Turner Fri, 2 May 2014 00:21:09 +0000 (20:21 -0400)

merge-recursive.c: fix case-changing merge bug

On a case-insensitive filesystem, when merging, a file would be
wrongly deleted from the working tree if an incoming commit had
renamed it changing only its case. When merging a rename, the file
with the old name would be deleted -- but since the filesystem
considers the old name to be the same as the new name, the new
file would in fact be deleted.

We avoid this by not deleting files that have a case-clone in the
index at stage 0.

Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pager: remove 'S' from $LESS by defaultMatthieu Moy Wed, 30 Apr 2014 07:35:25 +0000 (09:35 +0200)

pager: remove 'S' from $LESS by default

By default, Git used to set $LESS to -FRSX if $LESS was not set by
the user. The FRX flags actually make sense for Git (F and X because
sometimes the output Git pipes to less is short, and R because Git
pipes colored output). The S flag (chop long lines), on the other
hand, is not related to Git and is a matter of user preference. Git
should not decide for the user to change LESS's default.

More specifically, the S flag harms users who review untrusted code
within a pager, since a patch looking like:

-old code;
+new good code; [... lots of tabs ...] malicious code;

would appear identical to:

-old code;
+new good code;

Users who prefer the old behavior can still set the $LESS environment
variable to -FRSX explicitly, or set core.pager to 'less -S'.

The documentation in config.txt is made a bit longer to keep both an
example setting the 'S' flag (needed to recover the old behavior)
and an example showing how to unset a flag set by Git.

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

silence a bunch of format-zero-length warningsFelipe Contreras Sun, 4 May 2014 06:12:55 +0000 (01:12 -0500)

silence a bunch of format-zero-length warnings

This can be observed in many versions of gcc and still exists with 4.9.0:

wt-status.c: In function ‘wt_status_print_unmerged_header’:
wt-status.c:191:2: warning: zero-length gnu_printf format string [-Wformat-zero-length]
status_printf_ln(s, c, "");
^

The user have long been told to pass -Wno-format-zero-length, but a
patch that avoids warning altogether is not too noisy, so let's do
so.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: use run-command's "dir" option for --open-files... Jeff King Wed, 7 May 2014 03:00:37 +0000 (23:00 -0400)

grep: use run-command's "dir" option for --open-files-in-pager

Git generally changes directory to the repository root on
startup. When running "grep --open-files-in-pager" from a
subdirectory, we chdir back to the original directory before
running the pager, so that we can feed the relative
pathnames to the pager.

We currently do this chdir manually, but we can ask
run_command to do it for us. This is fewer lines of code,
and as a bonus, the chdir is limited to the child process,
which avoids any unexpected surprises for code running after
the pager (there isn't any currently, but this is
future-proofing).

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

git-p4: format-patch to diff-tree change breaks binary... Tolga Ceylan Wed, 7 May 2014 05:48:54 +0000 (22:48 -0700)

git-p4: format-patch to diff-tree change breaks binary patches

When applying binary patches a full index is required. format-patch
already handles this, but diff-tree needs '--full-index' argument
to always output full index. When git-p4 runs git-apply to test
the patch, git-apply rejects the patch due to abbreviated blob
object names. This is the error message git-apply emits in this
case:

error: cannot apply binary patch to '<filename>' without full index line
error: <filename>: patch does not apply

Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Fix a couple of typos in the Swedish translationPeter Krefting Wed, 7 May 2014 06:06:37 +0000 (07:06 +0100)

l10n: Fix a couple of typos in the Swedish translation

Thanks-to: Anders Jonsson <anders.jonsson@norsjovallen.se>
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

RelNotes/2.0.0: Grammar and typo fixesØyvind A. Holm Sat, 3 May 2014 19:08:50 +0000 (21:08 +0200)

RelNotes/2.0.0: Grammar and typo fixes

Signed-off-by: Øyvind A. Holm <sunny@sunbase.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/subtree/Makefile: clean up rule for "clean"James Denholm Tue, 6 May 2014 12:41:49 +0000 (22:41 +1000)

contrib/subtree/Makefile: clean up rule for "clean"

git:Documentation/Makefile and others establish "RM ?= rm -f" as a
convention for rm calls in clean rules, hence follow this convention
instead of simply forcing clean to use rm.

subproj and mainline no longer need to be removed in clean, as they are
no longer created in git:contrib/subtree by "make test". Hence, remove
the rm call for those folders.

Other makefiles don't remove "*~" files, remove the rm call to prevent
unexpected behaviour in the future. Similarly, clean doesn't remove the
installable file, so rectify this.

Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: James Denholm <nod.helm@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/subtree/Makefile: clean up rules to generate... James Denholm Tue, 6 May 2014 12:41:48 +0000 (22:41 +1000)

contrib/subtree/Makefile: clean up rules to generate documentation

git:Documentation/Makefile establishes asciidoc/xmlto calls as being
handled through their appropriate variables, Hence, change to bring into
congruency with.

Similarly, MANPAGE_XSL exists in git:Documentation/Makefile, while
MANPAGE_NORMAL_XSL does not outside contrib/subtree. Hence, replace
MANPAGE_NORMAL_XSL with MANPAGE_XSL.

Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: James Denholm <nod.helm@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/subtree/Makefile: s/libexecdir/gitexecdir/James Denholm Tue, 6 May 2014 12:41:47 +0000 (22:41 +1000)

contrib/subtree/Makefile: s/libexecdir/gitexecdir/

$(libexecdir) isn't used anywhere else in the project, while
$(gitexecdir) is the standard in the other appropriate makefiles. Hence,
replace the former with the latter.

Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: James Denholm <nod.helm@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/subtree/Makefile: use GIT-VERSION-FILEJames Denholm Tue, 6 May 2014 12:41:46 +0000 (22:41 +1000)

contrib/subtree/Makefile: use GIT-VERSION-FILE

GVF is already being used in most/all other makefiles in the project,
and has been for _quite_ a while. Hence, drop file-unique gitver and
replace with GIT_VERSION.

Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: James Denholm <nod.helm@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

api-strbuf.txt: add docs for _trim and _ltrimBrian Gesiak Wed, 30 Apr 2014 08:58:07 +0000 (17:58 +0900)

api-strbuf.txt: add docs for _trim and _ltrim

API documentation for strbuf does not document strbuf_trim() or
strbuf_ltrim(). Add documentation for these two functions.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

strbuf: use _rtrim and _ltrim in strbuf_trimBrian Gesiak Wed, 30 Apr 2014 08:58:06 +0000 (17:58 +0900)

strbuf: use _rtrim and _ltrim in strbuf_trim

strbuf_trim() strips whitespace from the end, then the beginning of
a strbuf. Those operations are duplicated in strbuf_rtrim() and
strbuf_ltrim().

Replace strbuf_trim() implementation with calls to strbuf_rtrim(),
then strbuf_ltrim().

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bump core.deltaBaseCacheLimit to 96mDavid Kastrup Sun, 4 May 2014 17:13:57 +0000 (19:13 +0200)

Bump core.deltaBaseCacheLimit to 96m

The default of 16m causes serious thrashing for large delta chains
combined with large files.

Here are some benchmarks (pu variant of git blame):

time git blame -C src/xdisp.c >/dev/null

for a repository of Emacs repacked with git gc --aggressive (v1.9,
resulting in a window size of 250) located on an SSD drive. The file in
question has about 30000 lines, 1Mb of size, and a history with about
2500 commits.

16m (previous default):
real 3m33.936s
user 2m15.396s
sys 1m17.352s

32m:
real 3m1.319s
user 2m8.660s
sys 0m51.904s

64m:
real 2m20.636s
user 1m55.780s
sys 0m23.964s

96m:
real 2m5.668s
user 1m50.784s
sys 0m14.288s

128m:
real 2m4.337s
user 1m50.764s
sys 0m12.832s

192m:
real 2m3.567s
user 1m49.508s
sys 0m13.312s

Signed-off-by: David Kastrup <dak@gnu.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

let clang use the constant-return error() macroJeff King Tue, 6 May 2014 15:17:50 +0000 (11:17 -0400)

let clang use the constant-return error() macro

Commit e208f9c converted error() into a macro to make its
constant return value more apparent to calling code. Commit
5ded807 prevents us using this macro with clang, since
clang's -Wunused-value is smart enough to realize that the
constant "-1" is useless in some contexts.

However, since the last commit puts the constant behind an
inline function call, this is enough to prevent the
-Wunused-value warning on both modern gcc and clang. So we
can now re-enable the macro when compiling with clang.

Tested with clang 3.3, 3.4, and 3.5.

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

inline constant return from error() functionJeff King Tue, 6 May 2014 15:14:42 +0000 (11:14 -0400)

inline constant return from error() function

Commit e208f9c introduced a macro to turn error() calls
into:

(error(), -1)

to make the constant return value more visible to the
calling code (and thus let the compiler make better
decisions about the code).

This works well for code like:

return error(...);

but the "-1" is superfluous in code that just calls error()
without caring about the return value. In older versions of
gcc, that was fine, but gcc 4.9 complains with -Wunused-value.

We can work around this by encapsulating the constant return
value in a static inline function, as gcc specifically
avoids complaining about unused function returns unless the
function has been specifically marked with the
warn_unused_result attribute.

We also use the same trick for config_error_nonbool and
opterror, which learned the same error technique in a469a10.

Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: preserve config file permissions on editsEric Wong Tue, 6 May 2014 00:17:14 +0000 (00:17 +0000)

config: preserve config file permissions on edits

Users may already store sensitive data such as imap.pass in
.git/config; making the file world-readable when "git config"
is called to edit means their password would be compromised
on a shared system.

[v2: updated for section renames, as noted by Junio]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/subtree/Makefile: scrap unused $(gitdir)James Denholm Tue, 6 May 2014 12:41:45 +0000 (22:41 +1000)

contrib/subtree/Makefile: scrap unused $(gitdir)

In 7ff8463dba0d74fc07a766bed457ae7afcc902b5, the references to gitdir
were removed but the assignment itself wasn't. Hence, drop the gitdir
assignment.

Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: James Denholm <nod.helm@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

MSVC: link dynamically to the CRTKarsten Blees Fri, 7 Jan 2011 16:20:21 +0000 (17:20 +0100)

MSVC: link dynamically to the CRT

Dynamic linking is generally preferred over static linking, and MSVCRT.dll
has been integral part of Windows for a long time.

This also fixes linker warnings for _malloc and _free in zlib.lib, which
seems to be compiled for MSVCRT.dll already.

The DLL version also exports some of the CRT initialization functions,
which are hidden in the static libcmt.lib (e.g. __wgetmainargs, required by
subsequent Unicode patches).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
Acked-by: Marat Radchenko <marat@slonopotamus.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: accept more date formats for "--date"Jeff King Fri, 2 May 2014 01:12:42 +0000 (21:12 -0400)

commit: accept more date formats for "--date"

Right now we pass off the string found by "--date" straight
to the fmt_ident function, which will use our strict
parse_date to normalize it. However, this means obvious
things like "--date=now" or "--date=2.days.ago" will not
work.

Instead, let's fallback to the approxidate function to
handle this for us. Note that we must try parse_date
ourselves first, even though approxidate will try strict
parsing itself. The reason is that approxidate throws away
any timezone information it sees from the strict parsing,
and we want to preserve it. So asking for:

git commit --date="@1234567890 -0700"

continues to set the date in -0700, regardless of what the
local timezone is.

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

commit: print "Date" line when the user has set dateJeff King Fri, 2 May 2014 01:10:01 +0000 (21:10 -0400)

commit: print "Date" line when the user has set date

When we make a commit and the author is not the same as the
committer (e.g., because you used "-c $commit" or
"--author=$somebody"), we print the author's name and email
in both the commit-message template and as part of the
commit summary. This is a safety check to give the user a
chance to confirm that we are doing what they expect.

This patch brings the same safety for the "date" field,
which may be set by "-c" or by using "--date". Note that we
explicitly do not set it for $GIT_AUTHOR_DATE, as it is
probably not of interest when "git commit" is being fed its
parameters by a script.

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

pretty: make show_ident_date publicJeff King Fri, 2 May 2014 01:07:22 +0000 (21:07 -0400)

pretty: make show_ident_date public

We use this function internally to format "Date" lines in
commit logs, but other parts of the code will want it, too.

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