gitweb.git
t6046: testcases checking whether updates can be skippe... Elijah Newren Thu, 19 Apr 2018 17:58:19 +0000 (10:58 -0700)

t6046: testcases checking whether updates can be skipped in a merge

Add several tests checking whether updates can be skipped in a merge.
Also add several similar testcases for where updates cannot be skipped in
a merge to make sure that we skip if and only if we should.

In particular:

* Testcase 1a (particularly 1a-check-L) would have pointed out the
problem Linus has been dealing with for year with his merges[1].

* Testcase 2a (particularly 2a-check-L) would have pointed out the
problem with my directory-rename-series before it broke master[2].

* Testcases 3[ab] (particularly 3a-check-L) provide a simpler testcase
than 12b of t6043 making that one easier to understand.

* There are several complementary testcases to make sure we're not just
fixing those particular issues while regressing in the opposite
direction.

* There are also a pair of tests for the special case when a merge
results in a skippable update AND the user has dirty modifications to
the path.

[1] https://public-inbox.org/git/CA+55aFzLZ3UkG5svqZwSnhNk75=fXJRkvU1m_RHBG54NOoaZPA@mail.gmail.com/
[2] https://public-inbox.org/git/xmqqmuya43cs.fsf@gitster-ct.c.googlers.com/

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: avoid triggering add_cacheinfo error... Elijah Newren Thu, 19 Apr 2018 17:58:18 +0000 (10:58 -0700)

merge-recursive: avoid triggering add_cacheinfo error with dirty mod

If a cherry-pick or merge with a rename results in a skippable update
(due to the merged content matching what HEAD already had), but the
working directory is dirty, avoid trying to refresh the index as that
will fail.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: move more is_dirty handling to merge_c... Elijah Newren Thu, 19 Apr 2018 17:58:17 +0000 (10:58 -0700)

merge-recursive: move more is_dirty handling to merge_content

conflict_rename_normal() was doing some handling for dirty files that
more naturally belonged in merge_content. Move it, and rename a
parameter for clarity while at it.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: improve add_cacheinfo error handlingElijah Newren Thu, 19 Apr 2018 17:58:16 +0000 (10:58 -0700)

merge-recursive: improve add_cacheinfo error handling

Four closely related changes all with the purpose of fixing error handling
in this function:
- fix reported function name in add_cacheinfo error messages
- differentiate between the two error messages
- abort early when we hit the error (stop ignoring return code)
- mark a test which was hitting this error as failing until we get the
right fix

In more detail...

