git.git
8 years agofast-import: convert to struct object_id
brian m. carlson [Sat, 6 May 2017 22:09:56 +0000 (22:09 +0000)]
fast-import: convert to struct object_id

Convert the remaining parts of fast-import.c to use struct object_id.
Convert several instances of get_sha1_hex to parse_oid_hex to avoid
needing to specify constants.  Convert other hardcoded values to named
constants.  Finally, use the is_empty_tree_oid function instead of a
direct comparison against a fixed string.

Note that the odd computation with GIT_MAX_HEXSZ is due to the insertion
of a slash between every two hex digits in the path, plus one for the
terminating NUL.

Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agosubmodule_uses_worktrees(): plug memory leak
Johannes Schindelin [Thu, 4 May 2017 13:59:19 +0000 (15:59 +0200)]
submodule_uses_worktrees(): plug memory leak

There is really no reason why we would need to hold onto the allocated
string longer than necessary.

Reported by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoshow_worktree(): plug memory leak
Johannes Schindelin [Thu, 4 May 2017 13:59:13 +0000 (15:59 +0200)]
show_worktree(): plug memory leak

The buffer allocated by shorten_unambiguous_ref() needs to be released.

Discovered by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoname-rev: avoid leaking memory in the `deref` case
Johannes Schindelin [Thu, 4 May 2017 13:59:06 +0000 (15:59 +0200)]
name-rev: avoid leaking memory in the `deref` case

When the `name_rev()` function is asked to dereference the tip name, it
allocates memory. But when it turns out that another tip already
described the commit better than the current one, we forgot to release
the memory.

Pointed out by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoremote: plug memory leak in match_explicit()
Johannes Schindelin [Thu, 4 May 2017 13:59:01 +0000 (15:59 +0200)]
remote: plug memory leak in match_explicit()

The `guess_ref()` returns an allocated buffer of which `make_linked_ref()`
does not take custody (`alloc_ref()` makes a copy), therefore we need to
release the buffer afterwards.

Noticed via Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoadd_reflog_for_walk: avoid memory leak
Johannes Schindelin [Thu, 4 May 2017 13:58:42 +0000 (15:58 +0200)]
add_reflog_for_walk: avoid memory leak

We free()d the `log` buffer when dwim_log() returned 1, but not when it
returned a larger value (which meant that it still allocated the buffer
but we simply ignored it).

While in the vicinity, make sure that the `reflogs` structure as well as
the `branch` variable are released properly, too.

Identified by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoshallow: avoid memory leak
Johannes Schindelin [Thu, 4 May 2017 13:58:35 +0000 (15:58 +0200)]
shallow: avoid memory leak

Reported by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoline-log: avoid memory leak
Johannes Schindelin [Thu, 4 May 2017 13:58:01 +0000 (15:58 +0200)]
line-log: avoid memory leak

Discovered by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoreceive-pack: plug memory leak in update()
Johannes Schindelin [Thu, 4 May 2017 13:57:55 +0000 (15:57 +0200)]
receive-pack: plug memory leak in update()

Reported via Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agofast-export: avoid leaking memory in handle_tag()
Johannes Schindelin [Thu, 4 May 2017 13:57:33 +0000 (15:57 +0200)]
fast-export: avoid leaking memory in handle_tag()

Reported by, you guessed it, Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agomktree: plug memory leaks reported by Coverity
Johannes Schindelin [Thu, 4 May 2017 13:57:28 +0000 (15:57 +0200)]
mktree: plug memory leaks reported by Coverity

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agopack-redundant: plug memory leak
Johannes Schindelin [Thu, 4 May 2017 13:56:54 +0000 (15:56 +0200)]
pack-redundant: plug memory leak

Identified via Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agosetup_discovered_git_dir(): plug memory leak
Johannes Schindelin [Thu, 4 May 2017 13:56:51 +0000 (15:56 +0200)]
setup_discovered_git_dir(): plug memory leak

The setup_explicit_git_dir() function does not take custody of the string
passed as first parameter; we have to release it if we turned the value of
git_dir into an absolute path.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agosetup_bare_git_dir(): help static analysis
Johannes Schindelin [Thu, 4 May 2017 13:56:47 +0000 (15:56 +0200)]
setup_bare_git_dir(): help static analysis

Coverity reported a memory leak in this function. However, it can only
be called once, as setup_git_directory() changes global state and hence
is not reentrant.

Mark the variable as static to indicate that this is a singleton.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agosplit_commit_in_progress(): simplify & fix memory leak
Johannes Schindelin [Thu, 4 May 2017 13:56:44 +0000 (15:56 +0200)]
split_commit_in_progress(): simplify & fix memory leak

