gitweb.git
t9001: style modernisation phase #1Junio C Hamano Tue, 25 Nov 2014 22:11:39 +0000 (14:11 -0800)

t9001: style modernisation phase #1

Don't chop test_expect_success line into pieces and concatenate with
'\'. That's so 2005.

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

git-send-email: add --transfer-encoding optionPaolo Bonzini Tue, 25 Nov 2014 14:00:27 +0000 (15:00 +0100)

git-send-email: add --transfer-encoding option

The thread at http://thread.gmane.org/gmane.comp.version-control.git/257392
details problems when applying patches with "git am" in a repository with
CRLF line endings. In the example in the thread, the repository originated
from "git-svn" so it is not possible to use core.eol and friends on it.

Right now, the best option is to use "git am --keep-cr". However, when
a patch create new files, the patch application process will reject the
new file because it finds a "/dev/null\r" string instead of "/dev/null".

The problem is that SMTP transport is CRLF-unsafe. Sending a patch by
email is the same as passing it through "dos2unix | unix2dos". The newly
introduced CRLFs are normally transparent because git-am strips them. The
keepcr=true setting preserves them, but it is mostly working by chance
and it would be very problematic to have a "git am" workflow in a
repository with mixed LF and CRLF line endings.

The MIME solution to this is the quoted-printable transfer enconding.
This is not something that we want to enable by default, since it makes
received emails horrible to look at. However, it is a very good match
for projects that store CRLF line endings in the repository.

The only disadvantage of quoted-printable is that quoted-printable
patches fail to apply if the maintainer uses "git am --keep-cr". This
is because the decoded patch will have two carriage returns at the end
of the line. Therefore, add support for base64 transfer encoding too,
which makes received emails downright impossible to look at outside
a MUA, but really just works.

The patch covers all bases, including users that still live in the late
80s, by also providing a 7bit content transfer encoding that refuses
to send emails with non-ASCII character in them. And finally, "8bit"
will add a Content-Transfer-Encoding header but otherwise do nothing.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-send-email: delay creation of MIME headersPaolo Bonzini Tue, 25 Nov 2014 14:00:26 +0000 (15:00 +0100)

git-send-email: delay creation of MIME headers

After the next patch, git-send-email will sometimes modify
existing Content-Transfer-Encoding headers. Delay the addition
of the header to @xh until just before sending. Do the same
for MIME-Version, to avoid adding it twice.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sort_string_list(): rename to string_list_sort()Michael Haggerty Tue, 25 Nov 2014 08:02:35 +0000 (09:02 +0100)

sort_string_list(): rename to string_list_sort()

The new name is more consistent with the names of other
string_list-related functions.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

prune_remote(): iterate using for_each_string_list_item()Michael Haggerty Tue, 25 Nov 2014 08:02:34 +0000 (09:02 +0100)

prune_remote(): iterate using for_each_string_list_item()

Iterate over refs_to_prune using for_each_string_list_item() rather
than writing out the loop in longhand.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

prune_remote(): rename local variableMichael Haggerty Tue, 25 Nov 2014 08:02:33 +0000 (09:02 +0100)

prune_remote(): rename local variable

Rename "delete_refs_list" to "refs_to_prune". The new name is more
self-explanatory.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

repack_without_refs(): make the refnames argument a... Michael Haggerty Tue, 25 Nov 2014 08:02:32 +0000 (09:02 +0100)

repack_without_refs(): make the refnames argument a string_list

Most of the callers have string_lists available already, whereas two
of them had to read data out of a string_list into an array of strings
just to call this function. So change repack_without_refs() to take
the list of refnames to omit as a string_list, and change the callers
accordingly.

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

prune_remote(): sort delete_refs_list references en... Michael Haggerty Tue, 25 Nov 2014 08:02:31 +0000 (09:02 +0100)

prune_remote(): sort delete_refs_list references en masse

Inserting items into a list in sorted order is O(N^2) whereas
appending them unsorted and then sorting the list all at once is
O(N lg N).

string_list_insert() also removes duplicates, and this change loses
that functionality. But the strings in this list, which ultimately
come from a for_each_ref() iteration, cannot contain duplicates.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

prune_remote(): initialize both delete_refs lists in... Michael Haggerty Tue, 25 Nov 2014 08:02:30 +0000 (09:02 +0100)

prune_remote(): initialize both delete_refs lists in a single loop

Also free them together at the end of the function.

In a moment, the array version will become redundant. Managing them
together makes later steps more obvious.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

prune_remote(): exit early if there are no stale referencesMichael Haggerty Tue, 25 Nov 2014 08:02:29 +0000 (09:02 +0100)

prune_remote(): exit early if there are no stale references

Aside from making the logic clearer, this avoids a call to
warn_dangling_symrefs(), which always does a for_each_rawref()
iteration.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-sh-setup.sh: use dashdash with basename callDan Wyand Mon, 24 Nov 2014 23:03:31 +0000 (18:03 -0500)

git-sh-setup.sh: use dashdash with basename call

Calling basename on a argument that starts with a dash, like a login
shell, will result in an error. Add '--' before the argument so that
the argument is interpreted properly.

Signed-off-by: Dan Wyand <danwyand@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

string_list: document string_list_(insert,lookup)Stefan Beller Mon, 24 Nov 2014 21:22:02 +0000 (13:22 -0800)

string_list: document string_list_(insert,lookup)

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

