gitweb.git
parse_color: support 24-bit RGB valuesJeff King Thu, 20 Nov 2014 15:25:39 +0000 (10:25 -0500)

parse_color: support 24-bit RGB values

Some terminals (like XTerm) allow full 24-bit RGB color
specifications using an extension to the regular ANSI color
scheme. Let's allow users to specify hex RGB colors,
enabling the all-important feature of hot pink ref
decorations:

git log --format="%h%C(#ff69b4)%d%C(reset) %s"

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

parse_color: refactor color storageJeff King Thu, 20 Nov 2014 15:17:05 +0000 (10:17 -0500)

parse_color: refactor color storage

When we parse a color name like "red" into its ANSI color
value, we pack the storage into a single int that may take
on many values:

1. If it's "-2", no value has been specified.

2. If it's "-1", the value is "normal" (i.e., no color).

3. If it's 0 through 7, the value is a standard ANSI
color.

4. If it's larger (up to 255), it is a 256-color extended
value.

Given these magic numbers, it is often hard to see what is
going on in the code. Let's refactor this into a struct with
a flag that tells which scheme we are using, along with a
numeric value. This is more verbose, but should hopefully be
simpler to follow. It will also allow us to easily add
support for more schemes, like 24-bit RGB values.

The result is also slightly less efficient to store, but
that's OK; we only store this intermediate state during the
parse, after which we write out the actual ANSI bytes.

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

Merge branch 'jn/parse-config-slot' into jk/colorsJunio C Hamano Thu, 20 Nov 2014 19:40:29 +0000 (11:40 -0800)

Merge branch 'jn/parse-config-slot' into jk/colors

* jn/parse-config-slot:
color_parse: do not mention variable name in error message
pass config slots as pointers instead of offsets

t4026: test "normal" colorJeff King Thu, 20 Nov 2014 15:16:09 +0000 (10:16 -0500)

t4026: test "normal" color

If the user specifiers "normal" for a foreground color, this
should be a noop (while this may sound useless, it is the
only way to specify an unchanged foreground color followed
by a specific background color).

We also check that color "-1" does the same thing. This is
not documented, but has worked forever, so let's make sure
we keep supporting it.

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

config: fix parsing of "git config --get-color some... Jeff King Thu, 20 Nov 2014 15:15:51 +0000 (10:15 -0500)

config: fix parsing of "git config --get-color some.key -1"

Most of git-config's command line options use OPT_BIT to
choose an action, and then parse the non-option arguments
in a context-dependent way. However, --get-color and
--get-colorbool are unlike the rest of the options, in that
they are OPT_STRING, taking the option name as a parameter.

This generally works, because we then use the presence of
those strings to set an action bit anyway. But it does mean
that the option-parser will continue looking for options
even after the key (because it is not a non-option; it is an
argument to an option). And running:

git config --get-color some.key -1

(to use "-1" as the default color spec) will barf, claiming
that "-1" is not an option. Instead, we should treat
--get-color and --get-colorbool as action bits, just like
--add, --get, and all the other actions, and then check that
the non-option arguments we got are sane. This fixes the
weirdness above, and makes those two options like all the
others.

This "fixes" a test in t4026, which checked that feeding
"-2" as a color should fail (it does fail, but prior to this
patch, because parseopt barfed, not because we actually ever
tried to parse the color).

This also catches other errors, like:

git config --get-color some.key black blue

which previously silently ignored "blue" (and now will
complain that you gave too many arguments).

There are some possible regressions, though. We now disallow
these, which currently do what you would expect:

# specifying other options after the action
git config --get-color some.key --file whatever

# using long-arg syntax
git config --get-color=some.key

However, we have never advertised these in the
documentation, and in fact they did not work in some older
versions of git. The behavior was apparently switched as an
accidental side effect of d64ec16 (git config: reorganize to
use parseopt, 2009-02-21).

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

docs: describe ANSI 256-color modeJeff King Thu, 20 Nov 2014 15:15:31 +0000 (10:15 -0500)