This function did a whole lot of unnecessary work, such as reading in
four files just to figure out that, oh, hey, we do not need to look at
them after all because the HEAD is not detached.

Simplify the entire function to return early when possible, to read in
the files only when necessary, and to release the allocated memory
always (there was a leak, reported via Coverity, where we failed to
release the allocated strings if the HEAD is not detached).

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agocheckout: fix memory leak
Johannes Schindelin [Thu, 4 May 2017 13:56:40 +0000 (15:56 +0200)]
checkout: fix memory leak

This change addresses part of the NEEDSWORK comment above the code,
therefore the comment needs to be adjusted, too.

Discovered via Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agocat-file: fix memory leak
Johannes Schindelin [Thu, 4 May 2017 13:56:17 +0000 (15:56 +0200)]
cat-file: fix memory leak

Discovered by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agomailinfo & mailsplit: check for EOF while parsing
Johannes Schindelin [Thu, 4 May 2017 13:56:14 +0000 (15:56 +0200)]
mailinfo & mailsplit: check for EOF while parsing

While POSIX states that it is okay to pass EOF to isspace() (and it seems
to be implied that EOF should *not* be treated as whitespace), and also to
pass EOF to ungetc() (which seems to be intended to fail without buffering
the character), it is much better to handle these cases explicitly. Not
only does it reduce head-scratching (and helps static analysis avoid
reporting false positives), it also lets us handle files containing
nothing but whitespace by erroring out.

Reported via Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agostatus: close file descriptor after reading git-rebase-todo
Johannes Schindelin [Thu, 4 May 2017 13:55:52 +0000 (15:55 +0200)]
status: close file descriptor after reading git-rebase-todo

Reported via Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodifftool: address a couple of resource/memory leaks
Johannes Schindelin [Thu, 4 May 2017 13:55:48 +0000 (15:55 +0200)]
difftool: address a couple of resource/memory leaks

This change plugs a couple of memory leaks and makes sure that the file
descriptor is closed in run_dir_diff().

Spotted by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoget_mail_commit_oid(): avoid resource leak
Johannes Schindelin [Thu, 4 May 2017 13:55:45 +0000 (15:55 +0200)]
get_mail_commit_oid(): avoid resource leak

When we fail to read, or parse, the file, we still want to close the file
descriptor and release the strbuf.

Reported via Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agogit_config_rename_section_in_file(): avoid resource leak
Johannes Schindelin [Thu, 4 May 2017 13:55:41 +0000 (15:55 +0200)]
git_config_rename_section_in_file(): avoid resource leak

In case of errors, we really want the file descriptor to be closed.

Discovered by a Coverity scan.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoadd_commit_patch_id(): avoid allocating memory unnecessarily
Johannes Schindelin [Thu, 4 May 2017 13:55:38 +0000 (15:55 +0200)]
add_commit_patch_id(): avoid allocating memory unnecessarily

It would appear that we allocate (and forget to release) memory if the
patch ID is not even defined.

Reported by the Coverity tool.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agowinansi: avoid buffer overrun
Johannes Schindelin [Thu, 4 May 2017 13:55:34 +0000 (15:55 +0200)]
winansi: avoid buffer overrun

When we could not convert the UTF-8 sequence into Unicode for writing to
the Console, we should not try to write an insanely-long sequence of
invalid wide characters (mistaking the negative return value for an
unsigned length).

Reported by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agowinansi: avoid use of uninitialized value
Johannes Schindelin [Thu, 4 May 2017 13:55:29 +0000 (15:55 +0200)]
winansi: avoid use of uninitialized value

To initialize the foreground color attributes of "plain text", our ANSI
emulation tries to infer them from the currently attached console while
running the is_console() function. This function first tries to detect any
console attached to stdout, then it is called with stderr.

If neither stdout nor stderr has any console attached, it does not
actually matter what we use for "plain text" attributes, as we never need
to output any text to any console in that case.

However, after working on stdout and stderr, is_console() is called with
stdin, and it still tries to initialize the "plain text" attributes if
they had not been initialized earlier. In this case, we cannot detect any
attributes, and we used an uninitialized value for them.

Naturally, Coverity complained about this use case because it could not
reason about the code deeply enough to figure out that we do not even use
those attributes in that case.

Let's just initialize the value to 0 in that case, both to avoid future
Coverity reports, and to help catch future regressions in case anybody
changes the order of the is_console() calls (which would make the text
black on black).

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agomingw: avoid memory leak when splitting PATH
Johannes Schindelin [Thu, 4 May 2017 13:55:24 +0000 (15:55 +0200)]
mingw: avoid memory leak when splitting PATH