git-compat-util.h: don't define _XOPEN_SOURCE on cygwinRamsay Jones Sun, 23 Nov 2014 17:14:55 +0000 (17:14 +0000)

git-compat-util.h: don't define _XOPEN_SOURCE on cygwin

A recent update to the gcc compiler (v4.8.3-5 x86_64) on 64-bit
cygwin leads to several new warnings about the implicit declaration
of the memmem(), strlcpy() and strcasestr() functions. For example:

CC archive.o
archive.c: In function 'format_subst':
archive.c:44:3: warning: implicit declaration of function 'memmem' \
[-Wimplicit-function-declaration]
b = memmem(src, len, "$Format:", 8);
^
archive.c:44:5: warning: assignment makes pointer from integer \
without a cast [enabled by default]
b = memmem(src, len, "$Format:", 8);
^

This is because <string.h> on Cygwin used to always declare the
above functions, but a recent version of it no longer make them
visible when _XOPEN_SOURCE is set (even if _GNU_SOURCE and
_BSD_SOURCE is set).

In order to suppress the warnings, don't define the _XOPEN_SOURCE
macro on cygwin.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5000 on Windows: do not mistake "sh.exe" as "sh"Johannes Sixt Mon, 24 Nov 2014 18:29:37 +0000 (19:29 +0100)

t5000 on Windows: do not mistake "sh.exe" as "sh"

In their effort to emulate POSIX as close as possible, the MSYS tools
and Cygwin treat the file name "foo.exe" as "foo" when the latter is
asked for, but not present, but the former is present.

Following this rule, 'cp /bin/sh a/bin' actually copies the file
/bin/sh.exe, so that we now have a/bin/sh.exe in the repository. This
difference did not matter in the tests in the past because we were only
interested in the equality of contents generated in various ways. But
recently added tests check file names, in particular, the presence of
"a/bin/sh". This test fails on Windows, as we do not have a file by this
name, but "a/bin/sh.exe".

Use test-genrandom to generate the large binary file in the repository
under the expected name.

We could change the guilty line to 'cat /bin/sh >a/bin/sh', but it is
better for test reproducibility to ensure that the test data is the same
across platforms, which test-genrandom can guarantee.

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

t/README: justify why "! grep foo" is sufficientJunio C Hamano Mon, 24 Nov 2014 17:47:07 +0000 (09:47 -0800)

t/README: justify why "! grep foo" is sufficient

We require use of test_must_fail to check expected non-zero exit by
Git itself, but discourage test_must_fail to be used for checking
exit status of non Git commands that are supplied by the system.
The current text explains the reason for the former but not the
latter.

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

SubmittingPatches: refer to t/README for testsJunio C Hamano Mon, 24 Nov 2014 17:43:29 +0000 (09:43 -0800)

SubmittingPatches: refer to t/README for tests

There are general guidelines for writing good tests in t/README
but neither SubmittingPatches nor CodingGuidelines refers to it,
which makes the document easy to be missed.

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

Git 2.2.0-rc3 v2.2.0-rc3Junio C Hamano Fri, 21 Nov 2014 20:10:56 +0000 (12:10 -0800)

Git 2.2.0-rc3

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

mergetools: stop setting $status in merge_cmd()David Aguilar Fri, 21 Nov 2014 09:03:10 +0000 (01:03 -0800)

mergetools: stop setting $status in merge_cmd()

No callers rely on $status so there's don't need to set
it during merge_cmd() for diffmerge, emerge, and kdiff3.

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

mergetool: simplify conditionalsDavid Aguilar Fri, 21 Nov 2014 01:20:29 +0000 (17:20 -0800)

mergetool: simplify conditionals

Combine the $last_status checks into a single conditional.
Replace $last_status and $rollup_status with a single variable.

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

difftool--helper: add explicit exit statementDavid Aguilar Fri, 21 Nov 2014 01:20:28 +0000 (17:20 -0800)

difftool--helper: add explicit exit statement

git-difftool--helper returns a zero exit status unless
--trust-exit-code is in effect. Add an explicit exit statement
to make this clearer.

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

mergetool--lib: remove use of $status globalDavid Aguilar Fri, 21 Nov 2014 01:20:27 +0000 (17:20 -0800)

mergetool--lib: remove use of $status global

Remove return statements and rework check_unchanged() so that the exit
status from the last evaluated expression bubbles up to the callers.

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

mergetool--lib: remove no-op assignment to $status... Junio C Hamano Fri, 21 Nov 2014 19:17:57 +0000 (11:17 -0800)

mergetool--lib: remove no-op assignment to $status from setup_user_tool

Even though setup_user_tool assigns the exit status from "eval
$merge_tool_cmd" to $status, the variable is overwritten by the
function it calls next, check_unchanged, without ever getting looked
at by anybody. And "return $status" at the end of this function
returns the value check_unchanged assigned to it (which is the same
as the value the function returns). Which makes the assignment a
no-op.

Remove it.

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

init-db: improve the filemode trustability checkTorsten Bögershausen Fri, 21 Nov 2014 09:34:54 +0000 (10:34 +0100)

init-db: improve the filemode trustability check

Some file systems do not support the executable bit:

a) The user executable bit is always 0, e.g. VFAT mounted with
-onoexec

b) The user executable bit is always 1, e.g. cifs mounted with
-ofile_mode=0755