docs: describe ANSI 256-color mode

Our color specifications have supported the 256-color ANSI
extension for years, but we never documented it.

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

Merge branch 'nd/gitignore-trailing-whitespace' into... Junio C Hamano Wed, 12 Nov 2014 20:13:11 +0000 (12:13 -0800)

Merge branch 'nd/gitignore-trailing-whitespace' into maint

* nd/gitignore-trailing-whitespace:
gitignore.txt: fix spelling of "backslash"

Merge branch 'rs/clean-menu-item-defn' into maintJunio C Hamano Tue, 11 Nov 2014 18:20:13 +0000 (10:20 -0800)

Merge branch 'rs/clean-menu-item-defn' into maint

* rs/clean-menu-item-defn:
clean: use f(void) instead of f() to declare a pointer to a function without arguments

Documentation/config.txt: fix minor typoThomas Quinot Sat, 8 Nov 2014 10:45:39 +0000 (11:45 +0100)

Documentation/config.txt: fix minor typo

Add a missing article at the beginning of a sentence, and rephrase
slightly.

Signed-off-by: Thomas Quinot <thomas@quinot.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.txt: fix typoNicolas Dermine Sun, 9 Nov 2014 16:19:33 +0000 (17:19 +0100)

config.txt: fix typo

Signed-off-by: Nicolas Dermine <nicolas.dermine@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs/credential-store: s/--store/--file/Jeff King Thu, 6 Nov 2014 07:40:32 +0000 (02:40 -0500)

docs/credential-store: s/--store/--file/

The option name "--store" was used early in development, but
never even made it into an applied patch, let alone a
released version of git. I forgot to update the matching
documentation at the time, though.

Noticed-by: Jesse Hopkins <jesse.hopkins@lmco.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitignore.txt: fix spelling of "backslash"Ben North Tue, 4 Nov 2014 22:18:33 +0000 (22:18 +0000)

gitignore.txt: fix spelling of "backslash"

Signed-off-by: Ben North <ben@redfrontdoor.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.1.3 v2.1.3Junio C Hamano Wed, 29 Oct 2014 17:48:38 +0000 (10:48 -0700)

Git 2.1.3

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

Merge branch 'jk/pack-objects-no-bitmap-when-splitting... Junio C Hamano Wed, 29 Oct 2014 17:35:17 +0000 (10:35 -0700)

Merge branch 'jk/pack-objects-no-bitmap-when-splitting' into maint

* jk/pack-objects-no-bitmap-when-splitting:
pack-objects: turn off bitmaps when we split packs

Merge branch 'da/mergetool-meld' into maintJunio C Hamano Wed, 29 Oct 2014 17:35:16 +0000 (10:35 -0700)

Merge branch 'da/mergetool-meld' into maint

* da/mergetool-meld:
mergetools/meld: make usage of `--output` configurable and more robust

Merge branch 'rm/gitweb-start-form' into maintJunio C Hamano Wed, 29 Oct 2014 17:35:16 +0000 (10:35 -0700)

Merge branch 'rm/gitweb-start-form' into maint

* rm/gitweb-start-form:
gitweb: use start_form, not startform that was removed in CGI.pm 4.04

Merge branch 'bc/asciidoc-pretty-formats-fix' into... Junio C Hamano Wed, 29 Oct 2014 17:35:10 +0000 (10:35 -0700)

Merge branch 'bc/asciidoc-pretty-formats-fix' into maint

* bc/asciidoc-pretty-formats-fix:
Documentation: fix misrender of pretty-formats in Asciidoctor

Merge branch 'rs/daemon-fixes' into maintJunio C Hamano Wed, 29 Oct 2014 17:35:09 +0000 (10:35 -0700)

Merge branch 'rs/daemon-fixes' into maint

* rs/daemon-fixes:
daemon: remove write-only variable maxfd
daemon: fix error message after bind()
daemon: handle gethostbyname() error