In the (admittedly, concocted) case that PATH consists only of path
delimiters, we would leak the duplicated string.

Reported by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoam: check return value of resolve_refdup before using hash
René Scharfe [Sat, 6 May 2017 17:13:56 +0000 (19:13 +0200)]
am: check return value of resolve_refdup before using hash

If resolve_refdup() fails it returns NULL and possibly leaves its hash
output parameter untouched.  Make sure to use it only if the function
succeeded, in order to avoid accessing uninitialized memory.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agocheckout: check return value of resolve_refdup before using hash
René Scharfe [Sat, 6 May 2017 17:13:52 +0000 (19:13 +0200)]
checkout: check return value of resolve_refdup before using hash

If resolve_refdup() fails it returns NULL and possibly leaves its hash
output parameter untouched.  Make sure to use it only if the function
succeeded, in order to avoid accessing uninitialized memory.

Found with t/t2011-checkout-invalid-head.sh --valgrind.

Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoconvert: move packet_write_line() into pkt-line as packet_writel()
Ben Peart [Fri, 5 May 2017 15:27:56 +0000 (11:27 -0400)]
convert: move packet_write_line() into pkt-line as packet_writel()

Add packet_writel() which writes multiple lines in a single call and
then calls packet_flush_gently(). Update convert.c to use the new
packet_writel() function from pkt-line.

Signed-off-by: Ben Peart <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agopkt-line: add packet_read_line_gently()
Ben Peart [Fri, 5 May 2017 15:27:55 +0000 (11:27 -0400)]
pkt-line: add packet_read_line_gently()

Add packet_read_line_gently() to enable reading a line without dying on
EOF.

Signed-off-by: Ben Peart <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agopkt-line: fix packet_read_line() to handle len < 0 errors
Ben Peart [Fri, 5 May 2017 15:27:54 +0000 (11:27 -0400)]
pkt-line: fix packet_read_line() to handle len < 0 errors

Update packet_read_line() to test for len > 0 to avoid potential bug
if read functions return lengths less than zero to indicate errors.

Signed-off-by: Ben Peart <redacted>
Found/Fixed-by: Lars Schneider <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agoconvert: remove erroneous tests for errno == EPIPE
Ben Peart [Fri, 5 May 2017 15:27:53 +0000 (11:27 -0400)]
convert: remove erroneous tests for errno == EPIPE

start_multi_file_filter() and apply_multi_file_filter() currently test
for errno == EPIPE but treating EPIPE as an error is already happening
from one of the packet_write() functions.

Signed-off-by: Ben Peart <redacted>
Found/Fixed-by: Jeff King <redacted>
Acked-by: Lars Schneider <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agop3400: add perf tests for rebasing many changes
Christian Couder [Fri, 5 May 2017 14:57:13 +0000 (16:57 +0200)]
p3400: add perf tests for rebasing many changes

Rebasing onto many changes is interesting, but it's also
interesting to see what happens when rebasing many changes.

And while at it, let's also look at the impact of using a
split index.

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agosplit-index: add and use unshare_split_index()
Nguyễn Thái Ngọc Duy [Fri, 5 May 2017 14:57:12 +0000 (16:57 +0200)]
split-index: add and use unshare_split_index()

When split-index is being used, we have two cache_entry arrays in
index_state->cache[] and index_state->split_index->base->cache[].

index_state->cache[] may share the same entries with base->cache[] so
we can quickly determine what entries are shared. This makes memory
management tricky, we can't free base->cache[] until we know
index_state->cache[] does not point to any of those entries.

unshare_split_index() is added for this purpose, to find shared
entries and either duplicate them in index_state->cache[], or discard
them. Either way it should be safe to free base->cache[] after
unshare_split_index().

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodoc: replace a couple of broken gmane links
Ævar Arnfjörð Bjarmason [Fri, 5 May 2017 10:08:03 +0000 (10:08 +0000)]
doc: replace a couple of broken gmane links