c) There are system where user executable bit is 1 even if it
should be 0 like b), but the file mode can be maintained
locally. chmod -x changes the file mode from 0766 to 0666,
until the file system is unmounted and remounted and the file
mode is 0766 again.

This been observed when a Windows machine with NTFS exports a share to
Mac OS X via smb or afp.

Case a) and b) are handled by the current code. Case c) qualifies
as "non trustable executable bit" and core.filemode should be false,
but this is currently not done.

Detect when ".git/config" has the user executable bit set after
creat(".git/config", 0666) and set core.filemode to false. Because
the permission bits on the file is whatever the end user already had
when we are asked to reinitialise an existing repository, and do not
give any information on the filesystem behaviour, do this only when
running "git init" to create a new repository.

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

add: ignore only ignored filesMichael J Gruber Fri, 21 Nov 2014 16:08:19 +0000 (17:08 +0100)

add: ignore only ignored files

"git add foo bar" adds neither foo nor bar when bar is ignored, but dies
to let the user recheck their command invocation. This becomes less
helpful when "git add foo.*" is subject to shell expansion and some of
the expanded files are ignored.

"git add --ignore-errors" is supposed to ignore errors when indexing
some files and adds the others. It does ignore errors from actual
indexing attempts, but does not ignore the error "file is ignored" as
outlined above. This is unexpected.

Change "git add foo bar" to add foo when bar is ignored, but issue
a warning and return a failure code as before the change.

That is, in the case of trying to add ignored files we now act the same
way (with or without "--ignore-errors") in which we act for more
severe indexing errors when "--ignore-errors" is specified.

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

diff-highlight: allow configurable colorsJeff King Thu, 20 Nov 2014 15:29:18 +0000 (10:29 -0500)

diff-highlight: allow configurable colors

Until now, the highlighting colors were hard-coded in the
script (as "reverse" and "noreverse"), and you had to edit
the script to change them. This patch teaches diff-highlight
to read from color.diff-highlight.* to set them.

In addition, it expands the possiblities considerably by
adding two features:

1. Old/new lines can be colored independently (so you can
use a color scheme that complements existing line
coloring).

2. Normal, unhighlighted parts of the lines can be colored,
too. Technically this can be done by separately
configuring color.diff.old/new and matching it to your
diff-highlight colors. But you may want a different
look for your highlighted diffs versus your regular
diffs.

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

parse_color: recognize "no$foo" to clear the $foo attributeJeff King Thu, 20 Nov 2014 15:25:52 +0000 (10:25 -0500)

parse_color: recognize "no$foo" to clear the $foo attribute

You can turn on ANSI text attributes like "reverse" by
putting "reverse" in your color spec. However, you cannot
ask to turn reverse off.

For common cases, this does not matter. You would turn on
"reverse" at the start of a colored section, and then clear
all attributes with a "reset". However, you may wish to turn
on some attributes, then selectively disable others. For
example:

git log --format="%C(bold ul yellow)%h%C(noul) %s"

underlines just the hash, but without the need to re-specify
the rest of the attributes. This can also help third-party
programs, like contrib/diff-highlight, that want to turn
some attribute on/off without disrupting existing coloring.

Note that some attribute specifications are probably
nonsensical (e.g., "bold nobold"). We do not bother to flag
such constructs, and instead let the terminal sort it out.

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

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>

lock_ref_sha1_basic: do not die on locking errorsRonnie Sahlberg Wed, 19 Nov 2014 22:28:52 +0000 (17:28 -0500)

lock_ref_sha1_basic: do not die on locking errors

lock_ref_sha1_basic is inconsistent about when it calls
die() and when it returns NULL to signal an error. This is
annoying to any callers that want to recover from a locking
error.

This seems to be mostly historical accident. It was added in
4bd18c4 (Improve abstraction of ref lock/write.,
2006-05-17), which returned an error in all cases except
calling safe_create_leading_directories, in which case it
died. Later, 40aaae8 (Better error message when we are
unable to lock the index file, 2006-08-12) asked
hold_lock_file_for_update to die for us, leaving the
resolve_ref code-path the only one which returned NULL.

We tried to correct that in 5cc3cef (lock_ref_sha1(): do not
sometimes error() and sometimes die()., 2006-09-30),
by converting all of the die() calls into returns. But we
missed the "die" flag passed to the lock code, leaving us
inconsistent. This state persisted until e5c223e
(lock_ref_sha1_basic(): if locking fails with ENOENT, retry,
2014-01-18). Because of its retry scheme, it does not ask
the lock code to die, but instead manually dies with
unable_to_lock_die().

We can make this consistent with the other return paths by
converting this to use unable_to_lock_message(), and
returning NULL. This is safe to do because all callers
already needed to check the return value of the function,
since it could fail (and return NULL) for other reasons.

[jk: Added excessive history explanation]

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

l10n: remove a superfluous translation for push.cJiang Xin Thu, 20 Nov 2014 08:12:34 +0000 (16:12 +0800)

l10n: remove a superfluous translation for push.c

Ralf reported that '--recurse-submodules' option in push.c should not be
translated [1]. Before his commit is merged, remove superfluous
translations for push.c.

[1] http://www.spinics.net/lists/git/msg241964.html

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

l10n: de.po: translate 2 messagesRalf Thielow Thu, 20 Nov 2014 06:15:15 +0000 (07:15 +0100)

l10n: de.po: translate 2 messages

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