pack-objects: turn off bitmaps when we split packsJeff King Fri, 17 Oct 2014 01:11:43 +0000 (21:11 -0400)

pack-objects: turn off bitmaps when we split packs

If a pack.packSizeLimit is set, we may split the pack data
across multiple packfiles. This means we cannot generate
.bitmap files, as they require that all of the reachable
objects are in the same pack. We check that condition when
we are generating the list of objects to pack (and disable
bitmaps if we are not packing everything), but we forgot to
update it when we notice that we needed to split (which
doesn't happen until the actual write phase).

The resulting bitmaps are quite bogus (they mention entries
that do not exist in the pack!) and can cause a fetch or
push to send insufficient objects.

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

gitweb: use start_form, not startform that was removed... Roland Mas Thu, 16 Oct 2014 06:54:47 +0000 (08:54 +0200)

gitweb: use start_form, not startform that was removed in CGI.pm 4.04

CGI.pm 4.04 removed the startform method, which had previously been
deprecated in favour of start_form. Changes file for CGI.pm says:

4.04 2014-09-04
[ REMOVED / DEPRECATIONS ]
- startform and endform methods removed (previously deprecated,
you should be using the start_form and end_form methods)

Signed-off-by: Roland Mas <lolando@debian.org>
Reviewed-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mergetools/meld: make usage of `--output` configurable... David Aguilar Thu, 16 Oct 2014 04:45:14 +0000 (21:45 -0700)

mergetools/meld: make usage of `--output` configurable and more robust

Older versions of meld listed --output in `meld --help`.
Newer versions only mention `meld [OPTIONS...]`.
Improve the checks to catch these newer versions.

Add a `mergetool.meld.hasOutput` configuration to allow
overriding the heuristic.

Reported-by: Andrey Novoseltsev <novoselt@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

color_parse: do not mention variable name in error... Jeff King Tue, 7 Oct 2014 19:33:09 +0000 (15:33 -0400)

color_parse: do not mention variable name in error message

Originally the color-parsing function was used only for
config variables. It made sense to pass the variable name so
that the die() message could be something like:

$ git -c color.branch.plain=bogus branch
fatal: bad color value 'bogus' for variable 'color.branch.plain'

These days we call it in other contexts, and the resulting
error messages are a little confusing:

$ git log --pretty='%C(bogus)'
fatal: bad color value 'bogus' for variable '--pretty format'

$ git config --get-color foo.bar bogus
fatal: bad color value 'bogus' for variable 'command line'

This patch teaches color_parse to complain only about the
value, and then return an error code. Config callers can
then propagate that up to the config parser, which mentions
the variable name. Other callers can provide a custom
message. After this patch these three cases now look like:

$ git -c color.branch.plain=bogus branch
error: invalid color value: bogus
fatal: unable to parse 'color.branch.plain' from command-line config

$ git log --pretty='%C(bogus)'
error: invalid color value: bogus
fatal: unable to parse --pretty format

$ git config --get-color foo.bar bogus
error: invalid color value: bogus
fatal: unable to parse default color value

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

pass config slots as pointers instead of offsetsJonathan Nieder Tue, 7 Oct 2014 19:16:57 +0000 (15:16 -0400)

pass config slots as pointers instead of offsets

Many config-parsing helpers, like parse_branch_color_slot,
take the name of a config variable and an offset to the
"slot" name (e.g., "color.branch.plain" is passed along with
"13" to effectively pass "plain"). This is leftover from the
time that these functions would die() on error, and would
want the full variable name for error reporting.

These days they do not use the full variable name at all.
Passing a single pointer to the slot name is more natural,
and lets us more easily adjust the callers to use skip_prefix
to avoid manually writing offset numbers.

This is effectively a continuation of 9e1a5eb, which did the
same for parse_diff_color_slot. This patch covers all of the
remaining similar constructs.

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>

Documentation: fix misrender of pretty-formats in Ascii... brian m. carlson Wed, 8 Oct 2014 20:46:10 +0000 (20:46 +0000)

Documentation: fix misrender of pretty-formats in Asciidoctor

Neither the AsciiDoc nor the Asciidoctor documentation specify whether
the same number of delimiter characters must be used to end a block as
to begin it, although both sets of documentation show exactly matching
pairs. AsciiDoc allows mismatches, but AsciiDoctor apparently does not.
Adjust the pretty formats documentation to use matching pairs to prevent
a misrendering where the remainder of the document was rendered as a
listing block.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint-2.0' into maintJunio C Hamano Tue, 7 Oct 2014 20:40:51 +0000 (13:40 -0700)

Merge branch 'maint-2.0' into maint

* maint-2.0:
git-tag.txt: Add a missing hyphen to `-s`

Merge branch 'maint-1.9' into maint-2.0Junio C Hamano Tue, 7 Oct 2014 20:40:39 +0000 (13:40 -0700)

Merge branch 'maint-1.9' into maint-2.0

* maint-1.9:
git-tag.txt: Add a missing hyphen to `-s`

Merge branch 'maint-1.8.5' into maint-1.9Junio C Hamano Tue, 7 Oct 2014 20:40:19 +0000 (13:40 -0700)

Merge branch 'maint-1.8.5' into maint-1.9

* maint-1.8.5:
git-tag.txt: Add a missing hyphen to `-s`

Merge branch 'jk/mbox-from-line' into maintJunio C Hamano Tue, 7 Oct 2014 20:39:24 +0000 (13:39 -0700)

Merge branch 'jk/mbox-from-line' into maint

Some MUAs mangled a line in a message that begins with "From " to
">From " when writing to a mailbox file and feeding such an input to
"git am" used to lose such a line.

* jk/mbox-from-line:
mailinfo: work around -Wstring-plus-int warning
mailinfo: make ">From" in-body header check more robust

git-tag.txt: Add a missing hyphen to `-s`Wieland Hoffmann Sat, 4 Oct 2014 16:27:16 +0000 (18:27 +0200)

git-tag.txt: Add a missing hyphen to `-s`

Signed-off-by: Wieland Hoffmann <themineo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

daemon: remove write-only variable maxfdRené Scharfe Wed, 1 Oct 2014 10:21:57 +0000 (12:21 +0200)

daemon: remove write-only variable maxfd

It became unused when 6573faff (NO_IPV6 support for git daemon) replaced
select() with poll().

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

daemon: fix error message after bind()René Scharfe Wed, 1 Oct 2014 10:18:15 +0000 (12:18 +0200)

daemon: fix error message after bind()

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

daemon: handle gethostbyname() errorRené Scharfe Wed, 1 Oct 2014 10:16:17 +0000 (12:16 +0200)

daemon: handle gethostbyname() error

If the user-supplied hostname can't be found then we should not use it.
We already avoid doing that in the non-NO_IPV6 case by checking if the
return value of getaddrinfo() is zero (success). Do the same in the
NO_IPV6 case and make sure the return value of gethostbyname() isn't
NULL before dereferencing this pointer.

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

Git 2.1.2 v2.1.2Junio C Hamano Tue, 30 Sep 2014 05:15:00 +0000 (22:15 -0700)

Git 2.1.2

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

Merge branch 'jk/fsck-exit-code-fix' into maintJunio C Hamano Tue, 30 Sep 2014 05:10:55 +0000 (22:10 -0700)

Merge branch 'jk/fsck-exit-code-fix' into maint

"git fsck" failed to report that it found corrupt objects via its
exit status in some cases.

* jk/fsck-exit-code-fix:
fsck: return non-zero status on missing ref tips
fsck: exit with non-zero status upon error from fsck_obj()

Merge branch 'ta/config-add-to-empty-or-true-fix' into... Junio C Hamano Tue, 30 Sep 2014 05:10:25 +0000 (22:10 -0700)

Merge branch 'ta/config-add-to-empty-or-true-fix' into maint

"git config --add section.var val" used to lose existing
section.var whose value was an empty string.

* ta/config-add-to-empty-or-true-fix:
config: avoid a funny sentinel value "a^"
make config --add behave correctly for empty and NULL values

Merge branch 'mk/reachable-protect-detached-head' into... Junio C Hamano Tue, 30 Sep 2014 05:10:04 +0000 (22:10 -0700)

Merge branch 'mk/reachable-protect-detached-head' into maint

Reachability check (used in "git prune" and friends) did not add a
detached HEAD as a starting point to traverse objects still in use.

* mk/reachable-protect-detached-head:
reachable.c: add HEAD to reachability starting commits

Merge branch 'mb/fast-import-delete-root' into maintJunio C Hamano Tue, 30 Sep 2014 05:09:47 +0000 (22:09 -0700)

Merge branch 'mb/fast-import-delete-root' into maint

An attempt to remove the entire tree in the "git fast-import" input
stream caused it to misbehave.

* mb/fast-import-delete-root:
fast-import: fix segfault in store_tree()
t9300: test filedelete command

Merge branch 'jk/index-pack-threading-races' into maintJunio C Hamano Tue, 30 Sep 2014 05:09:24 +0000 (22:09 -0700)

Merge branch 'jk/index-pack-threading-races' into maint

When receiving an invalid pack stream that records the same object
twice, multiple threads got confused due to a race.

* jk/index-pack-threading-races:
index-pack: fix race condition with duplicate bases

Merge branch 'jk/send-pack-many-refspecs' into maintJunio C Hamano Tue, 30 Sep 2014 05:08:17 +0000 (22:08 -0700)

Merge branch 'jk/send-pack-many-refspecs' into maint

"git push" over HTTP transport had an artificial limit on number of
refs that can be pushed imposed by the command line length.

* jk/send-pack-many-refspecs:
send-pack: take refspecs over stdin

Merge branch 'so/rebase-doc' into maintJunio C Hamano Tue, 30 Sep 2014 05:08:12 +0000 (22:08 -0700)

Merge branch 'so/rebase-doc' into maint

* so/rebase-doc:
Documentation/git-rebase.txt: <upstream> must be given to specify <branch>
Documentation/git-rebase.txt: -f forces a rebase that would otherwise be a no-op

Merge branch 'maint' of git://github.com/git-l10n/git... Junio C Hamano Sun, 28 Sep 2014 07:02:57 +0000 (00:02 -0700)

Merge branch 'maint' of git://github.com/git-l10n/git-po into maint

* 'maint' of git://github.com/git-l10n/git-po:
l10n: de.po: use comma before "um"
l10n: de.po: change Email to E-Mail
po/TEAMS: add new member to German translation team

l10n: de.po: use comma before "um"Phillip Sz Tue, 23 Sep 2014 12:00:52 +0000 (14:00 +0200)

l10n: de.po: use comma before "um"

This patch adds a comma before the "um". See:
http://www.duden.de/sprachwissen/rechtschreibregeln/komma#K117

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

l10n: de.po: change Email to E-MailPhillip Sz Sat, 20 Sep 2014 15:51:53 +0000 (17:51 +0200)

l10n: de.po: change Email to E-Mail

Change all Email to E-Mail, as this is the correct form in German.

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

po/TEAMS: add new member to German translation teamRalf Thielow Fri, 5 Sep 2014 16:30:49 +0000 (18:30 +0200)

po/TEAMS: add new member to German translation team

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

mailinfo: work around -Wstring-plus-int warningEric Sunshine Sun, 21 Sep 2014 09:13:58 +0000 (05:13 -0400)

mailinfo: work around -Wstring-plus-int warning

The just-released Apple Xcode 6.0.1 has -Wstring-plus-int enabled by
default which complains about pointer arithmetic applied to a string
literal:

builtin/mailinfo.c:303:24: warning:
adding 'long' to a string does not append to the string
return !memcmp(SAMPLE + (cp - line), cp, strlen(SAMPLE) ...
~~~~~~~^~~~~~~~~~~~~

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

Git 2.1.1 v2.1.1Junio C Hamano Fri, 19 Sep 2014 21:21:31 +0000 (14:21 -0700)

Git 2.1.1

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

Merge branch 'et/spell-poll-infinite-with-minus-one... Junio C Hamano Fri, 19 Sep 2014 21:05:13 +0000 (14:05 -0700)

Merge branch 'et/spell-poll-infinite-with-minus-one-only' into maint

* et/spell-poll-infinite-with-minus-one-only:
upload-pack: keep poll(2)'s timeout to -1

Merge branch 'nd/fetch-pass-quiet-to-gc-child-process... Junio C Hamano Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)

Merge branch 'nd/fetch-pass-quiet-to-gc-child-process' into maint

* nd/fetch-pass-quiet-to-gc-child-process:
fetch: silence git-gc if --quiet is given
fetch: convert argv_gc_auto to struct argv_array

Merge branch 'jk/prune-top-level-refs-after-packing... Junio C Hamano Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)

Merge branch 'jk/prune-top-level-refs-after-packing' into maint

* jk/prune-top-level-refs-after-packing:
pack-refs: prune top-level refs like "refs/foo"

Merge branch 'jk/fast-import-fixes' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)

Merge branch 'jk/fast-import-fixes' into maint

* jk/fast-import-fixes:
fast-import: fix buffer overflow in dump_tags
fast-import: clean up pack_data pointer in end_packfile

Merge branch 'jn/unpack-trees-checkout-m-carry-deletion... Junio C Hamano Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)

Merge branch 'jn/unpack-trees-checkout-m-carry-deletion' into maint

* jn/unpack-trees-checkout-m-carry-deletion:
checkout -m: attempt merge when deletion of path was staged
unpack-trees: use 'cuddled' style for if-else cascade
unpack-trees: simplify 'all other failures' case

Merge branch 'sp/pack-protocol-doc-on-shallow' into... Junio C Hamano Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)

