gitweb.git
upload-archive: use argv_array to store client argumentsJeff King Wed, 20 Feb 2013 20:01:26 +0000 (15:01 -0500)

upload-archive: use argv_array to store client arguments

The current parsing scheme for upload-archive is to pack
arguments into a fixed-size buffer, separated by NULs, and
put a pointer to each argument in the buffer into a
fixed-size argv array.

This works fine, and the limits are high enough that nobody
reasonable is going to hit them, but it makes the code hard
to follow. Instead, let's just stuff the arguments into an
argv_array, which is much simpler. That lifts the "all
arguments must fit inside 4K together" limit.

We could also trivially lift the MAX_ARGS limitation (in
fact, we have to keep extra code to enforce it). But that
would mean a client could force us to allocate an arbitrary
amount of memory simply by sending us "argument" lines. By
limiting the MAX_ARGS, we limit an attacker to about 4
megabytes (64 times a maximum 64K packet buffer). That may
sound like a lot compared to the 4K limit, but it's not a
big deal compared to what git-archive will actually allocate
while working (e.g., to load blobs into memory). The
important thing is that it is bounded.

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

upload-archive: do not copy repo nameJeff King Wed, 20 Feb 2013 20:00:59 +0000 (15:00 -0500)

upload-archive: do not copy repo name

According to the comment, enter_repo will modify its input.
However, this has not been the case since 1c64b48
(enter_repo: do not modify input, 2011-10-04). Drop the
now-useless copy.

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

send-pack: prefer prefixcmp over memcmp in receive_statusJeff King Wed, 20 Feb 2013 20:00:43 +0000 (15:00 -0500)

send-pack: prefer prefixcmp over memcmp in receive_status

This code predates prefixcmp, so it used memcmp along with
static sizes. Replacing these memcmps with prefixcmp makes
the code much more readable, and the lack of static sizes
will make refactoring it in future patches simpler.

Note that we used to be unnecessarily liberal in parsing the
"unpack" status line, and would accept "unpack ok\njunk". No
version of git has ever produced that, and it violates the
BNF in Documentation/technical/pack-protocol.txt. Let's take
this opportunity to tighten the check by converting the
prefix comparison into a strcmp.

While we're in the area, let's also fix a vague error
message that does not follow our usual conventions (it
writes directly to stderr and does not use the "error:"
prefix).

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

fetch-pack: fix out-of-bounds buffer offset in get_ackJeff King Wed, 20 Feb 2013 20:00:28 +0000 (15:00 -0500)

fetch-pack: fix out-of-bounds buffer offset in get_ack

When we read acks from the remote, we expect either:

ACK <sha1>

or

ACK <sha1> <multi-ack-flag>

We parse the "ACK <sha1>" bit from the line, and then start
looking for the flag strings at "line+45"; if we don't have
them, we assume it's of the first type. But if we do have
the first type, then line+45 is not necessarily inside our
string at all!

It turns out that this works most of the time due to the way
we parse the packets. They should come in with a newline,
and packet_read puts an extra NUL into the buffer, so we end
up with:

ACK <sha1>\n\0

with the newline at offset 44 and the NUL at offset 45. We
then strip the newline, putting a NUL at offset 44. So
when we look at "line+45", we are looking past the end of
our string; but it's OK, because we hit the terminator from
the original string.

This breaks down, however, if the other side does not
terminate their packets with a newline. In that case, our
packet is one character shorter, and we start looking
through uninitialized memory for the flag. No known
implementation sends such a packet, so it has never come up
in practice.

This patch tightens the check by looking for a short,
flagless ACK before trying to parse the flag.

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

upload-pack: remove packet debugging harnessJeff King Wed, 20 Feb 2013 19:55:28 +0000 (14:55 -0500)

upload-pack: remove packet debugging harness

If you set the GIT_DEBUG_SEND_PACK environment variable,
upload-pack will dump lines it receives in the receive_needs
phase to a descriptor. This debugging harness is a strict
subset of what GIT_TRACE_PACKET can do. Let's just drop it
in favor of that.

A few tests used GIT_DEBUG_SEND_PACK to confirm which
objects get sent; we have to adapt them to the new output
format.

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

upload-pack: do not add duplicate objects to shallow... Jeff King Wed, 20 Feb 2013 19:54:57 +0000 (14:54 -0500)

upload-pack: do not add duplicate objects to shallow list

When the client tells us it has a shallow object via
"shallow <sha1>", we make sure we have the object, mark it
with a flag, then add it to a dynamic array of shallow
objects. This means that a client can get us to allocate
arbitrary amounts of memory just by flooding us with shallow
lines (whether they have the objects or not). You can
demonstrate it easily with:

yes '0035shallow e83c5163316f89bfbde7d9ab23ca2e25604af290' |
git-upload-pack git.git

We already protect against duplicates in want lines by
checking if our flag is already set; let's do the same thing
here. Note that a client can still get us to allocate some
amount of memory by marking every object in the repo as
"shallow" (or "want"). But this at least bounds it with the
number of objects in the repository, which is not under the
control of an upload-pack client.

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

upload-pack: use get_sha1_hex to parse "shallow" linesJeff King Wed, 20 Feb 2013 19:53:33 +0000 (14:53 -0500)

upload-pack: use get_sha1_hex to parse "shallow" lines

When we receive a line like "shallow <sha1>" from the
client, we feed the <sha1> part to get_sha1. This is a
mistake, as the argument on a shallow line is defined by
Documentation/technical/pack-protocol.txt to contain an
"obj-id". This is never defined in the BNF, but it is clear
from the text and from the other uses that it is meant to be
a hex sha1, not an arbitrary identifier (and that is what
fetch-pack has always sent).