In commit 0424138d5715 ("Fix bogus error message from merge-recursive
error path", 2007-04-01), it was noted that the name of the function which
the error message claimed it was reported from did not match the actual
function name. This was changed to something closer to the real function
name, but it still didn't match the actual function name. Fix the
reported name to match.

Second, the two errors in this function had identical messages, preventing
us from knowing which error had been triggered. Add a couple words to the
second error message to differentiate the two.

Next, make sure callers do not ignore the return code so that it will stop
processing further entries (processing further entries could result in
more output which could cause the error to scroll off the screen, or at
least be missed by the user) and make it clear the error is the cause of
the early abort. These errors should never be triggered in production; if
either one is, it represents a bug in the calling path somewhere and is
likely to have resulted in mis-merged content. The combination of
ignoring of the return code and continuing to print other standard
messages after hitting the error resulted in the following bug report from
Junio: "...the command pretends that everything went well and merged
cleanly in that path...[Behaving] in a buggy and unexplainable way is bad
enough, doing so silently is unexcusable." Fix this.

Finally, there was one test in the testsuite that did hit this error path,
but was passing anyway. This would have been easy to miss since it had a
test_must_fail and thus could have failed for the wrong reason, but in a
separate testing step I added an intentional NULL-dereference to the
codepath where these error messages are printed in order to flush out such
cases. I could modify that test to explicitly check for this error and
fail the test if it is hit, but since this test operates in a bit of a
gray area and needed other changes, I went for a different fix. The gray
area this test operates in is the following: If the merge of a certain
file results in the same version of the file that existed in HEAD, but
there are dirty modifications to the file, is that an error with a
"Refusing to overwrite existing file" expected, or a case where the merge
should succeed since we shouldn't have to touch the dirty file anyway?
Recent discussion on the list leaned towards saying it should be a
success. Therefore, change the expected behavior of this test to match.
As a side effect, this makes the failed-due-to-hitting-add_cacheinfo-error
very clear, and we can mark the test as test_expect_failure. A subsequent
commit will implement the necessary changes to get this test to pass
again.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: avoid spurious rename/rename conflict... Elijah Newren Thu, 19 Apr 2018 17:58:15 +0000 (10:58 -0700)

merge-recursive: avoid spurious rename/rename conflict from dir renames

If a file on one side of history was renamed, and merely modified on the
other side, then applying a directory rename to the modified side gives us
a rename/rename(1to2) conflict. We should only apply directory renames to
pairs representing either adds or renames.

Making this change means that a directory rename testcase that was
previously reported as a rename/delete conflict will now be reported as a
modify/delete conflict.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: new testcases showcasing... Elijah Newren Thu, 19 Apr 2018 17:58:14 +0000 (10:58 -0700)

directory rename detection: new testcases showcasing a pair of bugs

Add a testcase showing spurious rename/rename(1to2) conflicts occurring
due to directory rename detection.

Also add a pair of testcases dealing with moving directory hierarchies
around that were suggested by Stefan Beller as "food for thought" during
his review of an earlier patch series, but which actually uncovered a
bug. Round things out with a test that is a cross between the two
testcases that showed existing bugs in order to make sure we aren't
merely addressing problems in isolation but in general.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: fix remaining directory rename + dirty... Elijah Newren Thu, 19 Apr 2018 17:58:13 +0000 (10:58 -0700)

merge-recursive: fix remaining directory rename + dirty overwrite cases

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: fix overwriting dirty files involved... Elijah Newren Thu, 19 Apr 2018 17:58:12 +0000 (10:58 -0700)

merge-recursive: fix overwriting dirty files involved in renames

This fixes an issue that existed before my directory rename detection
patches that affects both normal renames and renames implied by
directory rename detection. Additional codepaths that only affect
overwriting of dirty files that are involved in directory rename
detection will be added in a subsequent commit.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: avoid clobbering untracked files with... Elijah Newren Thu, 19 Apr 2018 17:58:11 +0000 (10:58 -0700)

merge-recursive: avoid clobbering untracked files with directory renames

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: apply necessary modifications for... Elijah Newren Thu, 19 Apr 2018 17:58:10 +0000 (10:58 -0700)

merge-recursive: apply necessary modifications for directory renames

This commit hooks together all the directory rename logic by making the
necessary changes to the rename struct, it's dst_entry, and the
diff_filepair under consideration.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: when comparing files, don't include... Elijah Newren Thu, 19 Apr 2018 17:58:09 +0000 (10:58 -0700)

merge-recursive: when comparing files, don't include trees

get_renames() would look up stage data that already existed (populated
in get_unmerged(), taken from whatever unpack_trees() created), and if
it didn't exist, would call insert_stage_data() to create the necessary
entry for the given file. The insert_stage_data() fallback becomes
much more important for directory rename detection, because that creates
a mechanism to have a file in the resulting merge that didn't exist on
either side of history. However, insert_stage_data(), due to calling
get_tree_entry() loaded up trees as readily as files. We aren't
interested in comparing trees to files; the D/F conflict handling is
done elsewhere. This code is just concerned with what entries existed
for a given path on the different sides of the merge, so create a
get_tree_entry_if_blob() helper function and use it.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: check for file level conflicts then... Elijah Newren Thu, 19 Apr 2018 17:58:08 +0000 (10:58 -0700)

merge-recursive: check for file level conflicts then get new name

Before trying to apply directory renames to paths within the given
directories, we want to make sure that there aren't conflicts at the
file level either. If there aren't any, then get the new name from
any directory renames.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: add computation of collisions due... Elijah Newren Thu, 19 Apr 2018 17:58:07 +0000 (10:58 -0700)

merge-recursive: add computation of collisions due to dir rename & merging

directory renaming and merging can cause one or more files to be moved to
where an existing file is, or to cause several files to all be moved to
the same (otherwise vacant) location. Add checking and reporting for such
cases, falling back to no-directory-rename handling for such paths.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: check for directory level conflictsElijah Newren Thu, 19 Apr 2018 17:58:06 +0000 (10:58 -0700)

merge-recursive: check for directory level conflicts

Before trying to apply directory renames to paths within the given
directories, we want to make sure that there aren't conflicts at the
directory level. There will be additional checks at the individual
file level too, which will be added later.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: add get_directory_renames()Elijah Newren Thu, 19 Apr 2018 17:58:05 +0000 (10:58 -0700)

merge-recursive: add get_directory_renames()

This populates a set of directory renames for us. The set of directory
renames is not yet used, but will be in subsequent commits.

Note that the use of a string_list for possible_new_dirs in the new
dir_rename_entry struct implies an O(n^2) algorithm; however, in practice
I expect the number of distinct directories that files were renamed into
from a single original directory to be O(1). My guess is that n has a
mode of 1 and a mean of less than 2, so, for now, string_list seems good
enough for possible_new_dirs.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: make a helper function for cleanup... Elijah Newren Thu, 19 Apr 2018 17:58:04 +0000 (10:58 -0700)

merge-recursive: make a helper function for cleanup for handle_renames

In anticipation of more involved cleanup to come, make a helper function
for doing the cleanup at the end of handle_renames. Rename the already
existing cleanup_rename[s]() to final_cleanup_rename[s](), name the new
helper initial_cleanup_rename(), and leave the big comment in the code
about why we can't do all the cleanup at once.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: split out code for determining diff_fi... Elijah Newren Thu, 19 Apr 2018 17:58:03 +0000 (10:58 -0700)

merge-recursive: split out code for determining diff_filepairs

Create a new function, get_diffpairs() to compute the diff_filepairs
between two trees. While these are currently only used in
get_renames(), I want them to be available to some new functions. No
actual logic changes yet.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: make !o->detect_rename codepath more... Elijah Newren Thu, 19 Apr 2018 17:58:02 +0000 (10:58 -0700)

merge-recursive: make !o->detect_rename codepath more obvious

Previously, if !o->detect_rename then get_renames() would return an
empty string_list, and then process_renames() would have nothing to
iterate over. It seems more straightforward to simply avoid calling
either function in that case.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: fix leaks of allocated renames and... Elijah Newren Thu, 19 Apr 2018 17:58:01 +0000 (10:58 -0700)

merge-recursive: fix leaks of allocated renames and diff_filepairs

get_renames() has always zero'ed out diff_queued_diff.nr while only
manually free'ing diff_filepairs that did not correspond to renames.
Further, it allocated struct renames that were tucked away in the
return string_list. Make sure all of these are deallocated when we
are done with them.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: introduce new functions to handle... Elijah Newren Thu, 19 Apr 2018 17:58:00 +0000 (10:58 -0700)

merge-recursive: introduce new functions to handle rename logic

The amount of logic in merge_trees() relative to renames was just a few
lines, but split it out into new handle_renames() and cleanup_renames()
functions to prepare for additional logic to be added to each. No code or
logic changes, just a new place to put stuff for when the rename detection
gains additional checks.

Note that process_renames() records pointers to various information (such
as diff_filepairs) into rename_conflict_info structs. Even though the
rename string_lists are not directly used once handle_renames() completes,
we should not immediately free the lists at the end of that function
because they store the information referenced in the rename_conflict_info,
which is used later in process_entry(). Thus the reason for a separate
cleanup_renames().

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-recursive: move the get_renames() functionElijah Newren Thu, 19 Apr 2018 17:57:59 +0000 (10:57 -0700)

merge-recursive: move the get_renames() function

Move this function so it can re-use some others (without either
moving all of them or adding an annoying split between function
declarations and definitions). Cheat slightly by adding a blank line
for readability, and in order to silence checkpatch.pl.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: tests for handling overwrit... Elijah Newren Thu, 19 Apr 2018 17:57:58 +0000 (10:57 -0700)

directory rename detection: tests for handling overwriting dirty files

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: tests for handling overwrit... Elijah Newren Thu, 19 Apr 2018 17:57:57 +0000 (10:57 -0700)

directory rename detection: tests for handling overwriting untracked files

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: miscellaneous testcases... Elijah Newren Thu, 19 Apr 2018 17:57:56 +0000 (10:57 -0700)

directory rename detection: miscellaneous testcases to complete coverage

I came up with the testcases in the first eight sections before coding up
the implementation. The testcases in this section were mostly ones I
thought of while coding/debugging, and which I was too lazy to insert
into the previous sections because I didn't want to re-label with all the
testcase references. :-)

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: testcases exploring possibl... Elijah Newren Thu, 19 Apr 2018 17:57:55 +0000 (10:57 -0700)