Merge branch 'sp/pack-protocol-doc-on-shallow' into maint

* sp/pack-protocol-doc-on-shallow:
Document LF appearing in shallow command during send-pack/receive-pack

Merge branch 'jk/prompt-stash-could-be-packed' into... Junio C Hamano Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)

Merge branch 'jk/prompt-stash-could-be-packed' into maint

* jk/prompt-stash-could-be-packed:
git-prompt: do not look for refs/stash in $GIT_DIR

Merge branch 'rs/refresh-beyond-symlink' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)

Merge branch 'rs/refresh-beyond-symlink' into maint

* rs/refresh-beyond-symlink:
read-cache: check for leading symlinks when refreshing index

Merge branch 'lf/bundle-exclusion' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)

Merge branch 'lf/bundle-exclusion' into maint

* lf/bundle-exclusion:
bundle: fix exclusion of annotated tags

Merge branch 'jc/apply-ws-prefix' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:10 +0000 (14:05 -0700)

Merge branch 'jc/apply-ws-prefix' into maint

* jc/apply-ws-prefix:
apply: omit ws check for excluded paths
apply: hoist use_patch() helper for path exclusion up
apply: use the right attribute for paths in non-Git patches

Conflicts:
builtin/apply.c

Merge branch 'jk/command-line-config-empty-string'... Junio C Hamano Fri, 19 Sep 2014 21:05:10 +0000 (14:05 -0700)