l10n: de.po: translate 2 new messagesRalf Thielow Tue, 18 Nov 2014 18:06:51 +0000 (19:06 +0100)

l10n: de.po: translate 2 new messages

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

l10n: batch updates for one trivial changeJiang Xin Thu, 20 Nov 2014 02:53:48 +0000 (10:53 +0800)

l10n: batch updates for one trivial change

In order to catch up with the release of Git 2.2.0 final, make a batch
l10n update for the new l10n change brought by commit d52adf1 (trailer:
display a trailer without its trailing newline).

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

l10n: git.pot: v2.2.0 round 2 (1 updated)Jiang Xin Thu, 20 Nov 2014 02:03:10 +0000 (10:03 +0800)

l10n: git.pot: v2.2.0 round 2 (1 updated)

Generate po/git.pot from v2.2.0-rc2-23-gca0107e for git v2.2.0 l10n
round 2.

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

Merge branch 'sv/submitting-final-patch'Junio C Hamano Wed, 19 Nov 2014 21:48:01 +0000 (13:48 -0800)

Merge branch 'sv/submitting-final-patch'

* sv/submitting-final-patch:
SubmittingPatches: final submission is To: maintainer and CC: list

Merge branch 'sn/tutorial-status-output-example'Junio C Hamano Wed, 19 Nov 2014 21:47:59 +0000 (13:47 -0800)

Merge branch 'sn/tutorial-status-output-example'

* sn/tutorial-status-output-example:
gittutorial: fix output of 'git status'

Merge branch 'mh/doc-remote-helper-xref'Junio C Hamano Wed, 19 Nov 2014 21:47:55 +0000 (13:47 -0800)

Merge branch 'mh/doc-remote-helper-xref'

* mh/doc-remote-helper-xref:
doc: add some crossrefs between manual pages

Merge branch 'tb/no-relative-file-url'Junio C Hamano Wed, 19 Nov 2014 21:47:53 +0000 (13:47 -0800)

Merge branch 'tb/no-relative-file-url'

* tb/no-relative-file-url:
t5705: the file:// URL should be absolute

Merge branch 'cc/interpret-trailers'Junio C Hamano Wed, 19 Nov 2014 21:47:49 +0000 (13:47 -0800)

Merge branch 'cc/interpret-trailers'

Small fixes to a new experimental command already in 'master'.

* cc/interpret-trailers:
trailer: display a trailer without its trailing newline
trailer: ignore comment lines inside the trailers

gitweb: hack around CGI's list-context param() handlingJeff King Tue, 18 Nov 2014 17:10:22 +0000 (12:10 -0500)

gitweb: hack around CGI's list-context param() handling

As of CGI.pm's 4.08 release, the behavior to call
CGI::param() in a list context is deprecated (because it can
be potentially unsafe if called inside a hash constructor).
This causes gitweb to issue a warning for some of our code,
which in turn causes the tests to fail.

Our use is in fact _not_ one of the dangerous cases, as we
are intentionally using a list context. The recommended
route by 4.08 is to use the new CGI::multi_param() call to
make it explicit that we know what we are doing.
However, that function is only available in 4.08, which is
about a month old; we cannot rely on having it.

One option would be to set $CGI::LIST_CONTEXT_WARN globally,
which turns off the warning. However, that would eliminate
the protection these newer releases are trying to provide.
We want to annotate each site as OK using the new function.

So instead, let's check whether CGI provides the
multi_param() function, and if not, provide an
implementation that just wraps param(). That will work on
both old and new versions of CGI. Sadly, we cannot just
check defined(\&CGI::multi_param), because CGI uses the
autoload feature, which claims that all functions are
defined. Instead, we just do a version check.

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

builtin/push.c: fix description of --recurse-submodules... Ralf Thielow Tue, 18 Nov 2014 17:57:46 +0000 (18:57 +0100)

builtin/push.c: fix description of --recurse-submodules option

The description of the option for argument "recurse-submodules"
is marked for translation even if it expects the untranslated
string and it's missing the option "on-demand" which was introduced
in eb21c73 (2014-03-29, push: teach --recurse-submodules the on-demand
option). Fix this by unmark the string for translation and add the
missing option.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: have python scripts depend on NO_PYTHON settingJonathan Nieder Tue, 18 Nov 2014 18:43:47 +0000 (10:43 -0800)

Makefile: have python scripts depend on NO_PYTHON setting

Like the perl scripts, python scripts need a dependency to ensure they
are rebuilt when switching between the "dummy" versions that run
without Python and the real thing.

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

Makefile: simplify by using SCRIPT_{PERL,SH}_GEN macrosJonathan Nieder Tue, 18 Nov 2014 18:38:38 +0000 (10:38 -0800)

Makefile: simplify by using SCRIPT_{PERL,SH}_GEN macros

SCRIPT_PERL_GEN is defined as $(patsubst %.perl,%,$(SCRIPT_PERL))
for use in targets like build-perl-script used by makefiles in
subdirectories that override SCRIPT_PERL (see v1.8.2-rc0~17^2,
"git-remote-mediawiki: use toplevel's Makefile", 2013-02-08).

The same expression is used in the rules that actually write the
generated perl scripts, and since these rules were introduced before
SCRIPT_PERL_GEN, they use the longhand instead of that macro. Use the
macro to make reading easier.

Likewise for SCRIPT_SH_GEN. The Python rules already got the same
simplification in v1.8.4-rc0~162^2~8 (2013-05-24).

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