directory rename detection: testcases exploring possibly suboptimal merges

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: more involved edge/corner... Elijah Newren Thu, 19 Apr 2018 17:57:54 +0000 (10:57 -0700)

directory rename detection: more involved edge/corner testcases

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: testcases checking which... Elijah Newren Thu, 19 Apr 2018 17:57:53 +0000 (10:57 -0700)

directory rename detection: testcases checking which side did the rename

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: files/directories in the... Elijah Newren Thu, 19 Apr 2018 17:57:52 +0000 (10:57 -0700)

directory rename detection: files/directories in the way of some renames

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: partially renamed directory... Elijah Newren Thu, 19 Apr 2018 17:57:51 +0000 (10:57 -0700)

directory rename detection: partially renamed directory testcase/discussion

Add a long note about why we are not considering "partial directory
renames" for the current directory rename detection implementation.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: testcases to avoid taking... Elijah Newren Thu, 19 Apr 2018 17:57:50 +0000 (10:57 -0700)

directory rename detection: testcases to avoid taking detection too far

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: directory splitting testcasesElijah Newren Thu, 19 Apr 2018 17:57:49 +0000 (10:57 -0700)

directory rename detection: directory splitting testcases

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

directory rename detection: basic testcasesElijah Newren Thu, 19 Apr 2018 17:57:48 +0000 (10:57 -0700)

directory rename detection: basic testcases

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'svn/authors-prog-2' of git://bogomips... Junio C Hamano Wed, 11 Apr 2018 23:05:28 +0000 (08:05 +0900)

Merge branch 'svn/authors-prog-2' of git://bogomips.org/git-svn

* 'svn/authors-prog-2' of git://bogomips.org/git-svn:
git-svn: allow empty email-address using authors-prog and authors-file
git-svn: search --authors-prog in PATH too

Revert "Merge branch 'en/rename-directory-detection'"Junio C Hamano Wed, 11 Apr 2018 09:07:11 +0000 (18:07 +0900)

Revert "Merge branch 'en/rename-directory-detection'"

This reverts commit e4bb62fa1eeee689744b413e29a50b4d1dae6886, reversing
changes made to 468165c1d8a442994a825f3684528361727cd8c0.

The topic appears to inflict severe regression in renaming merges,
even though the promise of it was that it would improve them.

We do not yet know which exact change in the topic was wrong, but in
the meantime, let's play it safe and revert it out of 'master'
before real Git-using projects are harmed.

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

The third batch for 2.18Junio C Hamano Wed, 11 Apr 2018 04:13:49 +0000 (13:13 +0900)

The third batch for 2.18

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

Merge branch 'eb/cred-helper-ignore-sigpipe'Junio C Hamano Wed, 11 Apr 2018 04:09:57 +0000 (13:09 +0900)

Merge branch 'eb/cred-helper-ignore-sigpipe'

When credential helper exits very quickly without reading its
input, it used to cause Git to die with SIGPIPE, which has been
fixed.

* eb/cred-helper-ignore-sigpipe:
credential: ignore SIGPIPE when writing to credential helpers

Merge branch 'lv/tls-1.3'Junio C Hamano Wed, 11 Apr 2018 04:09:57 +0000 (13:09 +0900)

Merge branch 'lv/tls-1.3'

When built with more recent cURL, GIT_SSL_VERSION can now specify
"tlsv1.3" as its value.

* lv/tls-1.3:
http: allow use of TLS 1.3

Merge branch 'pk/test-avoid-pipe-hiding-exit-status'Junio C Hamano Wed, 11 Apr 2018 04:09:56 +0000 (13:09 +0900)

Merge branch 'pk/test-avoid-pipe-hiding-exit-status'

Test cleanup.

* pk/test-avoid-pipe-hiding-exit-status:
test: avoid pipes in git related commands for test

Merge branch 'rs/status-with-removed-submodule'Junio C Hamano Wed, 11 Apr 2018 04:09:56 +0000 (13:09 +0900)

Merge branch 'rs/status-with-removed-submodule'

"git submodule status" misbehaved on a submodule that has been
removed from the working tree.

* rs/status-with-removed-submodule:
submodule: check for NULL return of get_submodule_ref_store()

Merge branch 'nd/combined-test-helper'Junio C Hamano Wed, 11 Apr 2018 04:09:56 +0000 (13:09 +0900)

Merge branch 'nd/combined-test-helper'

Small test-helper programs have been consolidated into a single
binary.

* nd/combined-test-helper: (36 commits)
t/helper: merge test-write-cache into test-tool
t/helper: merge test-wildmatch into test-tool
t/helper: merge test-urlmatch-normalization into test-tool
t/helper: merge test-subprocess into test-tool
t/helper: merge test-submodule-config into test-tool
t/helper: merge test-string-list into test-tool
t/helper: merge test-strcmp-offset into test-tool
t/helper: merge test-sigchain into test-tool
t/helper: merge test-sha1-array into test-tool
t/helper: merge test-scrap-cache-tree into test-tool
t/helper: merge test-run-command into test-tool
t/helper: merge test-revision-walking into test-tool
t/helper: merge test-regex into test-tool
t/helper: merge test-ref-store into test-tool
t/helper: merge test-read-cache into test-tool
t/helper: merge test-prio-queue into test-tool
t/helper: merge test-path-utils into test-tool
t/helper: merge test-online-cpus into test-tool
t/helper: merge test-mktemp into test-tool
t/helper: merge (unused) test-mergesort into test-tool
...

Merge branch 'sb/packfiles-in-repository'Junio C Hamano Wed, 11 Apr 2018 04:09:55 +0000 (13:09 +0900)

Merge branch 'sb/packfiles-in-repository'

Refactoring of the internal global data structure continues.

* sb/packfiles-in-repository:
packfile: keep prepare_packed_git() private
packfile: allow find_pack_entry to handle arbitrary repositories
packfile: add repository argument to find_pack_entry
packfile: allow reprepare_packed_git to handle arbitrary repositories
packfile: allow prepare_packed_git to handle arbitrary repositories
packfile: allow prepare_packed_git_one to handle arbitrary repositories
packfile: add repository argument to reprepare_packed_git
packfile: add repository argument to prepare_packed_git
packfile: add repository argument to prepare_packed_git_one
packfile: allow install_packed_git to handle arbitrary repositories
packfile: allow rearrange_packed_git to handle arbitrary repositories
packfile: allow prepare_packed_git_mru to handle arbitrary repositories