Replace a couple of broken links to gmane with links to other
archives. See commit 54471fdcc3 ("README: replace gmane link with
public-inbox", 2016-12-15) for prior art.

With this change there's still 4 references left in the code:

    $ git grep -E '(article|thread)\.gmane.org' -- |grep -v RelNotes|wc -l
    4

I couldn't find alternative links for those.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodiff: recurse into nested submodules for inline diff
Stefan Beller [Thu, 4 May 2017 21:43:55 +0000 (14:43 -0700)]
diff: recurse into nested submodules for inline diff

When fd47ae6a5b (diff: teach diff to display submodule difference with an
inline diff, 2016-08-31) was introduced, we did not think of recursing
into nested submodules.

When showing the inline diff for submodules, automatically recurse
into nested submodules as well with inline submodule diffs.

Signed-off-by: Stefan Beller <redacted>
Acked-by: Jacob Keller <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert fill_directory to take an index
Brandon Williams [Fri, 5 May 2017 19:53:34 +0000 (12:53 -0700)]
dir: convert fill_directory to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert read_directory to take an index
Brandon Williams [Fri, 5 May 2017 19:53:33 +0000 (12:53 -0700)]
dir: convert read_directory to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert read_directory_recursive to take an index
Brandon Williams [Fri, 5 May 2017 19:53:32 +0000 (12:53 -0700)]
dir: convert read_directory_recursive to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert open_cached_dir to take an index
Brandon Williams [Fri, 5 May 2017 19:53:31 +0000 (12:53 -0700)]
dir: convert open_cached_dir to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert is_excluded to take an index
Brandon Williams [Fri, 5 May 2017 19:53:30 +0000 (12:53 -0700)]
dir: convert is_excluded to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert prep_exclude to take an index
Brandon Williams [Fri, 5 May 2017 19:53:29 +0000 (12:53 -0700)]
dir: convert prep_exclude to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert add_excludes to take an index
Brandon Williams [Fri, 5 May 2017 19:53:28 +0000 (12:53 -0700)]
dir: convert add_excludes to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert is_excluded_from_list to take an index
Brandon Williams [Fri, 5 May 2017 19:53:27 +0000 (12:53 -0700)]
dir: convert is_excluded_from_list to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert last_exclude_matching_from_list to take an index
Brandon Williams [Fri, 5 May 2017 19:53:26 +0000 (12:53 -0700)]
dir: convert last_exclude_matching_from_list to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert dir_add* to take an index
Brandon Williams [Fri, 5 May 2017 19:53:25 +0000 (12:53 -0700)]
dir: convert dir_add* to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert get_dtype to take index
Brandon Williams [Fri, 5 May 2017 19:53:24 +0000 (12:53 -0700)]
dir: convert get_dtype to take index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert directory_exists_in_index to take index
Brandon Williams [Fri, 5 May 2017 19:53:23 +0000 (12:53 -0700)]
dir: convert directory_exists_in_index to take index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: convert read_skip_worktree_file_from_index to take an index
Brandon Williams [Fri, 5 May 2017 19:53:22 +0000 (12:53 -0700)]
dir: convert read_skip_worktree_file_from_index to take an index

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agodir: stop using the index compatibility macros
Brandon Williams [Fri, 5 May 2017 19:53:21 +0000 (12:53 -0700)]
dir: stop using the index compatibility macros

In order to make it clearer where the_index is being referenced, stop
using the index compatibility macros in dir.c.  This is to make it
easier to identify the functions which need to be convert to taking in a
'struct index_state' as a parameter.

The end goal would be to eliminate the need to reference global index
state in dir.c.

Signed-off-by: Brandon Williams <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agol10n: fr.po v2.13 rnd 2
Jean-Noel Avila [Fri, 5 May 2017 09:55:14 +0000 (11:55 +0200)]
l10n: fr.po v2.13 rnd 2

Signed-off-by: Jean-Noel Avila <redacted>
8 years agol10n: de.po: translate 4 new messages
Ralf Thielow [Fri, 5 May 2017 09:23:53 +0000 (11:23 +0200)]
l10n: de.po: translate 4 new messages

Translate 4 new messages came from git.pot update in 28e1aaa48 (l10n:
git.pot: v2.13.0 round 2 (4 new, 7 removed)).

Signed-off-by: Ralf Thielow <redacted>
Acked-by: Matthias Rüster <redacted>
8 years agol10n: de.po: update German translation
Ralf Thielow [Thu, 13 Apr 2017 14:45:29 +0000 (16:45 +0200)]
l10n: de.po: update German translation

Translate 96 new messages came from git.pot update in dfc182b (l10n:
git.pot: v2.13.0 round 1 (96 new, 37 removed)).

Signed-off-by: Ralf Thielow <redacted>
Acked-by: Matthias Rüster <redacted>
8 years agol10n: de.po: lower case after semi-colon
Michael J Gruber [Fri, 17 Mar 2017 15:04:19 +0000 (16:04 +0100)]
l10n: de.po: lower case after semi-colon

Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Ralf Thielow <redacted>
8 years agol10n: vi.po(3195t): Update translation for v2.13.0 round 2
Tran Ngoc Quan [Fri, 5 May 2017 06:41:32 +0000 (13:41 +0700)]
l10n: vi.po(3195t): Update translation for v2.13.0 round 2

Signed-off-by: Tran Ngoc Quan <redacted>
8 years agoGit 2.12.3
Junio C Hamano [Fri, 5 May 2017 04:33:22 +0000 (13:33 +0900)]
Git 2.12.3

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'maint-2.11' into maint
Junio C Hamano [Fri, 5 May 2017 04:31:40 +0000 (13:31 +0900)]
Merge branch 'maint-2.11' into maint

8 years agoGit 2.11.2
Junio C Hamano [Fri, 5 May 2017 04:29:43 +0000 (13:29 +0900)]
Git 2.11.2

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'maint-2.10' into maint-2.11
Junio C Hamano [Fri, 5 May 2017 04:26:31 +0000 (13:26 +0900)]
Merge branch 'maint-2.10' into maint-2.11

8 years agoGit 2.10.3
Junio C Hamano [Fri, 5 May 2017 04:24:10 +0000 (13:24 +0900)]
Git 2.10.3

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'maint-2.9' into maint-2.10
Junio C Hamano [Fri, 5 May 2017 04:21:52 +0000 (13:21 +0900)]
Merge branch 'maint-2.9' into maint-2.10

8 years agoGit 2.9.4
Junio C Hamano [Fri, 5 May 2017 04:18:23 +0000 (13:18 +0900)]
Git 2.9.4

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'maint-2.8' into maint-2.9
Junio C Hamano [Fri, 5 May 2017 04:13:48 +0000 (13:13 +0900)]
Merge branch 'maint-2.8' into maint-2.9

8 years agoGit 2.8.5
Junio C Hamano [Fri, 5 May 2017 04:08:54 +0000 (13:08 +0900)]
Git 2.8.5

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'maint-2.7' into maint-2.8
Junio C Hamano [Fri, 5 May 2017 04:05:03 +0000 (13:05 +0900)]
Merge branch 'maint-2.7' into maint-2.8

8 years agoGit 2.7.5
Junio C Hamano [Fri, 5 May 2017 04:03:40 +0000 (13:03 +0900)]
Git 2.7.5

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'maint-2.6' into maint-2.7
Junio C Hamano [Fri, 5 May 2017 03:59:16 +0000 (12:59 +0900)]
Merge branch 'maint-2.6' into maint-2.7

8 years agoGit 2.6.7
Junio C Hamano [Fri, 5 May 2017 03:56:19 +0000 (12:56 +0900)]
Git 2.6.7

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'maint-2.5' into maint-2.6
Junio C Hamano [Fri, 5 May 2017 03:52:26 +0000 (12:52 +0900)]
Merge branch 'maint-2.5' into maint-2.6

8 years agoGit 2.5.6
Junio C Hamano [Fri, 5 May 2017 03:49:00 +0000 (12:49 +0900)]
Git 2.5.6

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'maint-2.4' into maint-2.5
Junio C Hamano [Fri, 5 May 2017 03:46:53 +0000 (12:46 +0900)]
Merge branch 'maint-2.4' into maint-2.5

8 years agoGit 2.4.12
Junio C Hamano [Fri, 5 May 2017 03:25:09 +0000 (12:25 +0900)]
Git 2.4.12

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'jk/shell-no-repository-that-begins-with-dash' into maint-2.4
Junio C Hamano [Fri, 5 May 2017 03:17:55 +0000 (12:17 +0900)]
Merge branch 'jk/shell-no-repository-that-begins-with-dash' into maint-2.4

* jk/shell-no-repository-that-begins-with-dash:
  shell: disallow repo names beginning with dash

8 years agoshell: disallow repo names beginning with dash
Jeff King [Sat, 29 Apr 2017 12:36:44 +0000 (08:36 -0400)]
shell: disallow repo names beginning with dash

When a remote server uses git-shell, the client side will
connect to it like:

  ssh server "git-upload-pack 'foo.git'"

and we literally exec ("git-upload-pack", "foo.git"). In
early versions of upload-pack and receive-pack, we took a
repository argument and nothing else. But over time they
learned to accept dashed options. If the user passes a
repository name that starts with a dash, the results are
confusing at best (we complain of a bogus option instead of
a non-existent repository) and malicious at worst (the user
can start an interactive pager via "--help").

We could pass "--" to the sub-process to make sure the
user's argument is interpreted as a branch name. I.e.:

  git-upload-pack -- -foo.git

But adding "--" automatically would make us inconsistent
with a normal shell (i.e., when git-shell is not in use),
where "-foo.git" would still be an error. For that case, the
client would have to specify the "--", but they can't do so
reliably, as existing versions of git-shell do not allow
more than a single argument.

The simplest thing is to simply disallow "-" at the start of
the repo name argument. This hasn't worked either with or
without git-shell since version 1.0.0, and nobody has
complained.

Note that this patch just applies to do_generic_cmd(), which
runs upload-pack, receive-pack, and upload-archive. There
are two other types of commands that git-shell runs:

  - do_cvs_cmd(), but this already restricts the argument to
    be the literal string "server"

  - admin-provided commands in the git-shell-commands
    directory. We'll pass along arbitrary arguments there,
    so these commands could have similar problems. But these
    commands might actually understand dashed arguments, so
    we cannot just block them here. It's up to the writer of
    the commands to make sure they are safe. With great
    power comes great responsibility.

Reported-by: Timo Schmid <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agol10n: git.pot: v2.13.0 round 2 (4 new, 7 removed)
Jiang Xin [Fri, 5 May 2017 01:37:02 +0000 (09:37 +0800)]
l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed)