Merge git://github.com/git-l10n/git-poJunio C Hamano Tue, 18 Nov 2014 18:27:46 +0000 (10:27 -0800)

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

* 'master' of git://github.com/git-l10n/git-po:
l10n: Update Catalan translation

Merge branch 'jc/doc-commit-only'Junio C Hamano Tue, 18 Nov 2014 18:19:38 +0000 (10:19 -0800)

Merge branch 'jc/doc-commit-only'

* jc/doc-commit-only:
Documentation/git-commit: clarify that --only/--include records the working tree contents

Merge branch 'ta/tutorial-modernize'Junio C Hamano Tue, 18 Nov 2014 18:18:28 +0000 (10:18 -0800)

Merge branch 'ta/tutorial-modernize'

* ta/tutorial-modernize:
gittutorial.txt: remove reference to ancient Git version

Merge branch 'da/difftool'Junio C Hamano Tue, 18 Nov 2014 18:16:54 +0000 (10:16 -0800)

Merge branch 'da/difftool'

Fix-up to a new feature in 'master'.

* da/difftool:
difftool: honor --trust-exit-code for builtin tools

t960[34]: mark cvsimport tests as requiring perlJeff King Tue, 18 Nov 2014 17:29:32 +0000 (12:29 -0500)

t960[34]: mark cvsimport tests as requiring perl

Git-cvsimport is written in perl, which understandably
causes the tests to fail if you build with NO_PERL (which
will avoid building cvsimport at all). The earlier cvsimport
tests in t9600-t9602 are all marked with a PERL
prerequisite, but these ones are not.

The one in t9603 was likely not noticed because it is an
expected failure anyway.

The ones in t9604 have been around for a long time, but it
is likely that the combination of NO_PERL and having cvsps
installed is rare enough that nobody noticed.

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

t0090: mark add-interactive test with PERL prerequisiteJeff King Tue, 18 Nov 2014 17:22:31 +0000 (12:22 -0500)

t0090: mark add-interactive test with PERL prerequisite

The add-interactive system is built in perl. If you build
with NO_PERL, running "git commit --interactive" will exit
with an error and the test will fail.

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

Makefile: have perl scripts depend on NO_PERL settingJeff King Tue, 18 Nov 2014 17:43:09 +0000 (12:43 -0500)

Makefile: have perl scripts depend on NO_PERL setting

If NO_PERL is not set, our perl scripts are built as
usual. If it is set, then we build "dummy" versions that
tell you git was built without perl support and exit
gracefully.

However, if you switch to NO_PERL in a directory with
existing build artifacts, we do not notice that the files
need rebuilt. We see only that they are newer than the
"unimplemented.sh" wrapper and assume they are done. So
doing:

make
make NO_PERL=Nope

would result in a git-add--interactive script that uses perl
(and running the test suite would make use of it).

Instead, we should trigger a rebuild of the perl scripts
anytime NO_PERL changes.

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

create_default_files(): don't set u+x bit on $GIT_DIR... Michael Haggerty Tue, 18 Nov 2014 13:50:24 +0000 (14:50 +0100)

create_default_files(): don't set u+x bit on $GIT_DIR/config

Since time immemorial, the test of whether to set "core.filemode"
has been done by trying to toggle the u+x bit on $GIT_DIR/config,
which we know always exists, and then testing whether the change
"took". I find it somewhat odd to use the config file for this
test, but whatever.

The test code didn't set the u+x bit back to its original state
itself, instead relying on the subsequent call to git_config_set()
to re-write the config file with correct permissions.

But ever since

daa22c6f8d config: preserve config file permissions on edits (2014-05-06)

git_config_set() copies the permissions from the old config file to
the new one. This is a good change in and of itself, but it
invalidates the create_default_files()'s assumption, causing "git
init" to leave the executable bit set on $GIT_DIR/config.

Reset the permissions on $GIT_DIR/config when we are done with the
test in create_default_files().

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

l10n: Update Catalan translationAlex Henrie Tue, 18 Nov 2014 03:22:48 +0000 (20:22 -0700)

l10n: Update Catalan translation

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

unpack_trees: plug leakage of o->resultJunio C Hamano Mon, 17 Nov 2014 20:12:41 +0000 (12:12 -0800)

unpack_trees: plug leakage of o->result

Most of the time the caller specifies to which destination variable
the resulting index_state should be assigned by passing a non-NULL
pointer in o->dst_index to receive that state, but for a caller that
gives a NULL o->dst_index, the resulting index simply leaked.

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

Merge branch 'master' of git://github.com/git-l10n... Junio C Hamano Mon, 17 Nov 2014 17:28:23 +0000 (09:28 -0800)

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

* 'master' of git://github.com/git-l10n/git-po:
l10n: de.po: translate 62 new messages
l10n: de.po: Fixup one translation
l10n: de.po: use imperative form for command options

Documentation: change "gitlink" typo in git-pushbrian m. carlson Mon, 17 Nov 2014 00:49:00 +0000 (00:49 +0000)

Documentation: change "gitlink" typo in git-push

The git-push manual page used "gitlink" in one place instead of
"linkgit". Fix this so the link renders correctly.

Noticed-by: Dan Allen <dan.j.allen@gmail.com>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply: fix typo in an error messageSlavomir Vlcek Mon, 17 Nov 2014 00:38:26 +0000 (01:38 +0100)

apply: fix typo in an error message