Merge branch 'jk/command-line-config-empty-string' into maint

* jk/command-line-config-empty-string:
config: teach "git -c" to recognize an empty string

Conflicts:
config.c

Merge branch 'jk/pretty-empty-format' into maintJunio C Hamano Fri, 19 Sep 2014 21:05:09 +0000 (14:05 -0700)

Merge branch 'jk/pretty-empty-format' into maint

* jk/pretty-empty-format:
pretty: make empty userformats truly empty
pretty: treat "--format=" as an empty userformat
revision: drop useless string offset when parsing "--pretty"

Documentation/git-rebase.txt: <upstream> must be given... Sergey Organov Fri, 29 Aug 2014 13:51:46 +0000 (17:51 +0400)

Documentation/git-rebase.txt: <upstream> must be given to specify <branch>

Current syntax description makes one wonder if there is any
syntactic way to distinguish between <branch> and <upstream> so that
one can specify <branch> but not <upstream>, but that is not the
case.

Make it explicit that these arguments are positional, i.e. the
earlier ones cannot be omitted if you want to give later ones.

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

mailinfo: make ">From" in-body header check more robustJeff King Sun, 14 Sep 2014 01:30:38 +0000 (21:30 -0400)

mailinfo: make ">From" in-body header check more robust

Since commit 81c5cf7 (mailinfo: skip bogus UNIX From line inside
body, 2006-05-21), we have treated lines like ">From" in the body as
headers. This makes "git am" work for people who erroneously paste
the whole output from format-patch:

From 12345abcd...fedcba543210 Mon Sep 17 00:00:00 2001
From: them
Subject: [PATCH] whatever

into their email body (assuming that an mbox writer then quotes
"From" as ">From", as otherwise we would actually mailsplit on the
in-body line).

However, this has false positives if somebody actually has a commit
body that starts with "From "; in this case we erroneously remove
the line entirely from the commit message. We can make this check
more robust by making sure the line actually looks like a real mbox
"From" line.

Inspect the line that begins with ">From " a more carefully to only
skip lines that match the expected pattern (note that the datestamp
part of the format-patch output is designed to be kept constant to
help those who write magic(5) entries).

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

fsck: return non-zero status on missing ref tipsJeff King Fri, 12 Sep 2014 03:38:30 +0000 (23:38 -0400)

fsck: return non-zero status on missing ref tips

Fsck tries hard to detect missing objects, and will complain
(and exit non-zero) about any inter-object links that are
missing. However, it will not exit non-zero for any missing
ref tips, meaning that a severely broken repository may
still pass "git fsck && echo ok".

The problem is that we use for_each_ref to iterate over the
ref tips, which hides broken tips. It does at least print an
error from the refs.c code, but fsck does not ever see the
ref and cannot note the problem in its exit code. We can solve
this by using for_each_rawref and noting the error ourselves.