We should be using get_sha1_hex instead, which doesn't allow
the client to request arbitrary junk like "HEAD@{yesterday}".
Because this is just marking shallow objects, the client
couldn't actually do anything interesting (like fetching
objects from unreachable reflog entries), but we should keep
our parsing tight to be on the safe side.

Because get_sha1 is for the most part a superset of
get_sha1_hex, in theory the only behavior change should be
disallowing non-hex object references. However, there is
one interesting exception: get_sha1 will only parse
a 40-character hex sha1 if the string has exactly 40
characters, whereas get_sha1_hex will just eat the first 40
characters, leaving the rest. That means that current
versions of git-upload-pack will not accept a "shallow"
packet that has a trailing newline, even though the protocol
documentation is clear that newlines are allowed (even
encouraged) in non-binary parts of the protocol.

This never mattered in practice, though, because fetch-pack,
contrary to the protocol documentation, does not include a
newline in its shallow lines. JGit follows its lead (though
it correctly is strict on the parsing end about wanting a
hex object id).

We do not adjust fetch-pack to send newlines here, as it
would break communication with older versions of git (and
there is no actual benefit to doing so, except for
consistency with other parts of the protocol).

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

t7800: update copyright noticeDavid Aguilar Wed, 20 Feb 2013 05:35:26 +0000 (21:35 -0800)

t7800: update copyright notice

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with v1.8.1.4Junio C Hamano Wed, 20 Feb 2013 05:57:27 +0000 (21:57 -0800)

Sync with v1.8.1.4

Git 1.8.1.4 v1.8.1.4Junio C Hamano Tue, 19 Feb 2013 05:48:05 +0000 (05:48 +0000)

Git 1.8.1.4

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

Merge branch 'ob/imap-send-ssl-verify' into maintJunio C Hamano Wed, 20 Feb 2013 05:54:15 +0000 (21:54 -0800)

Merge branch 'ob/imap-send-ssl-verify' into maint

* ob/imap-send-ssl-verify:
imap-send: support subjectAltName as well
imap-send: the subject of SSL certificate must match the host
imap-send: move #ifdef around

imap-send: support subjectAltName as wellOswald Buddenhagen Fri, 15 Feb 2013 20:59:53 +0000 (12:59 -0800)

imap-send: support subjectAltName as well

Check not only the common name of the certificate subject, but also
check the subject alternative DNS names as well, when verifying that
the certificate matches that of the host we are trying to talk to.

Signed-off-by: Oswald Buddenhagen <ossi@kde.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: the subject of SSL certificate must match... Oswald Buddenhagen Fri, 15 Feb 2013 20:50:35 +0000 (12:50 -0800)

imap-send: the subject of SSL certificate must match the host

We did not check a valid certificate's subject at all, and would
have happily talked with a wrong host after connecting to an
incorrect address and getting a valid certificate that does not
belong to the host we intended to talk to.

Signed-off-by: Oswald Buddenhagen <ossi@kde.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: vi.po: Updated 5 new messages (2009t0f0u)Tran Ngoc Quan Wed, 20 Feb 2013 00:16:44 +0000 (07:16 +0700)

l10n: vi.po: Updated 5 new messages (2009t0f0u)

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>

Bugfix: undefined htmldir in config.mak.autogenJiang Xin Tue, 19 Feb 2013 11:23:29 +0000 (19:23 +0800)

Bugfix: undefined htmldir in config.mak.autogen

Html documents will be installed to root dir (/) no matter what prefix
is set, if run these commands before `make` and `make install-html`:

$ make configure
$ ./configure --prefix=<PREFIX>

After the installation, all the html documents will copy to rootdir (/),
and:

$ git --html-path
<PREFIX>

$ git help -w something
fatal: '<PREFIX>': not a documentation directory.

This is because the variable "htmldir" points to a undefined variable
"$(docdir)" in file "config.mak.autogen", which is generated by running
`./configure`. By default $(docdir) generated by configure is supposed
be set this way:

datarootdir='${prefix}/share'
htmldir='${docdir}'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'