Generate po/git.pot from v2.13.0-rc2 for git v2.13.0 l10n round 2.

Signed-off-by: Jiang Xin <redacted>
8 years agoMerge branch 'master' of git://github.com/git-l10n/git-po
Jiang Xin [Fri, 5 May 2017 01:35:22 +0000 (09:35 +0800)]
Merge branch 'master' of git://github.com/git-l10n/git-po

* 'master' of git://github.com/git-l10n/git-po:
  l10n: zh_CN: for git v2.13.0 l10n round 1
  l10n: fr.po v2.13 round 1
  l10n: pt_PT: update Portuguese translation
  l10n: bg.po: Updated Bulgarian translation (3201t)
  l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0
  l10n: sv.po: Update Swedish translation (3199t0f0u)
  l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)

8 years agol10n: zh_CN: for git v2.13.0 l10n round 1
Jiang Xin [Sun, 23 Apr 2017 01:55:51 +0000 (09:55 +0800)]
l10n: zh_CN: for git v2.13.0 l10n round 1

Translate 96 messages (3198t0f0u) for git v2.13.0-rc0.

Reviewed-by: 依云 <redacted>
Signed-off-by: Jiang Xin <redacted>
8 years agoMerge branch 'fr_l10n_v2.13_rnd1' of git://github.com/jnavila/git
Jiang Xin [Fri, 5 May 2017 01:30:33 +0000 (09:30 +0800)]
Merge branch 'fr_l10n_v2.13_rnd1' of git://github.com/jnavila/git