In addition to adding tests for this case, we add tests for
all types of missing-object links (all of which worked, but
which we were not testing).

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

config: avoid a funny sentinel value "a^"Jeff King Tue, 19 Aug 2014 06:20:00 +0000 (02:20 -0400)

config: avoid a funny sentinel value "a^"

Introduce CONFIG_REGEX_NONE as a more explicit sentinel value to say
"we do not want to replace any existing entry" and use it in the
implementation of "git config --add".

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

fsck: exit with non-zero status upon error from fsck_obj()Jeff King Fri, 29 Aug 2014 20:31:46 +0000 (16:31 -0400)

fsck: exit with non-zero status upon error from fsck_obj()

Upon finding a corrupt loose object, we forgot to note the error to
signal it with the exit status of the entire process.

[jc: adjusted t1450 and added another test]

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

reachable.c: add HEAD to reachability starting commitsMax Kirillov Wed, 3 Sep 2014 16:14:10 +0000 (19:14 +0300)

reachable.c: add HEAD to reachability starting commits

HEAD is not explicitly used as a starting commit for
calculating reachability, so if it's detached and reflogs
are disabled it may be pruned.

Add tests which demonstrate it. Test 'prune: prune former HEAD after checking
out branch' also reverts changes to repository.

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

index-pack: fix race condition with duplicate basesJeff King Fri, 29 Aug 2014 20:57:47 +0000 (16:57 -0400)

index-pack: fix race condition with duplicate bases

When we are resolving deltas in an indexed pack, we do it by
first selecting a potential base (either one stored in full
in the pack, or one created by resolving another delta), and
then resolving any deltas that use that base. When we
resolve a particular delta, we flip its "real_type" field
from OBJ_{REF,OFS}_DELTA to whatever the real type is.