but since fc1c5415d69d (Honor configure's htmldir switch, 2013-02-02),
we only set and export htmldir without doing so for PACKAGE_TARNAME
(which is set to 'git' by the configure script).

Add the required two variables "PACKAGE_TARNAME" and "docdir" to file
"config.mak.in" will work this issue around.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

name-hash: allow hashing an empty stringJunio C Hamano Tue, 19 Feb 2013 19:56:44 +0000 (11:56 -0800)

name-hash: allow hashing an empty string

Usually we do not pass an empty string to the function hash_name()
because we almost always ask for hash values for a path that is a
candidate to be added to the index. However, check-ignore (and most
likely check-attr, but I didn't check) apparently has a callchain
to ask the hash value for an empty path when it was given a "." from
the top-level directory to ask "Is the path . excluded by default?"

Make sure that hash_name() does not overrun the end of the given
pathname even when it is empty.

Remove a sweep-the-issue-under-the-rug conditional in check-ignore
that avoided to pass an empty string to the callchain while at it.
It is a valid question to ask for check-ignore if the top-level is
set to be ignored by default, even though the answer is most likely
no, if only because there is currently no way to specify such an
entry in the .gitignore file. But it is an unusual thing to ask and
it is not worth optimizing for it by special casing at the top level
of the call chain.

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

user-manual: Flesh out uncommitted changes and submodul... W. Trevor King Tue, 19 Feb 2013 10:05:02 +0000 (05:05 -0500)

user-manual: Flesh out uncommitted changes and submodule updates

If you try and update a submodule with a dirty working directory, you
get an error message like:

$ git submodule update
error: Your local changes to the following files would be overwritten by checkout:
...
Please, commit your changes or stash them before you can switch branches.
Aborting
...

Mention this in the submodule notes. The previous phrase was short
enough that I originally thought it might have been referring to the
reflog note (obviously, uncommitted changes will not show up in the
reflog either ;).

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

user-manual: Use request-pull to generate "please pull... W. Trevor King Tue, 19 Feb 2013 10:05:01 +0000 (05:05 -0500)

user-manual: Use request-pull to generate "please pull" text

Less work and more error checking (e.g. does a merge base exist?).
Add an explicit push before request-pull to satisfy request-pull,
which checks to make sure the references are publically available.

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

user-manual: Reorganize the reroll sections, adding... W. Trevor King Tue, 19 Feb 2013 10:05:00 +0000 (05:05 -0500)

user-manual: Reorganize the reroll sections, adding 'git rebase -i'

I think this interface is often more convenient than extended cherry
picking or using 'git format-patch'. In fact, I removed the
cherry-pick section entirely. The entry-level suggestions for
rerolling are now:

1. git commit --amend
2. git format-patch origin
git reset --hard origin
...edit and reorder patches...
git am *.patch
3. git rebase -i origin

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

Documentation/git-commit.txt: rework the --cleanup... Brandon Casey Tue, 19 Feb 2013 18:14:13 +0000 (10:14 -0800)

Documentation/git-commit.txt: rework the --cleanup section

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0008: document test_expect_success_multiAdam Spiers Tue, 19 Feb 2013 14:06:22 +0000 (14:06 +0000)

t0008: document test_expect_success_multi

test_expect_success_multi() helper function warrants some explanation,
since at first sight it may seem like generic test framework plumbing,
but is in fact specific to testing check-ignore, and allows more
thorough testing of the various output formats without significantly
increase the size of t0008.

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-commit: only append a newline to -m mesg if necessaryBrandon Casey Tue, 19 Feb 2013 04:17:06 +0000 (20:17 -0800)

git-commit: only append a newline to -m mesg if necessary

Currently, git will append two newlines to every message supplied via
the -m switch. The purpose of this is to allow -m to be supplied
multiple times and have each supplied string become a paragraph in the
resulting commit message.

Normally, this does not cause a problem since any trailing newlines will
be removed by the cleanup operation. If cleanup=verbatim for example,
then the trailing newlines will not be removed and will survive into the
resulting commit message.

Instead, let's ensure that the string supplied to -m is newline terminated,
but only append a second newline when appending additional messages.

Fixes the test in t7502.

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

t7502: demonstrate breakage with a commit message with... Brandon Casey Tue, 19 Feb 2013 04:17:05 +0000 (20:17 -0800)

t7502: demonstrate breakage with a commit message with trailing newlines

This test attempts to verify that a commit message supplied to 'git
commit' via the -m switch was used in full as the commit message for a
commit when --cleanup=verbatim was used.

But, this test has been broken since it was introduced. Since the
commit message containing trailing newlines was supplied to 'git commit'
using a command substitution, the trailing newlines were removed by the
shell. This means that a string without any trailing newlines was
actually supplied to 'git commit'.

The test was able to complete successfully since internally, git appends
two newlines to each string supplied via the -m switch. So, the two
newlines removed by the shell were then re-added by git, and the
resulting commit matched what was expected.

So, let's move the initial creation of the commit message string out
from within a previous test so that it stands alone. Assign the desired
commit message to a variable using literal newlines. Then populate the
expect file from the contents of the commit message variable. This way
the shell variable becomes the authoritative source of the commit
message and can be supplied via the -m switch with the trailing newlines
intact.

Mark this test as failing, since it is not handled correctly by git.
As described above, git appends two extra newlines to every string
supplied via -m, even to the ones that already end with a newline.

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

t/t7502: compare entire commit message with what was... Brandon Casey Tue, 19 Feb 2013 04:17:04 +0000 (20:17 -0800)

t/t7502: compare entire commit message with what was expected

This test attempts to verify that a commit in "verbatim" mode, when
supplied a commit template, produces a commit in which the commit
message matches exactly the template that was supplied. But, since the
commit operation appends additional instructions for the user as
comments in the commit buffer, which would cause the comparison to fail,
this test decided to compare only the first three lines (the length of
the template) of the resulting commit message to the original template
file.

This has two problems.

1. It does not allow the template to be lengthened or shortened
without also modifying the number of lines that are considered
significant (i.e. the argument to 'head -n').
2. It will not catch a bug in git that causes git to append additional
lines to the commit message.

So, let's use the --no-status option to 'git commit' which will cause
git to refrain from appending the lines of instructional text to the
commit message. This will allow the entire resulting commit message to
be compared against the expected value.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Update Swedish translation (2009t0f0u)Peter Krefting Tue, 19 Feb 2013 09:26:36 +0000 (10:26 +0100)

l10n: Update Swedish translation (2009t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

l10n: Update Swedish translation (2004t0f0u)Peter Krefting Mon, 18 Feb 2013 22:01:07 +0000 (23:01 +0100)

l10n: Update Swedish translation (2004t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

l10n: zh_CN.po: translate 5 new messagesJiang Xin Tue, 19 Feb 2013 06:52:24 +0000 (14:52 +0800)

l10n: zh_CN.po: translate 5 new messages

Translate 5 new messages came from git.pot update in 235537a
(l10n: git.pot: v1.8.2 round 3 (5 new)).

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

l10n: git.pot: v1.8.2 round 3 (5 new)Jiang Xin Tue, 19 Feb 2013 05:36:11 +0000 (13:36 +0800)

l10n: git.pot: v1.8.2 round 3 (5 new)

Generate po/git.pot from v1.8.2-rc0-16-g20a59 for git v1.8.2
l10n round 3.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

imap-send: move #ifdef aroundJunio C Hamano Fri, 15 Feb 2013 20:32:19 +0000 (12:32 -0800)

imap-send: move #ifdef around

Instead of adding an early return to the inside of the
ssl_socket_connect() function for NO_OPENSSL compilation, split it
into a separate stub function.

No functional change, but the next change to extend ssl_socket_connect()
will become easier to read this way.

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

Merge branch 'jc/mention-tracking-for-pull-default'Junio C Hamano Tue, 19 Feb 2013 00:05:02 +0000 (16:05 -0800)

Merge branch 'jc/mention-tracking-for-pull-default'

We stopped mentioning `tracking` is a deprecated but supported
synonym for `upstream` in pull.default even though we have no
intention of removing the support for it.

* jc/mention-tracking-for-pull-default:
doc: mention tracking for pull.default

Merge branch 'mm/config-intro-in-git-doc'Junio C Hamano Tue, 19 Feb 2013 00:04:58 +0000 (16:04 -0800)

Merge branch 'mm/config-intro-in-git-doc'

* mm/config-intro-in-git-doc:
git.txt: update description of the configuration mechanism

RelNotes 1.8.2: push-simple will not be in effect in... Junio C Hamano Mon, 18 Feb 2013 23:59:33 +0000 (15:59 -0800)

RelNotes 1.8.2: push-simple will not be in effect in this release

Also migration path for the default behaviour of "git add -u/-A" run
in a subdirectory is worth mentioning.

Both pointed out by Matthieu Moy.

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

shell-prompt: clean up nested if-thenMartin Erik Werner Mon, 18 Feb 2013 22:59:03 +0000 (23:59 +0100)

shell-prompt: clean up nested if-then

Minor clean up of if-then nesting in checks for environment variables
and config options. No functional changes.

Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

user-manual: typofix (ofthe->of the)Junio C Hamano Mon, 18 Feb 2013 20:43:00 +0000 (12:43 -0800)

user-manual: typofix (ofthe->of the)

Noticed by Drew Northup

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

Merge branch 'maint'Junio C Hamano Mon, 18 Feb 2013 08:50:33 +0000 (00:50 -0800)

Merge branch 'maint'

* maint:
user-manual: use -o latest.tar.gz to create a gzipped tarball
user-manual: use 'git config --global user.*' for setup
user-manual: mention 'git remote add' for remote branch config
user-manual: give 'git push -f' as an alternative to +master
user-manual: use 'remote add' to setup push URLs

user-manual: use -o latest.tar.gz to create a gzipped... W. Trevor King Mon, 18 Feb 2013 00:16:01 +0000 (19:16 -0500)

user-manual: use -o latest.tar.gz to create a gzipped tarball

This functionality was introduced by 0e804e09 (archive: provide
builtin .tar.gz filter, 2011-07-21) for v1.7.7.

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

user-manual: use 'git config --global user.*' for setupW. Trevor King Mon, 18 Feb 2013 00:15:58 +0000 (19:15 -0500)

user-manual: use 'git config --global user.*' for setup

A simple command line call is easier than spawning an editor,
especially for folks new to ideas like the "command line" and "text
editors". This is also the approach suggested by 'git commit' if you
try and commit without having configured user.name or user.email.

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

user-manual: mention 'git remote add' for remote branch... W. Trevor King Mon, 18 Feb 2013 00:15:56 +0000 (19:15 -0500)

user-manual: mention 'git remote add' for remote branch config

I hardly ever setup remote.<name>.url using 'git config'. While it
may be instructive to do so, we should also point out 'git remote
add'.

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

user-manual: give 'git push -f' as an alternative to... W. Trevor King Mon, 18 Feb 2013 00:15:55 +0000 (19:15 -0500)

user-manual: give 'git push -f' as an alternative to +master

This mirrors existing language in the description of 'git fetch'.

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

user-manual: use 'remote add' to setup push URLsW. Trevor King Mon, 18 Feb 2013 00:15:53 +0000 (19:15 -0500)

user-manual: use 'remote add' to setup push URLs

There is no need to use here documents to setup this configuration.
It is easier, less confusing, and more robust to use `git remote add`
directly.

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

Merge git://github.com/git-l10n/git-poJunio C Hamano Mon, 18 Feb 2013 08:01:12 +0000 (00:01 -0800)

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

* git://github.com/git-l10n/git-po:
l10n: zh_CN.po: translate 35 new messages
l10n: vi.po: update new strings (2004t0u0f)
l10n: Update git.pot (35 new, 14 removed messages)

l10n: zh_CN.po: translate 35 new messagesJiang Xin Thu, 14 Feb 2013 09:47:45 +0000 (17:47 +0800)

l10n: zh_CN.po: translate 35 new messages

Translate 35 new messages came from git.pot update in 9caaf23
(l10n: Update git.pot (35 new, 14 removed messages)).

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

Git 1.8.2-rc0 v1.8.2-rc0Junio C Hamano Sun, 17 Feb 2013 23:35:33 +0000 (15:35 -0800)

Git 1.8.2-rc0

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

Merge branch 'jc/hidden-refs'Junio C Hamano Sun, 17 Feb 2013 23:25:57 +0000 (15:25 -0800)

Merge branch 'jc/hidden-refs'

Allow the server side to redact the refs/ namespace it shows to the
client.

Will merge to 'master'.

* jc/hidden-refs:
upload/receive-pack: allow hiding ref hierarchies
upload-pack: simplify request validation
upload-pack: share more code

Merge branch 'mp/diff-algo-config'Junio C Hamano Sun, 17 Feb 2013 23:25:51 +0000 (15:25 -0800)

Merge branch 'mp/diff-algo-config'

Add diff.algorithm configuration so that the user does not type
"diff --histogram".

* mp/diff-algo-config:
diff: Introduce --diff-algorithm command line option
config: Introduce diff.algorithm variable
git-completion.bash: Autocomplete --minimal and --histogram for git-diff

Merge branch 'mw/bash-prompt-show-untracked-config'Junio C Hamano Sun, 17 Feb 2013 23:25:46 +0000 (15:25 -0800)

Merge branch 'mw/bash-prompt-show-untracked-config'

Allows skipping the untracked check GIT_PS1_SHOWUNTRACKEDFILES
asks for the git-prompt (in contrib/) per repository.

* mw/bash-prompt-show-untracked-config:
t9903: add extra tests for bash.showDirtyState
t9903: add tests for bash.showUntrackedFiles
shell prompt: add bash.showUntrackedFiles option

Merge branch 'jk/rebase-i-comment-char'Junio C Hamano Sun, 17 Feb 2013 23:25:19 +0000 (15:25 -0800)

Merge branch 'jk/rebase-i-comment-char'

Finishing touches to the earlier core.commentchar topic to cover
"rebase -i" as well.

* jk/rebase-i-comment-char:
rebase -i: respect core.commentchar

Merge branch 'jk/read-commit-buffer-data-after-free'Junio C Hamano Sun, 17 Feb 2013 23:23:20 +0000 (15:23 -0800)

Merge branch 'jk/read-commit-buffer-data-after-free'

"git log --grep=<pattern>" used to look for the pattern in literal
bytes of the commit log message and ignored the log-output encoding.

* jk/read-commit-buffer-data-after-free:
log: re-encode commit messages before grepping

difftool: silence uninitialized variable warningDavid Aguilar Sat, 16 Feb 2013 05:47:43 +0000 (21:47 -0800)

difftool: silence uninitialized variable warning

Git::config() returns `undef` when given keys that do not exist.
Check that the $guitool value is defined to prevent a noisy
"Use of uninitialized variable $guitool in length" warning.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: vi.po: update new strings (2004t0u0f)Tran Ngoc Quan Sun, 17 Feb 2013 01:42:47 +0000 (08:42 +0700)

l10n: vi.po: update new strings (2004t0u0f)

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>

Update draft release notes to 1.8.2Junio C Hamano Fri, 15 Feb 2013 20:24:54 +0000 (12:24 -0800)

Update draft release notes to 1.8.2

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

git.txt: update description of the configuration mechanismMatthieu Moy Thu, 14 Feb 2013 15:36:54 +0000 (16:36 +0100)

git.txt: update description of the configuration mechanism

The old Git version where it appeared is now useful only to historians,
not to normal users. Also, the text was mentioning only the per-repo
config file, but this is a good place to teach that customization can
also be made per-user.

While at it, remove a now-defunct e-mail from an example.

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

count-objects: report how much disk space taken by... Nguyễn Thái Ngọc Duy Wed, 13 Feb 2013 09:13:19 +0000 (16:13 +0700)

count-objects: report how much disk space taken by garbage files

Also issue warnings on loose garbages instead of errors as a result of
using report_garbage() function in count_objects()

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

count-objects: report garbage files in pack directory tooNguyễn Thái Ngọc Duy Fri, 15 Feb 2013 12:07:10 +0000 (19:07 +0700)

count-objects: report garbage files in pack directory too

prepare_packed_git_one() is modified to allow count-objects to hook a
report function to so we don't need to duplicate the pack searching
logic in count-objects.c. When report_pack_garbage is NULL, the
overhead is insignificant.

The garbage is reported with warning() instead of error() in packed
garbage case because it's not an error to have garbage. Loose garbage
is still reported as errors and will be converted to warnings later.

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

Merge branch 'wk/man-deny-current-branch-is-default... Junio C Hamano Fri, 15 Feb 2013 00:06:29 +0000 (16:06 -0800)

Merge branch 'wk/man-deny-current-branch-is-default-these-days'

* wk/man-deny-current-branch-is-default-these-days:
user-manual: Update for receive.denyCurrentBranch=refuse

Merge branch 'mk/make-rm-depdirs-could-be-empty'Junio C Hamano Fri, 15 Feb 2013 00:06:24 +0000 (16:06 -0800)

Merge branch 'mk/make-rm-depdirs-could-be-empty'

"make COMPUTE_HEADER_DEPENDENCIES=no clean" would try to run "rm
-rf $(dep_dirs)" with an empty dep_dir, but some implementations of
"rm -rf" barf on an empty argument list.

* mk/make-rm-depdirs-could-be-empty:
Makefile: don't run "rm" without any files

Merge branch 'mm/config-local-completion'Junio C Hamano Fri, 15 Feb 2013 00:06:19 +0000 (16:06 -0800)

Merge branch 'mm/config-local-completion'

* mm/config-local-completion:
completion: support 'git config --local'

Merge branch 'ef/non-ascii-parse-options-error-diag'Junio C Hamano Fri, 15 Feb 2013 00:06:14 +0000 (16:06 -0800)

Merge branch 'ef/non-ascii-parse-options-error-diag'

* ef/non-ascii-parse-options-error-diag:
parse-options: report uncorrupted multi-byte options

Merge branch 'mk/old-expat'Junio C Hamano Fri, 15 Feb 2013 00:06:08 +0000 (16:06 -0800)

Merge branch 'mk/old-expat'

* mk/old-expat:
Allow building with xmlparse.h

Merge branch 'da/p4merge-mktemp-fix'Junio C Hamano Fri, 15 Feb 2013 00:05:56 +0000 (16:05 -0800)

Merge branch 'da/p4merge-mktemp-fix'

* da/p4merge-mktemp-fix:
p4merge: fix printf usage

Documentation/git-add: kill remaining <filepattern>Junio C Hamano Thu, 14 Feb 2013 23:51:43 +0000 (15:51 -0800)

Documentation/git-add: kill remaining <filepattern>

The merge at 5bf72ed2 missed another instance of <filepattern> that
we were converting to <pathspec>.

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

user-manual: Update for receive.denyCurrentBranch=refuseW. Trevor King Fri, 8 Feb 2013 17:04:20 +0000 (12:04 -0500)

user-manual: Update for receive.denyCurrentBranch=refuse

acd2a45 (Refuse updating the current branch in a non-bare repository
via push, 2009-02-11) changed the default to refuse such a push, but
it forgot to update the docs.

7d182f5 (Documentation: receive.denyCurrentBranch defaults to
'refuse', 2010-03-17) updated Documentation/config.txt, but forgot to
update the user manual.

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

Update draft release notes to 1.8.2Junio C Hamano Thu, 14 Feb 2013 18:43:07 +0000 (10:43 -0800)

Update draft release notes to 1.8.2

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

Merge branch 'jk/diff-graph-cleanup'Junio C Hamano Thu, 14 Feb 2013 18:29:59 +0000 (10:29 -0800)

Merge branch 'jk/diff-graph-cleanup'

Refactors a lot of repetitive code sequence from the graph drawing
code and adds it to the combined diff output.

* jk/diff-graph-cleanup:
combine-diff.c: teach combined diffs about line prefix
diff.c: use diff_line_prefix() where applicable
diff: add diff_line_prefix function
diff.c: make constant string arguments const
diff: write prefix to the correct file
graph: output padding for merge subsequent parents

Merge branch 'nd/status-show-in-progress'Junio C Hamano Thu, 14 Feb 2013 18:29:54 +0000 (10:29 -0800)

Merge branch 'nd/status-show-in-progress'

* nd/status-show-in-progress:
status: show the branch name if possible in in-progress info

Merge branch 'mm/remote-mediawiki-build'Junio C Hamano Thu, 14 Feb 2013 18:29:49 +0000 (10:29 -0800)

Merge branch 'mm/remote-mediawiki-build'

* mm/remote-mediawiki-build:
git-remote-mediawiki: use toplevel's Makefile
Makefile: make script-related rules usable from subdirectories

Merge branch 'bw/get-tz-offset-perl'Junio C Hamano Thu, 14 Feb 2013 18:29:44 +0000 (10:29 -0800)

Merge branch 'bw/get-tz-offset-perl'

* bw/get-tz-offset-perl:
cvsimport: format commit timestamp ourselves without using strftime
perl/Git.pm: fix get_tz_offset to properly handle DST boundary cases
Move Git::SVN::get_tz to Git::get_tz_offset

Merge branch 'al/mergetool-printf-fix'Junio C Hamano Thu, 14 Feb 2013 18:29:37 +0000 (10:29 -0800)

Merge branch 'al/mergetool-printf-fix'

* al/mergetool-printf-fix:
difftool--helper: fix printf usage
git-mergetool: print filename when it contains %

Merge branch 'jk/error-const-return'Junio C Hamano Thu, 14 Feb 2013 18:29:23 +0000 (10:29 -0800)

Merge branch 'jk/error-const-return'

* jk/error-const-return:
Use __VA_ARGS__ for all of error's arguments

Merge branch 'jx/utf8-printf-width'Junio C Hamano Thu, 14 Feb 2013 18:29:08 +0000 (10:29 -0800)

Merge branch 'jx/utf8-printf-width'

Use a new helper that prints a message and counts its display width
to align the help messages parse-options produces.

* jx/utf8-printf-width:
Add utf8_fprintf helper that returns correct number of columns

Merge branch 'mg/bisect-doc'Junio C Hamano Thu, 14 Feb 2013 18:29:01 +0000 (10:29 -0800)

Merge branch 'mg/bisect-doc'

* mg/bisect-doc:
git-bisect.txt: clarify that reset quits bisect

Merge branch 'tz/perl-styles'Junio C Hamano Thu, 14 Feb 2013 18:28:55 +0000 (10:28 -0800)

Merge branch 'tz/perl-styles'

Add coding guidelines for writing Perl scripts for Git.

* tz/perl-styles:
Update CodingGuidelines for Perl

Merge branch 'jc/extended-fake-ancestor-for-gitlink'Junio C Hamano Thu, 14 Feb 2013 18:28:48 +0000 (10:28 -0800)

Merge branch 'jc/extended-fake-ancestor-for-gitlink'

Instead of requiring the full 40-hex object names on the index
line, we can read submodule commit object names from the textual
diff when synthesizing a fake ancestore tree for "git am -3".

* jc/extended-fake-ancestor-for-gitlink:
apply: verify submodule commit object name better

Merge branch 'dg/subtree-fixes'Junio C Hamano Thu, 14 Feb 2013 18:28:26 +0000 (10:28 -0800)

Merge branch 'dg/subtree-fixes'

contrib/subtree updates, but here are only the ones that looked
ready. The remainder of the patches will have another day.

* dg/subtree-fixes:
contrib/subtree: make the manual directory if needed
contrib/subtree: honor DESTDIR
contrib/subtree: fix synopsis
contrib/subtree: better error handling for 'subtree add'
contrib/subtree: use %B for split subject/body
contrib/subtree: remove test number comments

pretty: make %GK output the signing key for signed... Michael J Gruber Thu, 14 Feb 2013 16:04:46 +0000 (17:04 +0100)

pretty: make %GK output the signing key for signed commits

In order to employ signed keys in an automated way it is absolutely
necessary to check which keys the signatures come from.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pretty: parse the gpg status lines rather than the... Michael J Gruber Thu, 14 Feb 2013 16:04:45 +0000 (17:04 +0100)

pretty: parse the gpg status lines rather than the output

Currently, parse_signature_lines() parses the gpg output for strings
which depend on LANG so it fails to recognize good commit signatures
(and thus does not fill in %G? and the like) in most locales.

Make it parse the status lines from gpg instead, which are the proper
machine interface. This fixes the problem described above.

There is a change in behavior for "%GS" which we intentionally do not
work around: "%GS" used to put quotes around the signer's uid (or
rather: it inherited from the gpg user output). We output the uid
without quotes now, just like author and committer names.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gpg_interface: allow to request status returnMichael J Gruber Thu, 14 Feb 2013 16:04:44 +0000 (17:04 +0100)

gpg_interface: allow to request status return

Currently, verify_signed_buffer() returns the user facing output only.

Allow callers to request the status output also.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

log-tree: rely upon the check in the gpg_interfaceMichael J Gruber Thu, 14 Feb 2013 16:04:43 +0000 (17:04 +0100)

log-tree: rely upon the check in the gpg_interface

It's just so much clearer.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gpg-interface: check good signature in a reliable wayMichael J Gruber Thu, 14 Feb 2013 16:04:42 +0000 (17:04 +0100)

gpg-interface: check good signature in a reliable way

Currently, verify_signed_buffer() only checks the return code of gpg,
and some callers implement additional unreliable checks for "Good
signature" in the gpg output meant for the user.

Use the status output instead and parse for a line beinning with
"[GNUPG:] GOODSIG ". This is the only reliable way of checking for a
good gpg signature.

If needed we can change this easily to "[GNUPG:] VALIDSIG " if we want
to take into account the trust model.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: Update git.pot (35 new, 14 removed messages)Jiang Xin Thu, 14 Feb 2013 06:49:45 +0000 (14:49 +0800)

l10n: Update git.pot (35 new, 14 removed messages)

L10n for git 1.8.2 round 2: Generate po/git.pot from v1.8.1.3-568-g5bf72.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

t9903: add extra tests for bash.showDirtyStateMartin Erik Werner Wed, 13 Feb 2013 20:58:19 +0000 (21:58 +0100)

t9903: add extra tests for bash.showDirtyState

Add 3 extra tests for the bash.showDirtyState config option; the
tests now cover all combinations of the shell var being set/unset
and the config option being missing/enabled/disabled, given a dirty
file.

Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t9903: add tests for bash.showUntrackedFilesMartin Erik Werner Wed, 13 Feb 2013 20:58:18 +0000 (21:58 +0100)

t9903: add tests for bash.showUntrackedFiles

Add 4 tests for the bash.showUntrackedFiles config option, covering
all combinations of the shell var being set/unset and the config
option being enabled/disabled (the other 2 cases, missing config
with and without shell variable, are already covered by existing
tests).

Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: don't run "rm" without any filesMatt Kraai Wed, 13 Feb 2013 15:57:48 +0000 (07:57 -0800)

Makefile: don't run "rm" without any files

When COMPUTE_HEADER_DEPENDENCIES is set to "auto" and the compiler
does not support it, $(dep_dirs) becomes empty. "make clean" runs
"rm -rf $(dep_dirs)", which can fail in such a case.

Signed-off-by: Matt Kraai <matt.kraai@amo.abbott.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

shell prompt: add bash.showUntrackedFiles optionMartin Erik Werner Wed, 13 Feb 2013 11:01:58 +0000 (12:01 +0100)

shell prompt: add bash.showUntrackedFiles option

Add a config option 'bash.showUntrackedFiles' which allows enabling
the prompt showing untracked files on a per-repository basis. This is
useful for some repositories where the 'git ls-files ...' command may
take a long time.

Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sha1_file: reorder code in prepare_packed_git_one()Nguyễn Thái Ngọc Duy Wed, 13 Feb 2013 09:13:17 +0000 (16:13 +0700)

sha1_file: reorder code in prepare_packed_git_one()

The current loop does

while (...) {
if (it is not an .idx file)
continue;
process .idx file;
}

and is reordered to

while (...) {
if (it is an .idx file) {
process .idx file;
}
}

This makes it easier to add new extension file processing.

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

Makefile: do not export mandir/htmldir/infodirJunio C Hamano Tue, 12 Feb 2013 23:02:13 +0000 (15:02 -0800)

Makefile: do not export mandir/htmldir/infodir

These are defined in the main Makefile to be funny values that are
optionally relative to an unspecified location that is determined at
runtime. They are only suitable for hardcoding in the binary via
the -DGIT_{MAN,HTML,INFO}_PATH=<value> C preprocessor options, and
are not real paths, contrary to what any sane person, and more
importantly, the Makefile in the documentation directory, would
expect.

A longer term fix is to introduce runtime_{man,html,info}dir variables
to hold these funny values, and make {man,html,info}dir variables
to have real paths whose default values begin with $(prefix), but
as a first step, stop exporting them from the top-level Makefile

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

Git.pm: allow pipes to be closed prior to calling comma... Michal Nazarewicz Tue, 12 Feb 2013 14:02:31 +0000 (15:02 +0100)

Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

The command_close_bidi_pipe() function will insist on closing both
input and output pipes returned by command_bidi_pipe(). With this
change it is possible to close one of the pipes in advance and pass
undef as an argument.

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

Git.pm: refactor command_close_bidi_pipe to use _cmd_closeMichal Nazarewicz Tue, 12 Feb 2013 14:02:30 +0000 (15:02 +0100)

Git.pm: refactor command_close_bidi_pipe to use _cmd_close

The body of the loop in command_close_bidi_pipe sub is identical to
what _cmd_close sub does.

Instead of duplicating, refactor _cmd_close so that it accepts a
list of file handles to be closed, which makes it usable with
command_close_bidi_pipe.

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

Merge branch 'maint'Junio C Hamano Tue, 12 Feb 2013 20:23:12 +0000 (12:23 -0800)

Merge branch 'maint'

* maint:
Replace filepattern with pathspec for consistency

rebase -i: respect core.commentcharJohn Keeping Mon, 11 Feb 2013 23:08:04 +0000 (23:08 +0000)

rebase -i: respect core.commentchar

Commit eff80a9 (Allow custom "comment char") introduced a custom comment
character for commit messages but did not teach git-rebase--interactive
to use it.

Change git-rebase--interactive to read core.commentchar and use its
value when generating commit messages and for the command list.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

combine-diff.c: teach combined diffs about line prefixJohn Keeping Thu, 7 Feb 2013 20:15:28 +0000 (20:15 +0000)

combine-diff.c: teach combined diffs about line prefix

When running "git log --graph --cc -p" the diff output for merges is not
indented by the graph structure, unlike the diffs of non-merge commits
(added in commit 7be5761 - diff.c: Output the text graph padding before
each diff line).

Fix this by teaching the combined diff code to output diff_line_prefix()
before each line.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: use diff_line_prefix() where applicableJohn Keeping Thu, 7 Feb 2013 20:15:27 +0000 (20:15 +0000)

diff.c: use diff_line_prefix() where applicable

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: add diff_line_prefix functionJohn Keeping Thu, 7 Feb 2013 20:15:26 +0000 (20:15 +0000)

diff: add diff_line_prefix function

This is a helper function to call the diff output_prefix function and
return its value as a C string, allowing us to greatly simplify
everywhere that needs to get the output prefix.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: make constant string arguments constJohn Keeping Thu, 7 Feb 2013 20:15:25 +0000 (20:15 +0000)

diff.c: make constant string arguments const

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: write prefix to the correct fileJohn Keeping Thu, 7 Feb 2013 20:15:24 +0000 (20:15 +0000)

diff: write prefix to the correct file

Write the prefix for an output line to the same file as the actual
content.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Unify appending signoff in format-patch, commit and... Brandon Casey Tue, 12 Feb 2013 10:17:39 +0000 (02:17 -0800)

Unify appending signoff in format-patch, commit and sequencer

There are two implementations of append_signoff in log-tree.c and
sequencer.c, which do more or less the same thing. Unify on top of the
sequencer.c implementation.

Add a test in t4014 to demonstrate support for non-s-o-b elements in the
commit footer provided by sequence.c:append_sob. Mark tests fixed as
appropriate.

[Commit message mostly stolen from Nguyễn Thái Ngọc Duy's original
unification patch]

Signed-off-by: Brandon Casey <bcasey@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

format-patch: update append_signoff prototypeNguyễn Thái Ngọc Duy Tue, 12 Feb 2013 10:17:38 +0000 (02:17 -0800)

format-patch: update append_signoff prototype

This is a preparation step for merging with append_signoff from
sequencer.c

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Brandon Casey <bcasey@nvidia.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4014: more tests about appending s-o-b linesNguyễn Thái Ngọc Duy Tue, 12 Feb 2013 10:17:37 +0000 (02:17 -0800)

t4014: more tests about appending s-o-b lines

[bc: Squash the tests from Duy's original unify-appending-sob series.

Fix test 90 "signoff: some random signoff-alike" and mark as failing.
Correct behavior should insert a blank line after message body and
signed-off-by.

Add two additional tests:

1. failure to detect non-conforming elements in the footer when last
line matches committer's s-o-b.
2. ensure various s-o-b -like elements in the footer are handled as
conforming. e.g. "Change-id: IXXXX or Bug: 1234"
]

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

sequencer.c: teach append_signoff to avoid adding a... Brandon Casey Tue, 12 Feb 2013 10:33:42 +0000 (02:33 -0800)

sequencer.c: teach append_signoff to avoid adding a duplicate newline

Teach append_signoff to detect whether a blank line exists at the position
that the signed-off-by line will be added, and refrain from adding an
additional one if one already exists. Or, add an additional line if one
is needed to make sure the new footer is separated from the message body
by a blank line.

Signed-off-by: Brandon Casey <bcasey@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer.c: teach append_signoff how to detect duplica... Brandon Casey Tue, 12 Feb 2013 10:17:35 +0000 (02:17 -0800)

sequencer.c: teach append_signoff how to detect duplicate s-o-b

Teach append_signoff how to detect a duplicate s-o-b in the commit footer.
This is in preparation to unify the append_signoff implementations in
log-tree.c and sequencer.c.

Fixes test in t3511.

Signed-off-by: Brandon Casey <bcasey@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>