Merge branch 'sb/object-store'Junio C Hamano Wed, 11 Apr 2018 04:09:55 +0000 (13:09 +0900)

Merge branch 'sb/object-store'

Refactoring the internal global data structure to make it possible
to open multiple repositories, work with and then close them.

Rerolled by Duy on top of a separate preliminary clean-up topic.
The resulting structure of the topics looked very sensible.

* sb/object-store: (27 commits)
sha1_file: allow sha1_loose_object_info to handle arbitrary repositories
sha1_file: allow map_sha1_file to handle arbitrary repositories
sha1_file: allow map_sha1_file_1 to handle arbitrary repositories
sha1_file: allow open_sha1_file to handle arbitrary repositories
sha1_file: allow stat_sha1_file to handle arbitrary repositories
sha1_file: allow sha1_file_name to handle arbitrary repositories
sha1_file: add repository argument to sha1_loose_object_info
sha1_file: add repository argument to map_sha1_file
sha1_file: add repository argument to map_sha1_file_1
sha1_file: add repository argument to open_sha1_file
sha1_file: add repository argument to stat_sha1_file
sha1_file: add repository argument to sha1_file_name
sha1_file: allow prepare_alt_odb to handle arbitrary repositories
sha1_file: allow link_alt_odb_entries to handle arbitrary repositories
sha1_file: add repository argument to prepare_alt_odb
sha1_file: add repository argument to link_alt_odb_entries
sha1_file: add repository argument to read_info_alternates
sha1_file: add repository argument to link_alt_odb_entry
sha1_file: add raw_object_store argument to alt_odb_usable
pack: move approximate object count to object store
...

Merge branch 'jc/test-must-be-empty'Junio C Hamano Wed, 11 Apr 2018 04:09:54 +0000 (13:09 +0900)

Merge branch 'jc/test-must-be-empty'

Test helper update.

* jc/test-must-be-empty:
test_must_be_empty: simplify file existence check

Merge branch 'cc/perf-aggregate-sort'Junio C Hamano Wed, 11 Apr 2018 04:09:54 +0000 (13:09 +0900)

Merge branch 'cc/perf-aggregate-sort'

Perf-test update.

* cc/perf-aggregate-sort:
perf/aggregate: add --sort-by=regression option
perf/aggregate: add display_dir()

Merge branch 'ab/doc-hash-brokenness'Junio C Hamano Wed, 11 Apr 2018 04:09:54 +0000 (13:09 +0900)

Merge branch 'ab/doc-hash-brokenness'

Doc updates.

* ab/doc-hash-brokenness:
doc hash-function-transition: clarify what SHAttered means
doc hash-function-transition: clarify how older gits die on NewHash

Merge branch 'bc/hash-independent-tests'Junio C Hamano Wed, 11 Apr 2018 04:09:54 +0000 (13:09 +0900)

Merge branch 'bc/hash-independent-tests'

Tests that rely on the exact hardcoded values of object names have
been updated in preparation for hash function migration.

* bc/hash-independent-tests:
t2107: abstract away SHA-1-specific constants
t2101: abstract away SHA-1-specific constants
t2101: modernize test style
t2020: abstract away SHA-1 specific constants
t1507: abstract away SHA-1-specific constants
t1411: abstract away SHA-1-specific constants
t1405: sort reflog entries in a hash-independent way
t1300: abstract away SHA-1-specific constants
t1304: abstract away SHA-1-specific constants
t1011: abstract away SHA-1-specific constants

Merge branch 'ab/drop-contrib-examples'Junio C Hamano Wed, 11 Apr 2018 04:09:54 +0000 (13:09 +0900)

Merge branch 'ab/drop-contrib-examples'