* 'fr_l10n_v2.13_rnd1' of git://github.com/jnavila/git:
  l10n: fr.po v2.13 round 1

8 years agoGit 2.13-rc2
Junio C Hamano [Thu, 4 May 2017 07:27:19 +0000 (16:27 +0900)]
Git 2.13-rc2

Signed-off-by: Junio C Hamano <redacted>
8 years agoMerge branch 'rg/a-the-typo'
Junio C Hamano [Thu, 4 May 2017 07:26:47 +0000 (16:26 +0900)]
Merge branch 'rg/a-the-typo'

Typofix.

* rg/a-the-typo:
  fix minor typos

8 years agoMerge branch 'sr/hooks-cwd-doc'
Junio C Hamano [Thu, 4 May 2017 07:26:46 +0000 (16:26 +0900)]
Merge branch 'sr/hooks-cwd-doc'

* sr/hooks-cwd-doc:
  githooks.txt: clarify push hooks are always executed in $GIT_DIR

8 years agoMerge branch 'rg/doc-submittingpatches-wordfix'
Junio C Hamano [Thu, 4 May 2017 07:26:46 +0000 (16:26 +0900)]
Merge branch 'rg/doc-submittingpatches-wordfix'

* rg/doc-submittingpatches-wordfix:
  doc: update SubmittingPatches

8 years agoMerge branch 'rg/doc-pull-typofix'
Junio C Hamano [Thu, 4 May 2017 07:26:45 +0000 (16:26 +0900)]
Merge branch 'rg/doc-pull-typofix'

* rg/doc-pull-typofix:
  doc: git-pull.txt use US spelling, fix minor typo

8 years agoMerge branch 'ja/i18n-cleanup'
Junio C Hamano [Thu, 4 May 2017 07:26:44 +0000 (16:26 +0900)]
Merge branch 'ja/i18n-cleanup'

* ja/i18n-cleanup:
  i18n: read-cache: typofix
  i18n: remove i18n from tag reflog message

8 years agoconfig.mak.uname: set NO_REGEX=NeedsStartEnd on AIX
Ævar Arnfjörð Bjarmason [Wed, 3 May 2017 13:54:30 +0000 (13:54 +0000)]
config.mak.uname: set NO_REGEX=NeedsStartEnd on AIX