s/submoule/submodule

Signed-off-by: Slavomir Vlcek <svlc@inventati.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cmd_config(): make a copy of path obtained from git_path()Michael Haggerty Sun, 16 Nov 2014 07:37:44 +0000 (08:37 +0100)

cmd_config(): make a copy of path obtained from git_path()

The strings returned by git_path() are recycled after a while. Make
a copy of the config filename rather than holding onto the return
value from git_path().

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

use labs() for variables of type long instead of abs()René Scharfe Sat, 15 Nov 2014 13:27:21 +0000 (14:27 +0100)

use labs() for variables of type long instead of abs()

Using abs() on long values can cause truncation, so use labs() instead.
Reported by Clang 3.5 (-Wabsolute-value, enabled by -Wall).

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

use labs() for variables of type long instead of abs()René Scharfe Sat, 15 Nov 2014 13:27:21 +0000 (14:27 +0100)

use labs() for variables of type long instead of abs()

Using abs() on long values can cause truncation, so use labs() instead.
Reported by Clang 3.5 (-Wabsolute-value, enabled by -Wall).

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

Windows: correct detection of EISDIR in mingw_open()Johannes Sixt Sun, 16 Nov 2014 21:06:26 +0000 (22:06 +0100)

Windows: correct detection of EISDIR in mingw_open()

According to the Linux open(2) man page, open() must return EISDIR
if a directory was attempted to be opened for writing. Our emulation
in mingw_open() does not get this right: it checks only for O_CREAT.

Fix it to check for a write request.

This fixes a failure in reflog handling, which opens files with
O_APPEND|O_WRONLY, but without O_CREAT, and expects EISDIR when the
named file happens to be a directory.

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

l10n: de.po: translate 62 new messagesRalf Thielow Thu, 30 Oct 2014 08:00:47 +0000 (09:00 +0100)

l10n: de.po: translate 62 new messages

Translate 62 new messages came from git.pot update in 16742b0
(l10n: git.pot: proposed updates for v2.2.0 (+62)).

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

l10n: de.po: Fixup one translationStefan Beller Tue, 23 Sep 2014 12:54:46 +0000 (14:54 +0200)

l10n: de.po: Fixup one translation

English grammar with German words doesn't make it a German translation. ;)

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

difftool: honor --trust-exit-code for builtin toolsDavid Aguilar Fri, 14 Nov 2014 21:33:55 +0000 (13:33 -0800)

difftool: honor --trust-exit-code for builtin tools

run_merge_tool() was not setting $status, which prevented the
exit code for builtin tools from being forwarded to the caller.

Capture the exit status and add a test to guarantee the behavior.

Reported-by: Adria Farres <14farresa@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3301: modernize styleJohan Herland Wed, 12 Nov 2014 00:40:16 +0000 (01:40 +0100)

t3301: modernize style

Make this test script appear somewhat less old-fashioned:

- Use test helper functions:
- write_script
- test_commit
- test_write_lines
- test_line_count
- test_config
- test_unconfig
- test_path_is_missing

- Remove whitespace between redirection operators and their targets.

- Move preparation of "expect" files into tests.

- Rename "output" files to "actual".

- More consistent quoting, especially around commands that might
expand to nothing.

- More visibility of important whitespace with ${indent}.

- Combine pairs of tests that unnecessarily split setup and verification.

Improved-by: Eric Sunshine <sunshine@sunshineco.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Michael Blume <blume.mike@gmail.com>
Improved-by: Jeff King <peff@peff.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.2.0-rc2 v2.2.0-rc2Junio C Hamano Fri, 14 Nov 2014 21:31:15 +0000 (13:31 -0800)

Git 2.2.0-rc2

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

l10n: de.po: use imperative form for command optionsRalf Thielow Fri, 19 Sep 2014 16:38:13 +0000 (18:38 +0200)

l10n: de.po: use imperative form for command options

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

approxidate: allow ISO-like dates far in the futureJeff King Thu, 13 Nov 2014 21:43:31 +0000 (16:43 -0500)

approxidate: allow ISO-like dates far in the future

When we are parsing approxidate strings and we find three
numbers separate by one of ":/-.", we guess that it may be a
date. We feed the numbers to match_multi_number, which
checks whether it makes sense as a date in various orderings
(e.g., dd/mm/yy or mm/dd/yy, etc).

One of the checks we do is to see whether it is a date more
than 10 days in the future. This was added in 38035cf (date
parsing: be friendlier to our European friends.,
2006-04-05), and lets us guess that if it is currently April
2014, then "10/03/2014" is probably March 10th, not October
3rd.

This has a downside, though; if you want to be overly
generous with your "--until" date specification, we may
wrongly parse "2014-12-01" as "2014-01-12" (because the
latter is an in-the-past date). If the year is a future year
(i.e., both are future dates), it gets even weirder. Due to
the vagaries of approxidate, months _after_ the current date
(no matter the year) get flipped, but ones before do not.

This patch drops the "in the future" check for dates of this
form, letting us treat them always as yyyy-mm-dd, even if
they are in the future. This does not affect the normal
dd/mm/yyyy versus mm/dd/yyyy lookup, because this code path
only kicks in when the first number is greater than 70
(i.e., it must be a year, and cannot be either a date or a
month).

The one possible casualty is that "yyyy-dd-mm" is less
likely to be chosen over "yyyy-mm-dd". That's probably OK,
though because:

1. The difference happens only when the date is in the
future. Already we prefer yyyy-mm-dd for dates in the
past.

2. It's unclear whether anybody even uses yyyy-dd-mm
regularly. It does not appear in lists of common date
formats in Wikipedia[1,2].

3. Even if (2) is wrong, it is better to prefer ISO-like
dates, as that is consistent with what we use elsewhere
in git.

[1] http://en.wikipedia.org/wiki/Date_and_time_representation_by_country
[2] http://en.wikipedia.org/wiki/Calendar_date

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

checkout $tree: do not throw away unchanged index entriesJeff King Thu, 13 Nov 2014 18:30:34 +0000 (13:30 -0500)

checkout $tree: do not throw away unchanged index entries

When we "git checkout $tree", we pull paths from $tree into
the index, and then check the resulting entries out to the
worktree. Our method for the first step is rather
heavy-handed, though; it clobbers the entire existing index
entry, even if the content is the same. This means we lose
our stat information, leading checkout_entry to later
rewrite the entire file with identical content.

Instead, let's see if we have the identical entry already in
the index, in which case we leave it in place. That lets
checkout_entry do the right thing. Our tests cover two
interesting cases:

1. We make sure that a file which has no changes is not
rewritten.

2. We make sure that we do update a file that is unchanged
in the index (versus $tree), but has working tree
changes. We keep the old index entry, and
checkout_entry is able to realize that our stat
information is out of date.

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

pass TIME_DATE_NOW to approxidate future-checkJeff King Thu, 13 Nov 2014 11:04:52 +0000 (06:04 -0500)

pass TIME_DATE_NOW to approxidate future-check

The approxidate functions accept an extra "now" parameter to
avoid calling time() themselves. We use this in our test
suite to make sure we have a consistent time for computing
relative dates. However, deep in the bowels of approxidate,
we also call time() to check whether possible dates are far
in the future. Let's make sure that the "now" override makes
it to that spot, too, so we can consistently test that
feature.

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

gittutorial: fix output of 'git status'Stefan Naewe Thu, 13 Nov 2014 10:40:07 +0000 (10:40 +0000)

gittutorial: fix output of 'git status'

'git status' doesn't output leading '#'s these days.

Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5705: the file:// URL should be absoluteTorsten Bögershausen Thu, 13 Nov 2014 07:36:07 +0000 (08:36 +0100)

t5705: the file:// URL should be absolute

The test misused a URL "file://." to mean "relative to here",
which we no longer accept.

In a file:// URL, typically there is no host, and RFC1738 says that
file:///<path> should be used.

Update t5705 to use a working URL.

Reported-by: Michael Blume <blume.mike@gmail.com>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin: move builtin retrieval to get_builtin()Slavomir Vlcek Wed, 12 Nov 2014 13:10:22 +0000 (14:10 +0100)

builtin: move builtin retrieval to get_builtin()

There was a redundant code for a builtin command retrieval in
'handle_builtin()' and 'is_builtin()'.

Introduce a new function 'get_builtin()' and using it from
both of these places to reduce the redundancy.

Signed-off-by: Slavomir Vlcek <svlc@inventati.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

SubmittingPatches: final submission is To: maintainer... Slavomir Vlcek Wed, 12 Nov 2014 23:18:39 +0000 (00:18 +0100)

SubmittingPatches: final submission is To: maintainer and CC: list

In an earlier part there is:

"re-send it with "To:" set to the maintainer [*1*] and "cc:" the list [*2*]"

for the final submission, but later we see

"Send it to the list and cc the maintainer."

Fix the later one to match the previous.

Signed-off-by: Slavomir Vlcek <svlc@inventati.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 2.2Junio C Hamano Wed, 12 Nov 2014 20:12:50 +0000 (12:12 -0800)

Update draft release notes to 2.2

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

Sync with 'maint'Junio C Hamano Wed, 12 Nov 2014 20:13:25 +0000 (12:13 -0800)

Sync with 'maint'

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 'jk/fetch-reflog-df-conflict'Junio C Hamano Wed, 12 Nov 2014 19:59:58 +0000 (11:59 -0800)

Merge branch 'jk/fetch-reflog-df-conflict'

Fix-up a test for portability.

* jk/fetch-reflog-df-conflict:
t1410: fix breakage on case-insensitive filesystems

notes: empty notes should be shown by 'git log'Johan Herland Wed, 12 Nov 2014 00:40:15 +0000 (01:40 +0100)

notes: empty notes should be shown by 'git log'