* ab/drop-contrib-examples:
Remove contrib/examples/*

The second batch for 2.18Junio C Hamano Tue, 10 Apr 2018 07:32:45 +0000 (16:32 +0900)

The second batch for 2.18

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

Merge branch 'ys/bisect-object-id-missing-conversion... Junio C Hamano Tue, 10 Apr 2018 07:28:24 +0000 (16:28 +0900)

Merge branch 'ys/bisect-object-id-missing-conversion-fix'

Code clean-up.

* ys/bisect-object-id-missing-conversion-fix:
bisect: use oid_to_hex() for converting object_id hashes to hex strings

Merge branch 'yk/filter-branch-non-committish-refs'Junio C Hamano Tue, 10 Apr 2018 07:28:23 +0000 (16:28 +0900)

Merge branch 'yk/filter-branch-non-committish-refs'

when refs that do not point at committish are given, "git
filter-branch" gave a misleading error messages. This has been
corrected.

* yk/filter-branch-non-committish-refs:
filter-branch: fix errors caused by refs that point at non-committish

Merge branch 'nd/trace-with-env'Junio C Hamano Tue, 10 Apr 2018 07:28:22 +0000 (16:28 +0900)

Merge branch 'nd/trace-with-env'

Code cleanup.

* nd/trace-with-env:
run-command: use strbuf_addstr() for adding a string to a strbuf

Merge branch 'nd/parseopt-completion-more'Junio C Hamano Tue, 10 Apr 2018 07:28:22 +0000 (16:28 +0900)

Merge branch 'nd/parseopt-completion-more'

The mechanism to use parse-options API to automate the command line
completion continues to get extended and polished.

* nd/parseopt-completion-more:
completion: use __gitcomp_builtin in _git_cherry
completion: use __gitcomp_builtin in _git_ls_tree
completion: delete option-only completion commands
completion: add --option completion for most builtin commands
completion: factor out _git_xxx calling code
completion: mention the oldest version we need to support
git.c: add hidden option --list-parseopt-builtins
git.c: move cmd_struct declaration up

Merge branch 'ds/bsearch-hash'Junio C Hamano Tue, 10 Apr 2018 07:28:22 +0000 (16:28 +0900)

Merge branch 'ds/bsearch-hash'

Code to find the length to uniquely abbreviate object names based
on packfile content, which is a relatively recent addtion, has been
optimized to use the same fan-out table.

* ds/bsearch-hash:
sha1_name: use bsearch_pack() in unique_in_pack()
sha1_name: use bsearch_pack() for abbreviations
packfile: define and use bsearch_pack()
sha1_name: convert struct min_abbrev_data to object_id

Merge branch 'ws/rebase-p'Junio C Hamano Tue, 10 Apr 2018 07:28:21 +0000 (16:28 +0900)

Merge branch 'ws/rebase-p'

Code clean-up.

* ws/rebase-p:
rebase: remove merges_option and a blank line
rebase: remove unused code paths from git_rebase__interactive__preserve_merges
rebase: remove unused code paths from git_rebase__interactive
rebase: add and use git_rebase__interactive__preserve_merges
rebase: extract functions out of git_rebase__interactive
rebase: reindent function git_rebase__interactive
rebase: update invocation of rebase dot-sourced scripts
rebase-interactive: simplify pick_on_preserving_merges

Merge branch 'jk/diff-highlight-graph-fix'Junio C Hamano Tue, 10 Apr 2018 07:28:21 +0000 (16:28 +0900)

Merge branch 'jk/diff-highlight-graph-fix'

"diff-highlight" filter (in contrib/) learned to undertand "git log
--graph" output better.

* jk/diff-highlight-graph-fix:
diff-highlight: detect --graph by indent
diff-highlight: use flush() helper consistently
diff-highlight: test graphs with --color
diff-highlight: test interleaved parallel lines of history
diff-highlight: prefer "echo" to "cat" in tests
diff-highlight: use test_tick in graph test
diff-highlight: correct test graph diagram

Merge branch 'nd/remove-ignore-env-field'Junio C Hamano Tue, 10 Apr 2018 07:28:20 +0000 (16:28 +0900)

Merge branch 'nd/remove-ignore-env-field'

Code clean-up for the "repository" abstraction.

* nd/remove-ignore-env-field:
repository.h: add comment and clarify repo_set_gitdir
repository: delete ignore_env member
sha1_file.c: move delayed getenv(altdb) back to setup_git_env()
repository.c: delete dead functions
repository.c: move env-related setup code back to environment.c
repository: initialize the_repository in main()

Merge branch 'ps/contains-id-error-message'Junio C Hamano Tue, 10 Apr 2018 07:28:20 +0000 (16:28 +0900)

Merge branch 'ps/contains-id-error-message'

"git tag --contains no-such-commit" gave a full list of options
after giving an error message.

* ps/contains-id-error-message:
parse-options: do not show usage upon invalid option value

The first batch for 2.18 cycleJunio C Hamano Mon, 9 Apr 2018 23:31:10 +0000 (08:31 +0900)

The first batch for 2.18 cycle

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

Merge branch 'tg/stash-untracked-with-pathspec-fix'Junio C Hamano Mon, 9 Apr 2018 23:25:45 +0000 (08:25 +0900)

Merge branch 'tg/stash-untracked-with-pathspec-fix'

"git stash push -u -- <pathspec>" gave an unnecessary and confusing
error message when there was no tracked files that match the
<pathspec>, which has been fixed.

* tg/stash-untracked-with-pathspec-fix:
stash: drop superfluos pathspec parameter
stash push -u: don't create empty stash
stash push: avoid printing errors
stash: fix nonsense pipeline

Merge branch 'nd/worktree-prune'Junio C Hamano Mon, 9 Apr 2018 23:25:45 +0000 (08:25 +0900)

Merge branch 'nd/worktree-prune'

The way "git worktree prune" worked internally has been simplified,
by assuming how "git worktree move" moves an existing worktree to a
different place.

* nd/worktree-prune:
worktree prune: improve prune logic when worktree is moved
worktree: delete dead code
gc.txt: more details about what gc does

Merge branch 'bc/object-id'Junio C Hamano Mon, 9 Apr 2018 23:25:45 +0000 (08:25 +0900)

Merge branch 'bc/object-id'

Conversion from uchar[20] to struct object_id continues.

* bc/object-id: (36 commits)
convert: convert to struct object_id
sha1_file: introduce a constant for max header length
Convert lookup_replace_object to struct object_id
sha1_file: convert read_sha1_file to struct object_id
sha1_file: convert read_object_with_reference to object_id
tree-walk: convert tree entry functions to object_id
streaming: convert istream internals to struct object_id
tree-walk: convert get_tree_entry_follow_symlinks internals to object_id
builtin/notes: convert static functions to object_id
builtin/fmt-merge-msg: convert remaining code to object_id
sha1_file: convert sha1_object_info* to object_id
Convert remaining callers of sha1_object_info_extended to object_id
packfile: convert unpack_entry to struct object_id
sha1_file: convert retry_bad_packed_offset to struct object_id
sha1_file: convert assert_sha1_type to object_id
builtin/mktree: convert to struct object_id
streaming: convert open_istream to use struct object_id
sha1_file: convert check_sha1_signature to struct object_id
sha1_file: convert read_loose_object to use struct object_id
builtin/index-pack: convert struct ref_delta_entry to object_id
...

Merge branch 'ma/shortlog-revparse'Junio C Hamano Mon, 9 Apr 2018 23:25:44 +0000 (08:25 +0900)

Merge branch 'ma/shortlog-revparse'

"git shortlog cruft" aborted with a BUG message when run outside a
Git repository. The command has been taught to complain about
extra and unwanted arguments on its command line instead in such a
case.

* ma/shortlog-revparse:
shortlog: disallow left-over arguments outside repo
shortlog: add usage-string for stdin-reading
git-shortlog.txt: reorder usages

Merge branch 'ab/install-symlinks'Junio C Hamano Mon, 9 Apr 2018 23:25:44 +0000 (08:25 +0900)

Merge branch 'ab/install-symlinks'

The build procedure learned to optionally use symbolic links
(instead of hardlinks and copies) to install "git-foo" for built-in
commands, whose binaries are all identical.

* ab/install-symlinks:
Makefile: optionally symlink libexec/git-core binaries to bin/git
Makefile: add a gitexecdir_relative variable
Makefile: fix broken bindir_relative variable

Merge branch 'ml/filter-branch-no-op-error'Junio C Hamano Mon, 9 Apr 2018 23:25:44 +0000 (08:25 +0900)

Merge branch 'ml/filter-branch-no-op-error'

"git filter-branch" learned to use a different exit code to allow
the callers to tell the case where there was no new commits to
rewrite from other error cases.

* ml/filter-branch-no-op-error:
filter-branch: return 2 when nothing to rewrite

Merge branch 'ab/pcre-v2'Junio C Hamano Mon, 9 Apr 2018 23:25:43 +0000 (08:25 +0900)

Merge branch 'ab/pcre-v2'

Git can be built to use either v1 or v2 of the PCRE library, and so
far, the build-time configuration USE_LIBPCRE=YesPlease instructed
the build procedure to use v1, but now it means v2. USE_LIBPCRE1
and USE_LIBPCRE2 can be used to explicitly choose which version to
use, as before.

* ab/pcre-v2:
Makefile: make USE_LIBPCRE=YesPlease mean v2, not v1
configure: detect redundant --with-libpcre & --with-libpcre1
configure: fix a regression in PCRE v1 detection

Merge branch 'ti/fetch-everything-local-optim'Junio C Hamano Mon, 9 Apr 2018 23:25:43 +0000 (08:25 +0900)

Merge branch 'ti/fetch-everything-local-optim'

A "git fetch" from a repository with insane number of refs into a
repository that is already up-to-date still wasted too many cycles
making many lstat(2) calls to see if these objects at the tips
exist as loose objects locally. These lstat(2) calls are optimized
away by enumerating all loose objects beforehand.

It is unknown if the new strategy negatively affects existing use
cases, fetching into a repository with many loose objects from a
repository with small number of refs.

* ti/fetch-everything-local-optim:
fetch-pack.c: use oidset to check existence of loose object

Merge branch 'en/rename-directory-detection'Junio C Hamano Mon, 9 Apr 2018 23:25:43 +0000 (08:25 +0900)

Merge branch 'en/rename-directory-detection'

Rename detection logic in "diff" family that is used in "merge" has
learned to guess when all of x/a, x/b and x/c have moved to z/a,
z/b and z/c, it is likely that x/d added in the meantime would also
want to move to z/d by taking the hint that the entire directory
'x' moved to 'z'. A bug causing dirty files involved in a rename
to be overwritten during merge has also been fixed as part of this
work.

* en/rename-directory-detection: (29 commits)
merge-recursive: ensure we write updates for directory-renamed file
merge-recursive: avoid spurious rename/rename conflict from dir renames
directory rename detection: new testcases showcasing a pair of bugs
merge-recursive: fix remaining directory rename + dirty overwrite cases
merge-recursive: fix overwriting dirty files involved in renames
merge-recursive: avoid clobbering untracked files with directory renames
merge-recursive: apply necessary modifications for directory renames
merge-recursive: when comparing files, don't include trees
merge-recursive: check for file level conflicts then get new name
merge-recursive: add computation of collisions due to dir rename & merging
merge-recursive: check for directory level conflicts
merge-recursive: add get_directory_renames()
merge-recursive: make a helper function for cleanup for handle_renames
merge-recursive: split out code for determining diff_filepairs
merge-recursive: make !o->detect_rename codepath more obvious
merge-recursive: fix leaks of allocated renames and diff_filepairs
merge-recursive: introduce new functions to handle rename logic
merge-recursive: move the get_renames() function
directory rename detection: tests for handling overwriting dirty files
directory rename detection: tests for handling overwriting untracked files
...

git-svn: allow empty email-address using authors-prog... Andreas Heiduk Sat, 24 Mar 2018 10:20:46 +0000 (11:20 +0100)

git-svn: allow empty email-address using authors-prog and authors-file

The email address in --authors-file and --authors-prog can be empty but
git-svn translated it into a fictional email address in the form

jondoe <jondoe@6aafaa21e0fb4338a68ab372a049893d>

containing the SVN repository UUID. Now git-svn behaves like git-commit:
If the email is *explicitly* set to the empty string using '<>', the
commit does not contain an email address, only the name:

jondoe <>

Allowing to remove the email address *intentionally* prevents automatic
systems from sending emails to those fictional addresses and avoids
cluttering the log output with unnecessary stuff.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Eric Wong <e@80x24.org>

git-svn: search --authors-prog in PATH tooAndreas Heiduk Sun, 4 Mar 2018 11:22:36 +0000 (12:22 +0100)

git-svn: search --authors-prog in PATH too

In 36db1eddf9 ("git-svn: add --authors-prog option", 2009-05-14) the path
to authors-prog was made absolute because git-svn changes the current
directory in some situations. This makes sense if the program is part of
the repository but prevents searching via $PATH.

The old behaviour is still retained, but if the file does not exists, then
authors-prog is searched for in $PATH as any other command.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Eric Wong <e@80x24.org>

Git 2.17 v2.17.0Junio C Hamano Mon, 2 Apr 2018 17:13:35 +0000 (10:13 -0700)

Git 2.17

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

Merge tag 'l10n-2.17.0-rnd1' of git://github.com/git... Junio C Hamano Mon, 2 Apr 2018 17:12:38 +0000 (10:12 -0700)

Merge tag 'l10n-2.17.0-rnd1' of git://github.com/git-l10n/git-po

l10n for Git 2.17.0 round 1

* tag 'l10n-2.17.0-rnd1' of git://github.com/git-l10n/git-po:
l10n: de.po: translate 132 new messages
l10n: zh_CN: review for git v2.17.0 l10n round 1
l10n: zh_CN: for git v2.17.0 l10n round 1
l10n: ko.po: Update Korean translation
l10n: fr.po: v2.17.0 no fuzzy
l10n: sv.po: Update Swedish translation (3376t0f0u)
l10n: Update Catalan translation
l10n: fr.po v2.17.0 round 1
l10n: vi.po(3376t): Updated Vietnamese translation for v2.17
l10n: bg.po: Updated Bulgarian translation (3376t)
l10n: es.po: Update Spanish translation 2.17.0
l10n: git.pot: v2.17.0 round 1 (132 new, 44 removed)
l10n: es.po: fixes to Spanish translation

Merge branch 'pw/add-p-single'Junio C Hamano Mon, 2 Apr 2018 17:10:54 +0000 (10:10 -0700)

Merge branch 'pw/add-p-single'

Hotfix.

* pw/add-p-single:
add -p: fix 2.17.0-rc* regression due to moved code

add -p: fix 2.17.0-rc* regression due to moved codeÆvar Arnfjörð Bjarmason Sat, 31 Mar 2018 12:50:58 +0000 (12:50 +0000)

add -p: fix 2.17.0-rc* regression due to moved code

Fix a regression in 88f6ffc1c2 ("add -p: only bind search key if
there's more than one hunk", 2018-02-13) which is present in
2.17.0-rc*, but not 2.16.0.

In Perl, regex variables like $1 always refer to the last regex
match. When the aforementioned change added a new regex match between
the old match and the corresponding code that was expecting $1, the $1
variable would always be undef, since the newly inserted regex match
doesn't have any captures.

As a result the "/" feature to search for a string in a hunk by regex
completely broke, on git.git:

$ perl -pi -e 's/Git/Tig/g' README.md
$ ./git --exec-path=$PWD add -p
[..]
Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? s
Split into 4 hunks.
[...]
Stage this hunk [y,n,q,a,d,j,J,g,/,s,e,?]? /Many
Use of uninitialized value $1 in string eq at /home/avar/g/git/git-add--interactive line 1568, <STDIN> line 1.
search for regex? Many

I.e. the initial "/regex" command wouldn't work, and would always emit
a warning and ask again for a regex, now it works as intended again.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: de.po: translate 132 new messagesRalf Thielow Fri, 16 Mar 2018 17:41:16 +0000 (18:41 +0100)

l10n: de.po: translate 132 new messages

Translate 132 new messages came from git.pot update in abc8de64d (l10n:
git.pot: v2.17.0 round 1 (132 new, 44 removed)).

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

Merge branch 'jh/partial-clone'Junio C Hamano Thu, 29 Mar 2018 22:39:59 +0000 (15:39 -0700)

Merge branch 'jh/partial-clone'

Hotfix.

* jh/partial-clone:
upload-pack: disable object filtering when disabled by config
unpack-trees: release oid_array after use in check_updates()

upload-pack: disable object filtering when disabled... Jonathan Nieder Wed, 28 Mar 2018 20:33:03 +0000 (13:33 -0700)

upload-pack: disable object filtering when disabled by config

When upload-pack gained partial clone support (v2.17.0-rc0~132^2~12,
2017-12-08), it was guarded by the uploadpack.allowFilter config item
to allow server operators to control when they start supporting it.

That config item didn't go far enough, though: it controls whether the
'filter' capability is advertised, but if a (custom) client ignores
the capability advertisement and passes a filter specification anyway,
the server would handle that despite allowFilter being false.

This is particularly significant if a security bug is discovered in
this new experimental partial clone code. Installations without
uploadpack.allowFilter ought not to be affected since they don't
intend to support partial clone, but they would be swept up into being
vulnerable.

Simplify and limit the attack surface by making uploadpack.allowFilter
disable the feature, not just the advertisement of it.

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

credential: ignore SIGPIPE when writing to credential... Erik E Brady Thu, 29 Mar 2018 18:00:56 +0000 (11:00 -0700)

credential: ignore SIGPIPE when writing to credential helpers

The credential subsystem can trigger SIGPIPE when writing to an
external helper if that helper closes its stdin before reading the
whole input. Normally this is rare, since helpers would need to read
that input to make a decision about how to respond, but:

1. It's reasonable to configure a helper which only handles "get"
while ignoring "store". Such a handler might not read stdin
for "store", thereby rapidly closing stdin upon helper exit.

2. A broken or misbehaving helper might exit immediately. That's an
error, but it's not reasonable for it to take down the parent Git
process with SIGPIPE.

Even with such a helper, seeing this problem should be rare. Getting
SIGPIPE requires the helper racily exiting before we've written the
fairly small credential output.

Signed-off-by: Erik E Brady <brady@cisco.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http: allow use of TLS 1.3Loganaden Velvindron Thu, 29 Mar 2018 10:14:18 +0000 (14:14 +0400)

http: allow use of TLS 1.3

Add a tlsv1.3 option to http.sslVersion in addition to the existing
tlsv1.[012] options. libcurl has supported this since 7.52.0.

This requires OpenSSL 1.1.1 with TLS 1.3 enabled or curl built with
recent versions of NSS or BoringSSL as the TLS backend.

Signed-off-by: Loganaden Velvindron <logan@hackers.mu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: zh_CN: review for git v2.17.0 l10n round 1Ray Chen Thu, 29 Mar 2018 07:09:20 +0000 (15:09 +0800)

l10n: zh_CN: review for git v2.17.0 l10n round 1

Signed-off-by: Ray Chen <oldsharp@gmail.com>

l10n: zh_CN: for git v2.17.0 l10n round 1Jiang Xin Thu, 22 Feb 2018 01:17:34 +0000 (09:17 +0800)

l10n: zh_CN: for git v2.17.0 l10n round 1

Translate 132 new messages (3376t0f0u) for git 2.17.0-rc0.

Reviewed-by: 依云 <lilydjwg@gmail.com>
Reviewed-by: Fangyi Zhou <fangyi.zhou@yuriko.moe>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

submodule: check for NULL return of get_submodule_ref_s... René Scharfe Wed, 28 Mar 2018 21:14:08 +0000 (23:14 +0200)

submodule: check for NULL return of get_submodule_ref_store()

If we can't find a ref store for a submodule then assume the latter
is not initialized (or was removed). Print a status line accordingly
instead of causing a segmentation fault by passing NULL as the first
parameter of refs_head_ref().

Reported-by: Jeremy Feusi <jeremy@feusi.co>
Reviewed-by: Stefan Beller <sbeller@google.com>
Initial-Test-By: Stefan Beller <sbeller@google.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.17-rc2 v2.17.0-rc2Junio C Hamano Wed, 28 Mar 2018 18:05:14 +0000 (11:05 -0700)

Git 2.17-rc2

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

Merge branch 'tg/stash-doc-typofix'Junio C Hamano Wed, 28 Mar 2018 18:04:25 +0000 (11:04 -0700)

Merge branch 'tg/stash-doc-typofix'

Hotfix.

* tg/stash-doc-typofix:
git-stash.txt: remove extra square bracket

Merge branch 'pc/submodule-helper'Junio C Hamano Wed, 28 Mar 2018 18:04:25 +0000 (11:04 -0700)

Merge branch 'pc/submodule-helper'

Hotfix.

* pc/submodule-helper:
submodule deinit: handle non existing pathspecs gracefully

Merge branch 'nd/parseopt-completion'Junio C Hamano Wed, 28 Mar 2018 18:04:24 +0000 (11:04 -0700)

Merge branch 'nd/parseopt-completion'

Hotfix for recently graduated topic that give help to completion
scripts from the Git subcommands that are being completed

* nd/parseopt-completion:
t9902: disable test on the list of merge-strategies under GETTEXT_POISON
completion: clear cached --options when sourcing the completion script

test: avoid pipes in git related commands for testPratik Karki Tue, 27 Mar 2018 17:31:37 +0000 (23:16 +0545)

test: avoid pipes in git related commands for test

Avoid using pipes downstream of Git commands since the exit codes
of commands upstream of pipes get swallowed, thus potentially
hiding failure of those commands. Instead, capture Git command
output to a file and apply the downstream command(s) to that file.

Signed-off-by: Pratik Karki <predatoramigo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: ko.po: Update Korean translationChangwoo Ryu Mon, 19 Mar 2018 04:59:50 +0000 (13:59 +0900)

l10n: ko.po: Update Korean translation

Signed-off-by: Changwoo Ryu <cwryu@debian.org>
Signed-off-by: Sihyeon Jang <uneedsihyeon@gmail.com>
Signed-off-by: Gwan-gyeong Mun <elongbug@gmail.com>
Reviewed-by: Changwoo Ryu <cwryu@debian.org>

submodule deinit: handle non existing pathspecs gracefullyStefan Beller Tue, 27 Mar 2018 23:28:24 +0000 (16:28 -0700)

submodule deinit: handle non existing pathspecs gracefully

This fixes a regression introduced in 2e612731b5 (submodule: port
submodule subcommand 'deinit' from shell to C, 2018-01-15), when
handling pathspecs that do not exist gracefully. This restores the
historic behavior of reporting the pathspec as unknown and returning
instead of reporting a bug.

Reported-by: Peter Oberndorfer <kumbayo84@arcor.de>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-stash.txt: remove extra square bracketThomas Gummerer Mon, 26 Mar 2018 21:11:47 +0000 (22:11 +0100)

git-stash.txt: remove extra square bracket

In 1ada5020b3 ("stash: use stash_push for no verb form", 2017-02-28),
when the pathspec argument was introduced in 'git stash', that was also
documented. However I forgot to remove an extra square bracket after
the '--message' argument, even though the square bracket should have
been after the pathspec argument (where it was also added).

Remove the extra square bracket after the '--message' argument, to show
that the pathspec argument should be used with the 'push' verb.

While the pathspec argument can be used without the push verb, that's a
special case described later in the man page, and removing the first extra
square bracket instead of the second one makes the synopis easier to
understand.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc hash-function-transition: clarify what SHAttered... Ævar Arnfjörð Bjarmason Mon, 26 Mar 2018 18:27:08 +0000 (18:27 +0000)

doc hash-function-transition: clarify what SHAttered means

Attempt to clarify what the SHAttered attack means in practice for
Git. The previous version of the text made no mention whatsoever of
Git already having a mitigation for this specific attack, which the
SHAttered researchers claim will detect cryptanalytic collision
attacks.

I may have gotten some of the nuances wrong, but as far as I know this
new text accurately summarizes the current situation with SHA-1 in
git. I.e. git doesn't really use SHA-1 anymore, it uses
Hardened-SHA-1 (they just so happen to produce the same outputs
99.99999999999...% of the time).

Thus the previous text was incorrect in asserting that:

[...]As a result [of SHAttered], SHA-1 cannot be considered
cryptographically secure any more[...]

That's not the case. We have a mitigation against SHAttered, *however*
we consider it prudent to move to work towards a NewHash should future
vulnerabilities in either SHA-1 or Hardened-SHA-1 emerge.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc hash-function-transition: clarify how older gits... Ævar Arnfjörð Bjarmason Mon, 26 Mar 2018 18:27:07 +0000 (18:27 +0000)

doc hash-function-transition: clarify how older gits die on NewHash

Change the "Repository format extension" to accurately describe what
happens with different versions of Git when they encounter NewHash
repositories, instead of only saying what happens with versions v2.7.0
and later.

See ab9cb76f66 ("Repository format version check.", 2005-11-25) and
00a09d57eb ("introduce "extensions" form of
core.repositoryformatversion", 2015-06-23) for the relevant changes to
the setup code where these variables are checked.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test_must_be_empty: simplify file existence checkSZEDER Gábor Mon, 26 Mar 2018 13:11:24 +0000 (15:11 +0200)

test_must_be_empty: simplify file existence check

Commit 11395a3b4b (test_must_be_empty: make sure the file exists, not
just empty, 2018-02-27) basically duplicated the 'test_path_is_file'
helper function in 'test_must_be_empty'.

Just call 'test_path_is_file' to avoid this code duplication.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

perf/aggregate: add --sort-by=regression optionChristian Couder Mon, 26 Mar 2018 07:24:31 +0000 (09:24 +0200)

perf/aggregate: add --sort-by=regression option

One of the most interesting thing one can be interested in when
looking at performance test results is possible performance
regressions.

This new option makes it easy to spot such possible regressions.

This new option is named '--sort-by=regression' to make it
possible and easy to add other ways to sort the results, like for
example '--sort-by=utime'.

If we would like to sort according to how much the stime regressed
we could also add a new option called '--sort-by=regression:stime'.
Then '--sort-by=regression' could become a synonym for
'--sort-by=regression:rtime'.

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

perf/aggregate: add display_dir()Christian Couder Mon, 26 Mar 2018 07:24:30 +0000 (09:24 +0200)

perf/aggregate: add display_dir()

This new helper function will be reused in a subsequent
commit.

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

t/helper: merge test-write-cache into test-toolNguyễn Thái Ngọc Duy Sat, 24 Mar 2018 07:45:05 +0000 (08:45 +0100)

t/helper: merge test-write-cache into test-tool

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

t/helper: merge test-wildmatch into test-toolNguyễn Thái Ngọc Duy Sat, 24 Mar 2018 07:45:04 +0000 (08:45 +0100)

t/helper: merge test-wildmatch into test-tool

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

t/helper: merge test-urlmatch-normalization into test... Nguyễn Thái Ngọc Duy Sat, 24 Mar 2018 07:45:03 +0000 (08:45 +0100)

t/helper: merge test-urlmatch-normalization into test-tool

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

t/helper: merge test-subprocess into test-toolNguyễn Thái Ngọc Duy Sat, 24 Mar 2018 07:45:02 +0000 (08:45 +0100)

t/helper: merge test-subprocess into test-tool

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

t/helper: merge test-submodule-config into test-toolNguyễn Thái Ngọc Duy Sat, 24 Mar 2018 07:45:01 +0000 (08:45 +0100)

t/helper: merge test-submodule-config into test-tool

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

t/helper: merge test-string-list into test-toolNguyễn Thái Ngọc Duy Sat, 24 Mar 2018 07:45:00 +0000 (08:45 +0100)

t/helper: merge test-string-list into test-tool

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