Set the NO_REGEX=NeedsStartEnd Makefile flag by default on AIX.

Since commit 2f8952250a ("regex: add regexec_buf() that can work on a
non NUL-terminated string", 2016-09-21) git has errored out at
compile-time if the regular expression library doesn't support
REG_STARTEND.

While looking through Google search results for the use of NO_REGEX I
found a Chef recipe that set this on AIX[1], looking through the
documentation for the latest version of AIX (7.2, released October
2015) shows that its regexec() doesn't have REG_STARTEND.

1. https://github.com/chef/omnibus-software/commit/e247e36761#diff-3df898345d670979b74acc0bf71d8c47
2. https://www.ibm.com/support/knowledgecenter/ssw_aix_72/com.ibm.aix.basetrf2/regexec.htm

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agotravis-ci: retry if Git for Windows CI returns HTTP error 502 or 503
Lars Schneider [Wed, 3 May 2017 21:50:15 +0000 (23:50 +0200)]
travis-ci: retry if Git for Windows CI returns HTTP error 502 or 503

The Git for Windows CI web app sometimes returns HTTP errors of
"502 bad gateway" or "503 service unavailable" [1]. We also need to
check the HTTP content because the GfW web app seems to pass through
(error) results from other Azure calls with HTTP code 200.
Wait a little and retry the request if this happens.

[1] https://docs.microsoft.com/en-in/azure/app-service-web/app-service-web-troubleshoot-http-502-http-503

Signed-off-by: Lars Schneider <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agotravis-ci: handle Git for Windows CI status "failed" explicitly
Lars Schneider [Sat, 29 Apr 2017 18:59:58 +0000 (20:59 +0200)]
travis-ci: handle Git for Windows CI status "failed" explicitly

Git for Windows CI returns "completed: failed" if a build or test
failure happened. This case was processed as "Unhandled status".
Handle the case explicitly.

Signed-off-by: Lars Schneider <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agosubmodule: properly recurse for read-tree and checkout
Stefan Beller [Tue, 2 May 2017 19:32:14 +0000 (12:32 -0700)]
submodule: properly recurse for read-tree and checkout

We forgot to prepare the submodule env, which is only a problem for
nested submodules. See 2e5d6503bd (ls-files: fix recurse-submodules
with nested submodules, 2017-04-13) for further explanation.

To come up with a proper test for this, we'd need to look at nested
submodules just as in that given commit. It turns out we're lucky
and these tests already exist, but are marked as failing. We need
to pass `--recurse-submodules` to read-tree additionally to make
these tests pass. Passing that flag alone would not make the tests
pass, such that this covers testing for the bug fix of the submodule
env as well.

Signed-off-by: Stefan Beller <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agosubmodule: avoid auto-discovery in new working tree manipulator code
Stefan Beller [Tue, 2 May 2017 19:32:13 +0000 (12:32 -0700)]
submodule: avoid auto-discovery in new working tree manipulator code

All commands that are run in a submodule, are run in a correct setup,
there is no need to prepare the environment without setting the GIT_DIR
variable. By setting the GIT_DIR variable we fix issues as discussed in
10f5c52656 (submodule: avoid auto-discovery in
prepare_submodule_repo_env(), 2016-09-01)

Signed-off-by: Stefan Beller <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agosubmodule_move_head: reuse child_process structure for futher commands
Stefan Beller [Tue, 2 May 2017 19:32:12 +0000 (12:32 -0700)]
submodule_move_head: reuse child_process structure for futher commands

We do not need to declare another struct child_process, but we can just
reuse the existing `cp` struct.

Signed-off-by: Stefan Beller <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agol10n: fr.po v2.13 round 1
Jean-Noel Avila [Sun, 23 Apr 2017 21:29:44 +0000 (23:29 +0200)]
l10n: fr.po v2.13 round 1

Signed-off-by: Jean-Noel Avila <redacted>
8 years agoclone: handle empty config values in -c
Jonathan Nieder [Tue, 2 May 2017 00:05:15 +0000 (17:05 -0700)]
clone: handle empty config values in -c

"git clone --config" uses the following incantation to add an item to
a config file, instead of replacing an existing value:

git_config_set_multivar_gently(key, value, "^$", 0)

As long as no existing value matches the regex ^$, that works as
intended and adds to the config.  When a value is empty, though, it
replaces the existing value.

Noticed while trying to set credential.helper during a clone to use a
specific helper without inheriting from ~/.gitconfig and
/etc/gitconfig.  That is, I ran

git clone -c credential.helper= \
-c credential.helper=myhelper \
https://example.com/repo

intending to produce the configuration

[credential]
helper =
helper = myhelper

Without this patch, the 'helper =' line is not included and the
credential helper from /etc/gitconfig gets used.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agocredential doc: make multiple-helper behavior more prominent
Jonathan Nieder [Tue, 2 May 2017 00:21:14 +0000 (17:21 -0700)]
credential doc: make multiple-helper behavior more prominent

Git's configuration system works by reading multiple configuration
files in order, from general to specific:

 - first, the system configuration /etc/gitconfig
 - then the user's configuration (~/.gitconfig or ~/.config/git/config)
 - then the repository configuration (.git/config)

For single-valued configuration items, the latest value wins.  For
multi-valued configuration items, values accumulate in that order.

For example, this allows setting a credential helper globally in
~/.gitconfig that git will try to use in all repositories, regardless
of whether they additionally provide another helper.  This is usually
a nice thing --- e.g. I can install helpers to use my OS keychain and
to cache credentials for a short period of time globally.

Sometimes people want to be able to override an inherited setting.
For the credential.helper setting, this is done by setting the
configuration item to empty before giving it a new value.  This is
already documented but the documentation is hard to find ---
git-config(1) says to look at gitcredentials(7) and the config
reference in gitcredentials(7) doesn't mention this issue.

Move the documentation to the config reference to make it easier to
find.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agofast-import: convert internal structs to struct object_id
brian m. carlson [Mon, 1 May 2017 02:29:03 +0000 (02:29 +0000)]
fast-import: convert internal structs to struct object_id

Convert struct tree_entry_ms, struct branch, struct tag, and struct
hash_list to use struct object_id by changing the definition and
applying the following semantic patch, plus the standard object_id
transforms:

@@
struct tree_entry_ms E1;
@@
- E1.sha1
+ E1.oid.hash

@@
struct tree_entry_ms *E1;
@@
- E1->sha1
+ E1->oid.hash

@@
struct branch E1;
@@
- E1.sha1
+ E1.oid.hash

@@
struct branch *E1;
@@
- E1->sha1
+ E1->oid.hash

@@
struct tag E1;
@@
- E1.sha1
+ E1.oid.hash

@@
struct tag *E1;
@@
- E1->sha1
+ E1->oid.hash

@@
struct hash_list E1;
@@
- E1.sha1
+ E1.oid.hash

@@
struct hash_list *E1;
@@
- E1->sha1
+ E1->oid.hash

Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agobuiltin/rev-parse: convert to struct object_id
brian m. carlson [Mon, 1 May 2017 02:29:02 +0000 (02:29 +0000)]
builtin/rev-parse: convert to struct object_id

Some of the functions converted are callers of lookup_commit_reference.
However, the changes involved in converting the entire thing are not too
large, so we might as well convert it all.

Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agobuiltin/blame: convert static function to struct object_id
brian m. carlson [Mon, 1 May 2017 02:29:01 +0000 (02:29 +0000)]
builtin/blame: convert static function to struct object_id

This function is a caller of lookup_commit_reference_gently, which we
will convert later.

Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agobranch: convert to struct object_id
brian m. carlson [Mon, 1 May 2017 02:29:00 +0000 (02:29 +0000)]
branch: convert to struct object_id

This change is required to convert lookup_commit_reference later.

Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agobundle: convert to struct object_id
brian m. carlson [Mon, 1 May 2017 02:28:59 +0000 (02:28 +0000)]
bundle: convert to struct object_id

Convert the bundle code, plus the sole external user of struct
ref_list_entry, to use struct object_id.  Include cache.h from within
bundle.h to provide the definition.  Convert some of the hash parsing
code to use parse_oid_hex to avoid needing to hard-code constant values.

Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agobuiltin/prune: convert to struct object_id
brian m. carlson [Mon, 1 May 2017 02:28:58 +0000 (02:28 +0000)]
builtin/prune: convert to struct object_id

Convert the sole instance of unsigned char [20] to struct object_id.
cmd_prune is a caller of parse_object, which we will convert later.

Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
8 years agobuiltin/name-rev: convert to struct object_id
brian m. carlson [Mon, 1 May 2017 02:28:57 +0000 (02:28 +0000)]
builtin/name-rev: convert to struct object_id

Convert all the uses of unsigned char [20] to struct object_id.  Also,
convert some hard-coded integers into constants.

name_rev_line accepts a wide variety of free-form input and only
interprets 40-character hex values, passing through everything else.
Consequently, it is not a good candidate for parse_oid_hex, which is
much stricter.

This change is a prerequisite for converting parse_object.

Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
git clone https://git.99rst.org/PROJECT