If the user has gone through the trouble of explicitly adding an empty
note, then "git log" should not silently skip it (as if it didn't exist).

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: add --allow-empty, to allow storing... Johan Herland Wed, 12 Nov 2014 00:40:14 +0000 (01:40 +0100)

builtin/notes: add --allow-empty, to allow storing empty notes

Although the "git notes" man page advertises that we support binary-safe
notes addition (using the -C option), we currently do not support adding
the empty note (i.e. using the empty blob to annotate an object). Instead,
an empty note is always treated as an intent to remove the note
altogether.

Introduce the --allow-empty option to the add/append/edit subcommands,
to explicitly allow an empty note to be stored into the notes tree.

Also update the documentation, and add test cases for the new option.

Reported-by: James H. Fisher <jhf@trifork.com>
Improved-by: Kyle J. McKay <mackyle@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: split create_note() to clarify add vs... Johan Herland Wed, 12 Nov 2014 00:40:13 +0000 (01:40 +0100)

builtin/notes: split create_note() to clarify add vs. remove logic

create_note() has a non-trivial interface, and comprises three loosely
related parts:

1. launching the editor with the note contents, if needed
2. appending to an existing note, if append_only was given
3. adding or removing the resulting note, based on whether it's non-empty

Split it along those lines to make the logic clearer: The first part
goes into a new function - prepare_note_data(), with a simpler interface.
The second part is moved into append_edit(), which is the only user of
this code. Finally, the add vs. remove decision is moved into the callers
(add() and append_edit()), keeping the logic for writing the actual note
object in a separate function: write_note_data().

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: simplify early exit code in add()Johan Herland Wed, 12 Nov 2014 00:40:12 +0000 (01:40 +0100)

builtin/notes: simplify early exit code in add()

Remove the need for 'retval' and the unnecessary goto. Also reorganize
to only call free_note_data() is actually needed.

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: add some crossrefs between manual pagesMax Horn Tue, 11 Nov 2014 20:17:07 +0000 (21:17 +0100)

doc: add some crossrefs between manual pages

In particular, git-fast-import and -export link to each
other, and gitremote-helpers links to existing remote
helpers, and vice versa. Also link to fast-import from the
remote helper spec, as this is relevant for remote helpers
using the fast-import format.

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

gittutorial.txt: remove reference to ancient Git versionThomas Ackermann Tue, 11 Nov 2014 19:13:36 +0000 (20:13 +0100)

gittutorial.txt: remove reference to ancient Git version

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with maintJunio C Hamano Tue, 11 Nov 2014 20:45:48 +0000 (12:45 -0800)

Sync with maint

* maint:

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

run-command: use void to declare that functions take... René Scharfe Mon, 10 Nov 2014 21:17:00 +0000 (22:17 +0100)

run-command: use void to declare that functions take no parameters

Explicitly declare that git_atexit_dispatch() and git_atexit_clear()
take no parameters instead of leaving their parameter list empty and
thus unspecified.

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

builtin/notes: refactor note file path into struct... Johan Herland Sun, 9 Nov 2014 12:30:50 +0000 (13:30 +0100)

builtin/notes: refactor note file path into struct note_data

Move the 'path' variable from create_note() and into the
note_data struct. Unify cleanup of note_data objects with
a free_note_data() function.

This might not make too much sense on its own, but it makes the
future refactoring of create_note() considerably cleaner.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: improve namingJohan Herland Sun, 9 Nov 2014 12:30:49 +0000 (13:30 +0100)

builtin/notes: improve naming

In preparation for some needed refactoring, rename struct msg_arg to
struct note_data, and rename its instances from "msg" to "d" (also
removing some unnecessary parentheses). The 'msg_arg' name was
inherited from tag.c, but is not really a good name for the contents
of a note.

Also rename write_note_data() to copy_obj_to_fd(), which more aptly
describes what it actually does: Copying the contents of a git object
(given by its SHA1) into a given file descriptor.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3301: verify that 'git notes' removes empty notes... Johan Herland Sun, 9 Nov 2014 12:30:48 +0000 (13:30 +0100)

t3301: verify that 'git notes' removes empty notes by default

Add test cases documenting the current behavior when trying to
add/append/edit empty notes. This is in preparation for adding
--allow-empty; to allow empty notes to be stored.

Improved-by: Eric Sunshine <sunshine@sunshineco.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/notes: fix premature failure when trying to... Johan Herland Sun, 9 Nov 2014 12:30:47 +0000 (13:30 +0100)

builtin/notes: fix premature failure when trying to add the empty blob

This fixes a small buglet when trying to explicitly add the empty blob
as a note object using the -c or -C option to git notes add/append.
Instead of failing with a nonsensical error message indicating that the
empty blob does not exist, we should rather behave as if an empty notes
message was given (e.g. using -m "" or -F /dev/null).

The next patch contains a test that verifies the fixed behavior.

Found-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'master' of git://github.com/git-l10n... Junio C Hamano Mon, 10 Nov 2014 19:59:30 +0000 (11:59 -0800)

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

* 'master' of git://github.com/git-l10n/git-po:
l10n: Updated Bulgarian translation of git (2296t,0f,0u)
l10n: zh_CN: translations for git v2.2.0-rc0
l10n: sv.po: Update Swedish translation (2296t0f0u)
l10n: fr.po (2296t) update for version 2.2.0
l10n: vi.po: Update new message strings
l10n: git.pot: v2.2.0 round 1 (62 new, 23 removed)

Sync with maintJunio C Hamano Mon, 10 Nov 2014 19:26:18 +0000 (11:26 -0800)

Sync with maint

* maint:
Documentation/config.txt: fix minor typo
config.txt: fix typo

Merge branch 'js/diff-highlight-avoid-sigpipe'Junio C Hamano Mon, 10 Nov 2014 19:26:09 +0000 (11:26 -0800)

Merge branch 'js/diff-highlight-avoid-sigpipe'

* js/diff-highlight-avoid-sigpipe:
diff-highlight: exit when a pipe is broken

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>

use args member of struct child_processRené Scharfe Sun, 9 Nov 2014 13:49:54 +0000 (14:49 +0100)

use args member of struct child_process

Convert users of struct child_process to using the managed argv_array
args instead of providing their own. This shortens the code a bit and
ensures that the allocated memory is released automatically after use.

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