We assume that traversing the objects this way will visit
each delta only once. This is correct for most packs; we
visit the delta only when we process its base, and each
object (and thus each base) appears only once. However, if a
base object appears multiple times in the pack, we will try
to resolve any deltas based on it once for each instance.

We can detect this case by noting that a delta we are about
to resolve has already had its real_type field flipped, and
we already do so with an assert(). However, if multiple
threads are in use, we may race with another thread on
comparing and flipping the field. We need to synchronize the
access.

The right mechanism for doing this is a compare-and-swap (we
atomically "claim" the delta for our own and find out
whether our claim was successful). We can implement this
in C by using a pthread mutex to protect the operation. This
is not the fastest way of doing a compare-and-swap; many
processors provide instructions for this, and gcc and other
compilers provide builtins to access them. However, some
experiments showed that lock contention does not cause a
significant slowdown here. Adding c-a-s support for many
compilers would increase the maintenance burden (and we
would still end up including the pthread version as a
fallback).

Note that we only need to touch the OBJ_REF_DELTA codepath
here. An OBJ_OFS_DELTA object points to its base using an
offset, and therefore has only one base, even if another
copy of that base object appears in the pack (we do still
touch it briefly because the setting of real_type is
factored out of resolve_data).

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

fast-import: fix segfault in store_tree()Maxim Bublis Fri, 29 Aug 2014 11:53:37 +0000 (15:53 +0400)

fast-import: fix segfault in store_tree()

Branch tree is NULLified by filedelete command if we are trying
to delete root tree. Add sanity check and use load_tree() in that case.

Signed-off-by: Maxim Bublis <satori@yandex-team.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9300: test filedelete commandMaxim Bublis Fri, 29 Aug 2014 11:53:36 +0000 (15:53 +0400)

t9300: test filedelete command

Add new fast-import test series for filedelete command.

Signed-off-by: Maxim Bublis <satori@yandex-team.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://github.com/git-l10n/git-poJunio C Hamano Fri, 29 Aug 2014 17:18:22 +0000 (10:18 -0700)

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

* git://github.com/git-l10n/git-po:
po/TEAMS: add new members to German translation team
l10n: de.po: translate 38 new messages

po/TEAMS: add new members to German translation teamRalf Thielow Tue, 26 Aug 2014 16:54:30 +0000 (18:54 +0200)

po/TEAMS: add new members to German translation team

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

l10n: de.po: translate 38 new messagesRalf Thielow Fri, 20 Jun 2014 15:22:48 +0000 (17:22 +0200)

l10n: de.po: translate 38 new messages

Translate 38 new messages came from git.pot update in fe05e19
(l10n: git.pot: v2.1.0 round 1 (38 new, 9 removed)).

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

Document LF appearing in shallow command during send... Shawn Pearce Wed, 27 Aug 2014 20:46:56 +0000 (13:46 -0700)

Document LF appearing in shallow command during send-pack/receive-pack

The implementation sends an LF, but the protocol documentation was
missing this detail.

Signed-off-by: Shawn Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

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>

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

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

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>

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>

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>

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>

make config --add behave correctly for empty and NULL... Tanay Abhra Mon, 18 Aug 2014 10:17:57 +0000 (03:17 -0700)

make config --add behave correctly for empty and NULL values

Currently if we have a config file like,
[foo]
baz
bar =

and we try something like, "git config --add foo.baz roll", Git will
segfault. Moreover, for "git config --add foo.bar roll", it will
overwrite the original value instead of appending after the existing
empty value.

The problem lies with the regexp used for simulating --add in
`git_config_set_multivar_in_file()`, "^$", which in ideal case should
not match with any string but is true for empty strings. Instead use a
regexp like "a^" which can not be true for any string, empty or not.

For removing the segfault add a check for NULL values in `matches()` in
config.c.

Signed-off-by: Tanay Abhra <tanayabh@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>

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>

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>

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>

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>

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