]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
4 years agomerge-recursive: remove useless parameter in merge_trees()
Elijah Newren [Sat, 17 Aug 2019 18:41:30 +0000 (11:41 -0700)] 
merge-recursive: remove useless parameter in merge_trees()

merge_trees() took a results parameter that would only be written when
opt->call_depth was positive, which is never the case now that
merge_trees_internal() has been split from merge_trees().  Remove the
misleading and unused parameter from merge_trees().

While at it, add some comments explaining how the output of
merge_trees() and merge_recursive() differ.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: exit early if index != head
Elijah Newren [Sat, 17 Aug 2019 18:41:29 +0000 (11:41 -0700)] 
merge-recursive: exit early if index != head

We had a rule to enforce that the index matches head, but it was found
at the beginning of merge_trees() and would only trigger when
opt->call_depth was 0.  Since merge_recursive() doesn't call
merge_trees() until after returning from recursing, this meant that the
check wasn't triggered by merge_recursive() until it had first finished
all the intermediate merges to create virtual merge bases.  That is a
potentially huge amount of computation (and writing of intermediate
merge results into the .git/objects directory) before it errors out and
says, in effect, "Sorry, I can't do any merging because you have some
local changes that would be overwritten."

Further, not enforcing this requirement earlier allowed other bugs (such
as an unintentional unconditional dropping and reloading of the index in
merge_recursive() even when no recursion was necessary), to mask bugs in
other callers (which were fixed in the commit prior to this one).

Make sure we do the index == head check at the beginning of the merge,
and error out immediately if it fails.  While we're at it, fix a small
leak in the show-the-error codepath.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoEnsure index matches head before invoking merge machinery, round N
Elijah Newren [Sat, 17 Aug 2019 18:41:28 +0000 (11:41 -0700)] 
Ensure index matches head before invoking merge machinery, round N

This is the bug that just won't die; there always seems to be another
form of it somewhere.  See the commit message of 55f39cf7551b ("merge:
fix misleading pre-merge check documentation", 2018-06-30) for a more
detailed explanation), but in short:

<quick summary>

builtin/merge.c contains this important requirement for merge
strategies:

    ...the index must be in sync with the head commit.  The strategies are
    responsible to ensure this.

This condition is important to enforce because there are two likely
failure cases when the index isn't in sync with the head commit:

  * we silently throw away changes the user had staged before the merge

  * we accidentally (and silently) include changes in the merge that
    were not part of either of the branches/trees being merged

Discarding users' work and mis-merging are both bad outcomes, especially
when done silently, so naturally this rule was stated sternly -- but,
unfortunately totally ignored in practice unless and until actual bugs
were found.  But, fear not: the bugs from this were fixed in commit
  ee6566e8d70d ("[PATCH] Rewrite read-tree", 2005-09-05)
through a rewrite of read-tree (again, commit 55f39cf7551b has a more
detailed explanation of how this affected merge).  And it was fixed
again in commit
  160252f81626 ("git-merge-ours: make sure our index matches HEAD", 2005-11-03)
...and it was fixed again in commit
  3ec62ad9ffba ("merge-octopus: abort if index does not match HEAD", 2016-04-09)
...and again in commit
  65170c07d466 ("merge-recursive: avoid incorporating uncommitted changes in a merge", 2017-12-21)
...and again in commit
  eddd1a411d93 ("merge-recursive: enforce rule that index matches head before merging", 2018-06-30)

...with multiple testcases added to the testsuite that could be
enumerated in even more commits.

Then, finally, in a patch in the same series as the last fix above, the
documentation about this requirement was fixed in commit 55f39cf7551b
("merge: fix misleading pre-merge check documentation", 2018-06-30), and
we all lived happily ever after...

</quick summary>

Unfortunately, "ever after" apparently denotes a limited time and it
expired today.  The merge-recursive rule to enforce that index matches
head was at the beginning of merge_trees() and would only trigger when
opt->call_depth was 0.  Since merge_recursive() doesn't call
merge_trees() until after returning from recursing, this meant that the
check wasn't triggered by merge_recursive() until it had first finished
all the intermediate merges to create virtual merge bases.  That is a
potentially HUGE amount of computation (and writing of intermediate
merge results into the .git/objects directory) before it errors out and
says, in effect, "Sorry, I can't do any merging because you have some
local changes that would be overwritten."

Trying to enforce that all of merge_trees(), merge_recursive(), and
merge_recursive_generic() checked the index == head condition earlier
resulted in a bunch of broken tests.  It turns out that
merge_recursive() has code to drop and reload the cache while recursing
to create intermediate virtual merge bases, but unfortunately that code
runs even when no recursion is necessary.  This unconditional dropping
and reloading of the cache masked a few bugs:

  * builtin/merge-recursive.c: didn't even bother loading the index.

  * builtin/stash.c: feels like a fake 'builtin' because it repeatedly
    invokes git subprocesses all over the place, mixed with other
    operations.  In particular, invoking "git reset" will reset the
    index on disk, but the parent process that invoked it won't
    automatically have its in-memory index updated.

  * t3030-merge-recursive.h: this test has always been broken in that it
    didn't make sure to make index match head before running.  But, it
    didn't care about the index or even the merge result, just the
    verbose output while running.  While commit eddd1a411d93
    ("merge-recursive: enforce rule that index matches head before
    merging", 2018-06-30) should have uncovered this broken test, it
    used a test_must_fail wrapper around the merge-recursive call
    because it was known that the merge resulted in a rename/rename
    conflict.  Thus, that fix only made this test fail for a different
    reason, and since the index == head check didn't happen until after
    coming all the way back out of the recursion, the testcase had
    enough information to pass the one check that it did perform.

So, load the index in builtin/merge-recursive.c, reload the in-memory
index in builtin/stash.c, and modify the t3030 testcase to correctly
setup the index and make sure that the test fails in the expected way
(meaning it reports a rename/rename conflict).  This makes sure that
all callers actually make the index match head.  The next commit will
then enforce the condition that index matches head earlier so this
problem doesn't return in the future.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: remove another implicit dependency on the_repository
Elijah Newren [Sat, 17 Aug 2019 18:41:27 +0000 (11:41 -0700)] 
merge-recursive: remove another implicit dependency on the_repository

Commit d7cf3a96e9a0 ("merge-recursive.c: remove implicit dependency on
the_repository", 2019-01-12) and follow-ups like commit 34e7771bc644
("Use the right 'struct repository' instead of the_repository",
2019-06-27), removed most implicit uses of the_repository.  Convert
calls to get_commit_tree() to instead use repo_get_commit_tree() to get
rid of another.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: future-proof update_file_flags() against memory leaks
Elijah Newren [Sat, 17 Aug 2019 18:41:26 +0000 (11:41 -0700)] 
merge-recursive: future-proof update_file_flags() against memory leaks

There is a 'free_buf' label to which all but one of the error paths in
update_file_flags() jump; that error case involves a NULL buf and is
thus not a memory leak.  However, make that error case execute the same
deallocation code anyway so that if anyone adds any additional memory
allocations or deallocations, then all error paths correctly deallocate
resources.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: introduce an enum for detect_directory_renames values
Derrick Stolee [Sat, 17 Aug 2019 18:41:25 +0000 (11:41 -0700)] 
merge-recursive: introduce an enum for detect_directory_renames values

Improve code readability by introducing an enum to replace the
not-quite-boolean values taken on by detect_directory_renames.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: provide a better label for diff3 common ancestor
Elijah Newren [Sat, 17 Aug 2019 18:41:24 +0000 (11:41 -0700)] 
merge-recursive: provide a better label for diff3 common ancestor

In commit 7ca56aa07619 ("merge-recursive: add a label for ancestor",
2010-03-20), a label was added for the '||||||' line to make it have
the more informative heading '|||||| merged common ancestors', with
the statement:

    It would be nicer to use a more informative label.  Perhaps someone
    will provide one some day.

This chosen label was perfectly reasonable when recursiveness kicks in,
i.e. when there are multiple merge bases.  (I can't think of a better
label in such cases.)  But it is actually somewhat misleading when there
is a unique merge base or no merge base.  Change this based on the
number of merge bases:
    >=2: "merged common ancestors"
    1:   <abbreviated commit hash>
    0:   "<empty tree>"

Tests have also been added to check that we get the right ancestor name
for each of the three cases.

Also, since merge_recursive() and merge_trees() have polar opposite
pre-conditions for opt->ancestor, document merge_recursive()'s
pre-condition with an assertion.  (An assertion was added to
merge_trees() already a few commits ago.)  The differences in
pre-conditions stem from two factors: (1) merge_trees() does not recurse
and thus does not have multiple sub-merges to worry about -- each of
which would require a different value for opt->ancestor, (2)
merge_trees() is only passed trees rather than commits and thus cannot
internally guess as good of a label.  Thus, while external callers of
merge_trees() are required to provide a non-NULL opt->ancestor,
merge_recursive() expects to set this value itself.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: enforce opt->ancestor != NULL when calling merge_trees()
Elijah Newren [Thu, 15 Aug 2019 21:40:32 +0000 (14:40 -0700)] 
merge-recursive: enforce opt->ancestor != NULL when calling merge_trees()

We always want our conflict hunks to be labelled so that users can know
where each came from.  The previous commit fixed the one caller in the
codebase which was not setting opt->ancestor (and thus not providing a
label for the "merge base" conflict hunk in diff3-style conflict
markers); add an assertion to prevent future codepaths from also
overlooking this requirement.

Enforcing this requirement also allows us to simplify the code for
labelling the conflict hunks by no longer checking if the ancestor label
is NULL.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocheckout: provide better conflict hunk description with detached HEAD
Elijah Newren [Thu, 15 Aug 2019 21:40:31 +0000 (14:40 -0700)] 
checkout: provide better conflict hunk description with detached HEAD

When running 'git checkout -m' and using diff3 style conflict markers,
we want all the conflict hunks (left-side, "common" or "merge base", and
right-side) to have label markers letting the user know where each came
from.  The "common" hunk label (o.ancestor) came from
old_branch_info->name, but that is NULL when HEAD is detached, which
resulted in a blank label.  Check for that case and provide an
abbreviated commit hash instead.

(Incidentally, this was the only case in the git codebase where
merge_trees() was called with opt->ancestor being NULL.  A subsequent
commit will prevent similar problems by enforcing that merge_trees()
always be called with opt->ancestor != NULL.)

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: be consistent with assert
Elijah Newren [Thu, 15 Aug 2019 21:40:30 +0000 (14:40 -0700)] 
merge-recursive: be consistent with assert

In commit 8daec1df03de ("merge-recursive: switch from (oid,mode) pairs
to a diff_filespec", 2019-04-05), an assertion on a->path && b->path
was added for code readability to document that these both needed to be
non-NULL at this point in the code.  However, the subsequent lines also
read o->path, so it should be included in the assert.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.23 v2.23.0
Junio C Hamano [Fri, 16 Aug 2019 17:28:23 +0000 (10:28 -0700)] 
Git 2.23

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge tag 'l10n-2.23.0-rnd2' of git://github.com/git-l10n/git-po
Junio C Hamano [Fri, 16 Aug 2019 17:22:51 +0000 (10:22 -0700)] 
Merge tag 'l10n-2.23.0-rnd2' of git://github.com/git-l10n/git-po

l10n-2.23.0-rnd2

4 years agol10n: zh_CN: for git v2.23.0 l10n round 1~2
Jiang Xin [Tue, 30 Jul 2019 02:02:22 +0000 (10:02 +0800)] 
l10n: zh_CN: for git v2.23.0 l10n round 1~2

Translate 128 new messages (4674t0f0u) for git 2.23.0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agol10n: de.po: Update German translation
Matthias Ruester [Fri, 2 Aug 2019 09:42:08 +0000 (11:42 +0200)] 
l10n: de.po: Update German translation

Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Reviewed-by: Phillip Szelat <phillip.szelat@gmail.com>
4 years agoMerge branch 'master' of https://github.com/vnwildman/git
Jiang Xin [Mon, 12 Aug 2019 08:04:28 +0000 (16:04 +0800)] 
Merge branch 'master' of https://github.com/vnwildman/git

* 'master' of https://github.com/vnwildman/git:
  l10n: vi(4674t): Updated translation for Vietnamese

4 years agoMerge branch 'update-italian-translation' of github.com:AlessandroMenti/git-po
Jiang Xin [Mon, 12 Aug 2019 08:02:08 +0000 (16:02 +0800)] 
Merge branch 'update-italian-translation' of github.com:AlessandroMenti/git-po

* 'update-italian-translation' of github.com:AlessandroMenti/git-po:
  l10n: it.po: update the Italian localization for v2.23.0 round 2

4 years agoMerge branch 'next' of https://github.com/ChrisADR/git-po
Jiang Xin [Mon, 12 Aug 2019 08:00:14 +0000 (16:00 +0800)] 
Merge branch 'next' of https://github.com/ChrisADR/git-po

* 'next' of https://github.com/ChrisADR/git-po:
  l10n: es: 2.23.0 round 2

4 years agoSync with Git 2.22.1
Junio C Hamano [Mon, 12 Aug 2019 00:41:39 +0000 (17:41 -0700)] 
Sync with Git 2.22.1

4 years agodoc: fix repeated words
Mark Rushakoff [Sat, 10 Aug 2019 05:59:14 +0000 (22:59 -0700)] 
doc: fix repeated words

Inspired by 21416f0a07 ("restore: fix typo in docs", 2019-08-03), I ran
"git grep -E '(\b[a-zA-Z]+) \1\b' -- Documentation/" to find other cases
where words were duplicated, e.g. "the the", and in most cases removed
one of the repeated words.

There were many false positives by this grep command, including
deliberate repeated words like "really really" or valid uses of "that
that" which I left alone, of course.

I also did not correct any of the legitimate, accidentally repeated
words in old RelNotes.

Signed-off-by: Mark Rushakoff <mark.rushakoff@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.22.1 v2.22.1
Junio C Hamano [Fri, 9 Aug 2019 22:20:04 +0000 (15:20 -0700)] 
Git 2.22.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years ago.mailmap: update email address of Philip Oakley
Philip Oakley [Sun, 11 Aug 2019 15:03:38 +0000 (16:03 +0100)] 
.mailmap: update email address of Philip Oakley

My IEE 'home for life' email service is being withdrawn on 30 Sept 2019.
Replace with my new email domain.

I also have a secondary (backup) 'home for life' through
<philipoakley@dunelm.org.uk>.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: it.po: update the Italian localization for v2.23.0 round 2
Alessandro Menti [Sun, 11 Aug 2019 09:54:27 +0000 (11:54 +0200)] 
l10n: it.po: update the Italian localization for v2.23.0 round 2

Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
4 years agol10n: vi(4674t): Updated translation for Vietnamese
Tran Ngoc Quan [Sun, 11 Aug 2019 00:14:07 +0000 (07:14 +0700)] 
l10n: vi(4674t): Updated translation for Vietnamese

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
4 years agol10n: es: 2.23.0 round 2
Christopher Diaz Riveros [Mon, 15 Jul 2019 21:50:36 +0000 (16:50 -0500)] 
l10n: es: 2.23.0 round 2

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
4 years agol10n: fr v2.23.0 round 2
Jean-Noël Avila [Sat, 10 Aug 2019 16:12:51 +0000 (18:12 +0200)] 
l10n: fr v2.23.0 round 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
4 years agol10n: git.pot: v2.23.0 round 2 (4 new, 6 removed)
Jiang Xin [Sat, 10 Aug 2019 12:13:14 +0000 (20:13 +0800)] 
l10n: git.pot: v2.23.0 round 2 (4 new, 6 removed)

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

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agoMerge tag 'v2.23.0-rc2' of git://git.kernel.org/pub/scm/git/git
Jiang Xin [Sat, 10 Aug 2019 12:11:17 +0000 (20:11 +0800)] 
Merge tag 'v2.23.0-rc2' of git://git.kernel.org/pub/scm/git/git

Git 2.23-rc2

* tag 'v2.23.0-rc2' of git://git.kernel.org/pub/scm/git/git: (63 commits)
  Git 2.23-rc2
  t0000: reword comments for "local" test
  t: decrease nesting in test_oid_to_path
  sha1-file: release strbuf after use
  test-dir-iterator: use path argument directly
  dir-iterator: release strbuf after use
  commit-graph: release strbufs after use
  l10n: reformat some localized strings for v2.23.0
  merge-recursive: avoid directory rename detection in recursive case
  commit-graph: fix bug around octopus merges
  restore: fix typo in docs
  doc: typo: s/can not/cannot/ and s/is does/does/
  Git 2.23-rc1
  log: really flip the --mailmap default
  RelNotes/2.23.0: fix a few typos and other minor issues
  RelNotes/2.21.1: typofix
  log: flip the --mailmap default unconditionally
  config: work around bug with includeif:onbranch and early config
  A few more last-minute fixes
  repack: simplify handling of auto-bitmaps and .keep files
  ...

4 years agol10n: bg.po: Updated Bulgarian translation (4674t)
Alexander Shopov [Fri, 9 Aug 2019 05:08:03 +0000 (08:08 +0300)] 
l10n: bg.po: Updated Bulgarian translation (4674t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
4 years agoMerge branch 'cb/xdiff-no-system-includes-in-dot-c' into maint
Junio C Hamano [Fri, 9 Aug 2019 22:18:19 +0000 (15:18 -0700)] 
Merge branch 'cb/xdiff-no-system-includes-in-dot-c' into maint

Compilation fix.

* cb/xdiff-no-system-includes-in-dot-c:
  xdiff: remove duplicate headers from xpatience.c
  xdiff: remove duplicate headers from xhistogram.c
  xdiff: drop system includes in xutils.c

4 years agoMerge branch 'jk/no-system-includes-in-dot-c' into maint
Junio C Hamano [Fri, 9 Aug 2019 22:18:18 +0000 (15:18 -0700)] 
Merge branch 'jk/no-system-includes-in-dot-c' into maint

Compilation fix.

* jk/no-system-includes-in-dot-c:
  wt-status.h: drop stdio.h include
  verify-tag: drop signal.h include

4 years agoMerge branch 'sg/fsck-config-in-doc' into maint
Junio C Hamano [Fri, 9 Aug 2019 22:18:18 +0000 (15:18 -0700)] 
Merge branch 'sg/fsck-config-in-doc' into maint

Doc update.

* sg/fsck-config-in-doc:
  Documentation/git-fsck.txt: include fsck.* config variables

4 years agoMerge branch 'jk/xdiff-clamp-funcname-context-index' into maint
Junio C Hamano [Fri, 9 Aug 2019 22:18:18 +0000 (15:18 -0700)] 
Merge branch 'jk/xdiff-clamp-funcname-context-index' into maint

The internal diff machinery can be made to read out of bounds while
looking for --funcion-context line in a corner case, which has been
corrected.

* jk/xdiff-clamp-funcname-context-index:
  xdiff: clamp function context indices in post-image

4 years agoGit 2.23-rc2 v2.23.0-rc2
Junio C Hamano [Fri, 9 Aug 2019 17:15:39 +0000 (10:15 -0700)] 
Git 2.23-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'bc/hash-independent-tests-part-4'
Junio C Hamano [Fri, 9 Aug 2019 17:13:14 +0000 (10:13 -0700)] 
Merge branch 'bc/hash-independent-tests-part-4'

Test fix.

* bc/hash-independent-tests-part-4:
  t0000: reword comments for "local" test
  t: decrease nesting in test_oid_to_path

4 years agoMerge branch 'rs/plug-strbuf-reak-in-read-alt-refs'
Junio C Hamano [Fri, 9 Aug 2019 17:13:14 +0000 (10:13 -0700)] 
Merge branch 'rs/plug-strbuf-reak-in-read-alt-refs'

Leakfix.

* rs/plug-strbuf-reak-in-read-alt-refs:
  sha1-file: release strbuf after use

4 years agoMerge branch 'mt/dir-iterator-updates'
Junio C Hamano [Fri, 9 Aug 2019 17:13:14 +0000 (10:13 -0700)] 
Merge branch 'mt/dir-iterator-updates'

Leakfix.

* mt/dir-iterator-updates:
  test-dir-iterator: use path argument directly
  dir-iterator: release strbuf after use

4 years agoMerge branch 'ds/commit-graph-incremental'
Junio C Hamano [Fri, 9 Aug 2019 17:13:13 +0000 (10:13 -0700)] 
Merge branch 'ds/commit-graph-incremental'

Leakfix.

* ds/commit-graph-incremental:
  commit-graph: release strbufs after use

4 years agoMerge branch 'ja/l10n-fixes'
Junio C Hamano [Thu, 8 Aug 2019 21:26:10 +0000 (14:26 -0700)] 
Merge branch 'ja/l10n-fixes'

A few messages have been updated to help localization better.

* ja/l10n-fixes:
  l10n: reformat some localized strings for v2.23.0

4 years agoMerge branch 'en/disable-dir-rename-in-recursive-merge'
Junio C Hamano [Thu, 8 Aug 2019 21:26:10 +0000 (14:26 -0700)] 
Merge branch 'en/disable-dir-rename-in-recursive-merge'

"merge-recursive" hit a BUG() when building a virtual merge base
detected a directory rename.

* en/disable-dir-rename-in-recursive-merge:
  merge-recursive: avoid directory rename detection in recursive case

4 years agoMerge branch 'nd/switch-and-restore'
Junio C Hamano [Thu, 8 Aug 2019 21:26:09 +0000 (14:26 -0700)] 
Merge branch 'nd/switch-and-restore'

Docfix.

* nd/switch-and-restore:
  restore: fix typo in docs

4 years agoMerge branch 'mr/doc-can-not-to-cannot'
Junio C Hamano [Thu, 8 Aug 2019 21:26:09 +0000 (14:26 -0700)] 
Merge branch 'mr/doc-can-not-to-cannot'

Docfix.

* mr/doc-can-not-to-cannot:
  doc: typo: s/can not/cannot/ and s/is does/does/

4 years agoMerge branch 'ds/commit-graph-octopus-fix'
Junio C Hamano [Thu, 8 Aug 2019 21:26:09 +0000 (14:26 -0700)] 
Merge branch 'ds/commit-graph-octopus-fix'

commit-graph did not handle commits with more than two parents
correctly, which has been corrected.

* ds/commit-graph-octopus-fix:
  commit-graph: fix bug around octopus merges

4 years agot0000: reword comments for "local" test
Jeff King [Thu, 8 Aug 2019 09:37:33 +0000 (05:37 -0400)] 
t0000: reword comments for "local" test

Commit 01d3a526ad (t0000: check whether the shell supports the "local"
keyword, 2017-10-26) added a test to gather data on whether people run
the test suite with shells that don't support "local".

After almost two years, nobody has complained, and several other uses
have cropped up in test-lib-functions.sh. Let's declare it acceptable to
use.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot: decrease nesting in test_oid_to_path
Jonathan Nieder [Thu, 8 Aug 2019 06:56:14 +0000 (23:56 -0700)] 
t: decrease nesting in test_oid_to_path

t1410.3 ("corrupt and checks") fails when run using dash versions
before 0.5.8, with a cryptic message:

mv: cannot stat '.git/objects//e84adb2704cbd49549e52169b4043871e13432': No such file or directory

The function generating that path:

test_oid_to_path () {
echo "${1%${1#??}}/${1#??}"
}

which is supposed to produce a result like

12/3456789....

But a dash bug[*] causes it to instead expand to

/3456789...

The stream of symbols that makes up this function is hard for humans
to follow, too.  The complexity mostly comes from the repeated use of
the expression ${1#??} for the basename of the loose object.  Use a
variable instead --- nowadays, the dialect of shell used by Git
permits local variables, so this is cheap.

An alternative way to work around [*] is to remove the double-quotes
around test_oid_to_path's return value.  That makes the expression
easier for dash to read, but harder for humans.  Let's prefer the
rephrasing that's helpful for humans, too.

Noticed by building on Ubuntu trusty, which uses dash 0.5.7.

[*] Fixed by v0.5.8~13 ("[EXPAND] Propagate EXP_QPAT in subevalvar, 2013-08-23).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agosha1-file: release strbuf after use
René Scharfe [Wed, 7 Aug 2019 11:15:25 +0000 (13:15 +0200)] 
sha1-file: release strbuf after use

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agotest-dir-iterator: use path argument directly
René Scharfe [Wed, 7 Aug 2019 11:15:20 +0000 (13:15 +0200)] 
test-dir-iterator: use path argument directly

Avoid allocating and leaking a strbuf for holding a verbatim copy of the
path argument and pass the latter directly to dir_iterator_begin()
instead.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodir-iterator: release strbuf after use
René Scharfe [Wed, 7 Aug 2019 11:15:14 +0000 (13:15 +0200)] 
dir-iterator: release strbuf after use

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: release strbufs after use
René Scharfe [Wed, 7 Aug 2019 11:15:02 +0000 (13:15 +0200)] 
commit-graph: release strbufs after use

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: reformat some localized strings for v2.23.0
Jean-Noël Avila [Tue, 6 Aug 2019 17:19:52 +0000 (19:19 +0200)] 
l10n: reformat some localized strings for v2.23.0

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: avoid directory rename detection in recursive case
Elijah Newren [Mon, 5 Aug 2019 22:33:50 +0000 (15:33 -0700)] 
merge-recursive: avoid directory rename detection in recursive case

Ever since commit 8c8e5bd6eb33 ("merge-recursive: switch directory
rename detection default", 2019-04-05), the default handling with
directory rename detection was to report a conflict and leave unstaged
entries in the index.  However, when creating a virtual merge base in
the recursive case, we absolutely need a tree, and the only way a tree
can be written is if we have no unstaged entries -- otherwise we hit a
BUG().

There are a few fixes possible here which at least fix the BUG(), but
none of them seem optimal for other reasons; see the comments with the
new testcase 13e in t6043 for details (which testcase triggered a BUG()
prior to this patch).  As such, just opt for a very conservative and
simple choice that is still relatively reasonable: have the recursive
case treat 'conflict' as 'false' for opt->detect_directory_renames.

Reported-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: vi.po (4676t): Updated Vietnamese translation
Tran Ngoc Quan [Tue, 6 Aug 2019 07:30:57 +0000 (14:30 +0700)] 
l10n: vi.po (4676t): Updated Vietnamese translation

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
4 years agocommit-graph: fix bug around octopus merges
Derrick Stolee [Mon, 5 Aug 2019 16:43:41 +0000 (09:43 -0700)] 
commit-graph: fix bug around octopus merges

In 1771be90 "commit-graph: merge commit-graph chains" (2019-06-18),
the method sort_and_scan_merged_commits() was added to merge the
commit lists of two commit-graph files in the incremental format.
Unfortunately, there was an off-by-one error in that method around
incrementing num_extra_edges, which leads to an incorrect offset
for the base graph chunk.

When we store an octopus merge in the commit-graph file, we store
the first parent in the normal place, but use the second parent
position to point into the "extra edges" chunk where the remaining
parents exist. This means we should be adding "num_parents - 1"
edges to this list, not "num_parents - 2". That is the basic error.

The reason this was not caught in the test suite is more subtle.
In 5324-split-commit-graph.sh, we test creating an octopus merge
and adding it to the tip of a commit-graph chain, then verify the
result. This _should_ have caught the problem, except that when
we load the commit-graph files we were overly careful to not fail
when the commit-graph chain does not match. This care was on
purpose to avoid race conditions as one process reads the chain
and another process modifies it. In such a case, the reading
process outputs the following message to stderr:

warning: commit-graph chain does not match

These warnings are output in the test suite, but ignored. By
checking the stderr of `git commit-graph verify` to include
the expected progress output, it will now catch this error.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorestore: fix typo in docs
William Chargin [Sat, 3 Aug 2019 22:04:58 +0000 (15:04 -0700)] 
restore: fix typo in docs

Signed-off-by: William Chargin <wchargin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodoc: typo: s/can not/cannot/ and s/is does/does/
Mark Rushakoff [Sat, 3 Aug 2019 05:33:51 +0000 (22:33 -0700)] 
doc: typo: s/can not/cannot/ and s/is does/does/

"Can not" suggests one has the option to not do something, whereas
"cannot" more strongly suggests something is disallowed or impossible.

Noticed "can not", mistakenly used instead of "cannot" in git help
glossary, then ran git grep 'can not' and found many other instances.
Only files in the Documentation folder were modified.

'Can not' also occurs in some source code comments and some test
assertion messages, and there is an error message and translation "can
not move directory into itself" which I may fix and submit separately
from the documentation change.

Also noticed and fixed "is does" in git help fetch, but there are no
other occurrences of that typo according to git grep.

Signed-off-by: Mark Rushakoff <mark.rushakoff@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'master' of https://github.com/Softcatala/git-po
Jiang Xin [Sat, 3 Aug 2019 13:09:13 +0000 (21:09 +0800)] 
Merge branch 'master' of https://github.com/Softcatala/git-po

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

4 years agoMerge branch 'update-italian-translation' of github.com:AlessandroMenti/git-po
Jiang Xin [Sat, 3 Aug 2019 13:07:05 +0000 (21:07 +0800)] 
Merge branch 'update-italian-translation' of github.com:AlessandroMenti/git-po

* 'update-italian-translation' of github.com:AlessandroMenti/git-po:
  l10n: it.po: update the Italian translation for v2.23.0

4 years agol10n: Update Catalan translation
Jordi Mas [Sat, 3 Aug 2019 07:27:05 +0000 (09:27 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
4 years agoGit 2.23-rc1 v2.23.0-rc1
Junio C Hamano [Fri, 2 Aug 2019 20:12:24 +0000 (13:12 -0700)] 
Git 2.23-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'sg/fsck-config-in-doc'
Junio C Hamano [Fri, 2 Aug 2019 20:12:03 +0000 (13:12 -0700)] 
Merge branch 'sg/fsck-config-in-doc'

Doc update.

* sg/fsck-config-in-doc:
  Documentation/git-fsck.txt: include fsck.* config variables

4 years agoMerge branch 'js/visual-studio'
Junio C Hamano [Fri, 2 Aug 2019 20:12:02 +0000 (13:12 -0700)] 
Merge branch 'js/visual-studio'

Support building Git with Visual Studio

The bits about .git/branches/* have been dropped from the series.
We may want to drop the support for it, but until that happens, the
tests should rely on the existence of the support to pass.

* js/visual-studio: (23 commits)
  git: avoid calling aliased builtins via their dashed form
  bin-wrappers: append `.exe` to target paths if necessary
  .gitignore: ignore Visual Studio's temporary/generated files
  .gitignore: touch up the entries regarding Visual Studio
  vcxproj: also link-or-copy builtins
  msvc: add a Makefile target to pre-generate the Visual Studio solution
  contrib/buildsystems: add a backend for modern Visual Studio versions
  contrib/buildsystems: handle options starting with a slash
  contrib/buildsystems: also handle -lexpat
  contrib/buildsystems: handle libiconv, too
  contrib/buildsystems: handle the curl library option
  contrib/buildsystems: error out on unknown option
  contrib/buildsystems: optionally capture the dry-run in a file
  contrib/buildsystems: redirect errors of the dry run into a log file
  contrib/buildsystems: ignore gettext stuff
  contrib/buildsystems: handle quoted spaces in filenames
  contrib/buildsystems: fix misleading error message
  contrib/buildsystems: ignore irrelevant files in Generators/
  contrib/buildsystems: ignore invalidcontinue.obj
  Vcproj.pm: urlencode '<' and '>' when generating VC projects
  ...

4 years agoMerge branch 'jc/log-mailmap-flip-defaults'
Junio C Hamano [Fri, 2 Aug 2019 20:12:02 +0000 (13:12 -0700)] 
Merge branch 'jc/log-mailmap-flip-defaults'

Hotfix for making "git log" use the mailmap by default.

* jc/log-mailmap-flip-defaults:
  log: really flip the --mailmap default
  log: flip the --mailmap default unconditionally

4 years agoMerge branch 'js/early-config-with-onbranch'
Junio C Hamano [Fri, 2 Aug 2019 20:12:02 +0000 (13:12 -0700)] 
Merge branch 'js/early-config-with-onbranch'

The recently added [includeif "onbranch:branch"] feature does not
work well with an early config mechanism, as it attempts to find
out what branch we are on before we even haven't located the git
repository.  The inclusion during early config scan is ignored to
work around this issue.

* js/early-config-with-onbranch:
  config: work around bug with includeif:onbranch and early config

4 years agolog: really flip the --mailmap default
Junio C Hamano [Thu, 1 Aug 2019 21:48:34 +0000 (14:48 -0700)] 
log: really flip the --mailmap default

Update the docs, test the interaction between the new default,
configuration and command line option, in addition to actually
flipping the default.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'jk/repack-silence-auto-bitmap-warning'
Junio C Hamano [Thu, 1 Aug 2019 16:10:50 +0000 (09:10 -0700)] 
Merge branch 'jk/repack-silence-auto-bitmap-warning'

Squelch unneeded and misleading warnings from "repack" when the
command attempts to generate pack bitmaps without explicitly asked
for by the user.

* jk/repack-silence-auto-bitmap-warning:
  repack: simplify handling of auto-bitmaps and .keep files
  repack: silence warnings when auto-enabled bitmaps cannot be built
  t7700: clean up .keep file in bitmap-writing test

4 years agoMerge branch 'jk/sort-iter-test-output'
Junio C Hamano [Thu, 1 Aug 2019 16:10:50 +0000 (09:10 -0700)] 
Merge branch 'jk/sort-iter-test-output'

* jk/sort-iter-test-output:
  t: sort output of hashmap iteration

4 years agoMerge branch 'jc/dir-iterator-test-fix'
Junio C Hamano [Thu, 1 Aug 2019 16:10:49 +0000 (09:10 -0700)] 
Merge branch 'jc/dir-iterator-test-fix'

* jc/dir-iterator-test-fix:
  test-dir-iterator: do not assume errno values

4 years agoMerge branch 'bc/hash-independent-tests-part-4'
Junio C Hamano [Thu, 1 Aug 2019 16:10:49 +0000 (09:10 -0700)] 
Merge branch 'bc/hash-independent-tests-part-4'

Update to the tests to help SHA-256 transition continues.

* bc/hash-independent-tests-part-4:
  t2203: avoid hard-coded object ID values
  t1710: make hash independent
  t1007: remove SHA1 prerequisites
  t0090: make test pass with SHA-256
  t0027: make hash size independent
  t6030: make test work with SHA-256
  t5000: make hash independent
  t1450: make hash size independent
  t1410: make hash size independent
  t: add helper to convert object IDs to paths

4 years agoRelNotes/2.23.0: fix a few typos and other minor issues
Martin Ågren [Thu, 1 Aug 2019 14:12:20 +0000 (16:12 +0200)] 
RelNotes/2.23.0: fix a few typos and other minor issues

Fix the spelling of the new "--no-show-forced-updates" option that "git
fetch/pull" learned. Similarly, spell "--function-context" correctly and
fix a few typos, grammos and minor mistakes.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoSync with maint
Junio C Hamano [Thu, 1 Aug 2019 16:00:46 +0000 (09:00 -0700)] 
Sync with maint

* maint:
  RelNotes/2.21.1: typofix

4 years agoRelNotes/2.21.1: typofix
Martin Ågren [Thu, 1 Aug 2019 14:12:20 +0000 (16:12 +0200)] 
RelNotes/2.21.1: typofix

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agolog: flip the --mailmap default unconditionally
Junio C Hamano [Thu, 1 Aug 2019 15:32:44 +0000 (08:32 -0700)] 
log: flip the --mailmap default unconditionally

It turns out that being cautious to warn against upcoming default
change was an unpopular behaviour, and such a care can easily be
defeated by distro packagers to render it ineffective anyway.

Just flip the default, with only a mention in the release notes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: it.po: update the Italian translation for v2.23.0
Alessandro Menti [Thu, 1 Aug 2019 07:32:52 +0000 (09:32 +0200)] 
l10n: it.po: update the Italian translation for v2.23.0

Update the Italian translation for Git v2.23.0 (l10n round 1), as
well as adding some minor localization fixes.

Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
4 years agoconfig: work around bug with includeif:onbranch and early config
Johannes Schindelin [Wed, 31 Jul 2019 20:06:42 +0000 (13:06 -0700)] 
config: work around bug with includeif:onbranch and early config

Since 07b2c0eacac (config: learn the "onbranch:" includeIf condition,
2019-06-05), there is a potential catch-22 in the early config path: if
the `include.onbranch:` feature is used, Git assumes that the Git
directory has been initialized already. However, in the early config
code path that is not true.

One way to trigger this is to call the following commands in any
repository:

git config includeif.onbranch:refs/heads/master.path broken
git help -a

The symptom triggered by the `git help -a` invocation reads like this:

BUG: refs.c:1851: attempting to get main_ref_store outside of repository

Let's work around this, simply by ignoring the `includeif.onbranch:`
setting when parsing the config when the ref store has not been
initialized (yet).

Technically, there is a way to solve this properly: teach the refs
machinery to initialize the ref_store from a given gitdir/commondir pair
(which we _do_ have in the early config code path), and then use that in
`include_by_branch()`. This, however, is a pretty involved project, and
we're already in the feature freeze for Git v2.23.0.

Note: when calling above-mentioned two commands _outside_ of any Git
worktree (passing the `--global` flag to `git config`, as there is
obviously no repository config available), at the point when
`include_by_branch()` is called, `the_repository` is `NULL`, therefore
we have to be extra careful not to dereference it in that case.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoA few more last-minute fixes
Junio C Hamano [Wed, 31 Jul 2019 21:45:42 +0000 (14:45 -0700)] 
A few more last-minute fixes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'cb/xdiff-no-system-includes-in-dot-c'
Junio C Hamano [Wed, 31 Jul 2019 21:38:56 +0000 (14:38 -0700)] 
Merge branch 'cb/xdiff-no-system-includes-in-dot-c'

Compilation fix.

* cb/xdiff-no-system-includes-in-dot-c:
  xdiff: remove duplicate headers from xpatience.c
  xdiff: remove duplicate headers from xhistogram.c
  xdiff: drop system includes in xutils.c

4 years agoMerge branch 'jk/no-system-includes-in-dot-c'
Junio C Hamano [Wed, 31 Jul 2019 21:38:56 +0000 (14:38 -0700)] 
Merge branch 'jk/no-system-includes-in-dot-c'

Compilation fix.

* jk/no-system-includes-in-dot-c:
  wt-status.h: drop stdio.h include
  verify-tag: drop signal.h include

4 years agorepack: simplify handling of auto-bitmaps and .keep files
Jeff King [Wed, 31 Jul 2019 05:40:56 +0000 (01:40 -0400)] 
repack: simplify handling of auto-bitmaps and .keep files

Commit 7328482253 (repack: disable bitmaps-by-default if .keep files
exist, 2019-06-29) taught repack to prefer disabling bitmaps to
duplicating objects (unless bitmaps were asked for explicitly).

But there's an easier way to do this: if we keep passing the
--honor-pack-keep flag to pack-objects when auto-enabling bitmaps, then
pack-objects already makes the same decision (it will disable bitmaps
rather than duplicate). Better still, pack-objects can actually decide
to do so based not just on the presence of a .keep file, but on whether
that .keep file actually impacts the new pack we're making (so if we're
racing with a push or fetch, for example, their temporary .keep file
will not block us from generating bitmaps if they haven't yet updated
their refs).

And because repack uses the --write-bitmap-index-quiet flag, we don't
have to worry about pack-objects generating confusing warnings when it
does see a .keep file. We can confirm this by tweaking the .keep test to
check repack's stderr.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorepack: silence warnings when auto-enabled bitmaps cannot be built
Jeff King [Wed, 31 Jul 2019 05:39:27 +0000 (01:39 -0400)] 
repack: silence warnings when auto-enabled bitmaps cannot be built

Depending on various config options, a full repack may not be able to
build a reachability bitmap index (e.g., if pack.packSizeLimit forces us
to write multiple packs). In these cases pack-objects may write a
warning to stderr.

Since 36eba0323d (repack: enable bitmaps by default on bare repos,
2019-03-14), we may generate these warnings even when the user did not
explicitly ask for bitmaps. This has two downsides:

  - it can be confusing, if they don't know what bitmaps are

  - a daemonized auto-gc will write this to its log file, and the
    presence of the warning may suppress further auto-gc (until
    gc.logExpiry has elapsed)

Let's have repack communicate to pack-objects that the choice to turn on
bitmaps was not made explicitly by the user, which in turn allows
pack-objects to suppress these warnings.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot7700: clean up .keep file in bitmap-writing test
Jeff King [Wed, 31 Jul 2019 05:37:36 +0000 (01:37 -0400)] 
t7700: clean up .keep file in bitmap-writing test

After our test snippet finishes, the .keep file is left in place, making
it hard to do further tests of the auto-bitmap-writing code (since it
suppresses the feature completely). Let's clean it up.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot: sort output of hashmap iteration
Jeff King [Wed, 31 Jul 2019 01:23:37 +0000 (21:23 -0400)] 
t: sort output of hashmap iteration

The iteration order of a hashmap is undefined, and may depend on things
like the exact set of items added, or the table has been grown or
shrunk. In the case of an oidmap, it even depends on endianness, because
we take the oid hash by casting sha1 bytes directly into an unsigned
int.

Let's sort the test-tool output from any hash iterators. In the case of
t0011, this is just future-proofing. But for t0016, it actually fixes a
reported failure on the big-endian s390 and nonstop ports.

I didn't bother to teach the helper functions to optionally sort output.
They are short enough that it's simpler to just repeat them inline for
the iteration tests than it is to add a --sort option.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: sv.po: Update Swedish translation (4676t0f0u)
Peter Krefting [Wed, 31 Jul 2019 10:44:47 +0000 (12:44 +0200)] 
l10n: sv.po: Update Swedish translation (4676t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
4 years agotest-dir-iterator: do not assume errno values
Junio C Hamano [Tue, 30 Jul 2019 17:45:48 +0000 (10:45 -0700)] 
test-dir-iterator: do not assume errno values

A few tests printed 'errno' as an integer and compared with
hardcoded integers; this is obviously not portable.

A two things to note are:

 - the string obtained by strerror() is not portable, and cannot be
   used for the purpose of these tests.

 - there unfortunately isn't a portable way to map error numbers to
   error names.

As we only care about a few selected errors, just map the error
number to the name before emitting for comparison.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: git.pot: v2.23.0 round 1 (130 new, 35 removed)
Jiang Xin [Tue, 30 Jul 2019 01:59:56 +0000 (09:59 +0800)] 
l10n: git.pot: v2.23.0 round 1 (130 new, 35 removed)

Generate po/git.pot from v2.23.0-rc0 for git v2.23.0 l10n round 1.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agoMerge tag 'v2.23.0-rc0' of git://git.kernel.org/pub/scm/git/git
Jiang Xin [Tue, 30 Jul 2019 01:56:16 +0000 (09:56 +0800)] 
Merge tag 'v2.23.0-rc0' of git://git.kernel.org/pub/scm/git/git

Git 2.23-rc0

* tag 'v2.23.0-rc0' of git://git.kernel.org/pub/scm/git/git: (420 commits)
  Git 2.23-rc0
  Merge fixes made on the 'master' front
  Flush fixes up to the third batch post 2.22.0
  The seventh batch
  git: mark cmd_rebase as requiring a worktree
  rebase: fix white-space
  xdiff: clamp function context indices in post-image
  grep: print the pcre2_jit_on value
  t6200: use test_commit_bulk
  travis-ci: build with GCC 4.8 as well
  The sixth batch
  clean: show an error message when the path is too long
  CodingGuidelines: spell out post-C89 rules
  README: fix rendering of text in angle brackets
  rm: resolving by removal is not a warning-worthy event
  transport-helper: avoid var decl in for () loop control
  stash: fix handling removed files with --keep-index
  mingw: support spawning programs containing spaces in their names
  gpg-interface: do not scan past the end of buffer
  tests: defang pager tests by explicitly disabling the log.mailmap warning
  ...

4 years agogit: avoid calling aliased builtins via their dashed form
Johannes Schindelin [Mon, 29 Jul 2019 20:08:16 +0000 (13:08 -0700)] 
git: avoid calling aliased builtins via their dashed form

This is one of the few places where Git violates its own deprecation of
the dashed form. It is not necessary, either.

As of 595d59e2b53 (git.c: ignore pager.* when launching builtin as
dashed external, 2017-08-02), Git wants to ignore the pager.* config
setting when expanding aliases. So let's strip out the
check_pager_config(<command-name>) call from the copy-edited code.

This code actually made it into upstream git.git already, but it was
disabled in `#if 0 ... #endif` guards so far.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agobin-wrappers: append `.exe` to target paths if necessary
Johannes Schindelin [Mon, 29 Jul 2019 20:08:16 +0000 (13:08 -0700)] 
bin-wrappers: append `.exe` to target paths if necessary

When compiling with Visual Studio, the projects' names are identical to
the executables modulo the extensions. Read: there will exist both a
directory called `git` as well as an executable called `git.exe` in the
end. Which means that the bin-wrappers *need* to target the `.exe` files
lest they try to execute directories.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years ago.gitignore: ignore Visual Studio's temporary/generated files
Johannes Schindelin [Mon, 29 Jul 2019 20:08:15 +0000 (13:08 -0700)] 
.gitignore: ignore Visual Studio's temporary/generated files

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years ago.gitignore: touch up the entries regarding Visual Studio
Philip Oakley [Mon, 29 Jul 2019 20:08:14 +0000 (13:08 -0700)] 
.gitignore: touch up the entries regarding Visual Studio

Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
and 'Release' entries at the top-level directory, to allow for
multiple projects (one per target).

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agovcxproj: also link-or-copy builtins
Johannes Schindelin [Mon, 29 Jul 2019 20:08:13 +0000 (13:08 -0700)] 
vcxproj: also link-or-copy builtins

The default location for `.exe` files linked by Visual Studio depends on
the mode (debug vs release) and the architecture. Meaning: after a full
build, there is a `git.exe` in the top-level directory, but none of the
built-ins are linked..

When running a test script in Git Bash, it therefore would pick up the
wrong, say, `git-receive-pack.exe`: the one installed at the same time
as the Git Bash.

Absolutely not what we want. We want to have confidence that our test
covers the MSVC-built Git executables, and not some random stuff.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomsvc: add a Makefile target to pre-generate the Visual Studio solution
Johannes Schindelin [Mon, 29 Jul 2019 20:08:12 +0000 (13:08 -0700)] 
msvc: add a Makefile target to pre-generate the Visual Studio solution

The entire idea of generating the VS solution makes only sense if we
generate it via Continuous Integration; otherwise potential users would
still have to download the entire Git for Windows SDK.

If we pre-generate the Visual Studio solution, Git can be built entirely
within Visual Studio, and the test scripts can be run in a regular Git
for Windows (e.g. the Portable Git flavor, which does not include a full
GCC toolchain and therefore weighs only about a tenth of Git for
Windows' SDK).

So let's just add a target in the Makefile that can be used to generate
said solution; The generated files will then be committed so that they
can be pushed to a branch ready to check out by Visual Studio users.

To make things even more useful, we also generate and commit other files
that are required to run the test suite, such as templates and
bin-wrappers: with this, developers can run the test suite in a regular
Git Bash after building the solution in Visual Studio.

Note: for this build target, we do not actually need to initialize the
`vcpkg` system, so we don't.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: add a backend for modern Visual Studio versions
Johannes Schindelin [Mon, 29 Jul 2019 20:08:12 +0000 (13:08 -0700)] 
contrib/buildsystems: add a backend for modern Visual Studio versions

Based on the previous patches in this patch series that fixed the
generator for `.vcproj` files (which were used by Visual Studio prior to
2015 to define projects), this patch offers to generate project
definitions for neweer versions of Visual Studio (which use `.vcxproj`
files).

To that end, this patch copy-edits the generator of the `.vcproj`.

In addition, we now use the `vcpkg` system which allows us to build
Git's dependencies (e.g. curl, libexpat) conveniently. The support
scripts were introduced in the `jh/msvc` patch series, and with this
patch we initialize the `vcpkg` conditionally, in the `libgit` project's
`PreBuildEvent`. To allow for parallel building of the projects, we
therefore put `libgit` at the bottom of the project hierarchy.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: handle options starting with a slash
Johannes Schindelin [Mon, 29 Jul 2019 20:08:11 +0000 (13:08 -0700)] 
contrib/buildsystems: handle options starting with a slash

With the recent changes to allow building with MSVC=1, we now pass the
/OPT:REF option to the compiler. This confuses the parser that wants to
turn the output of a dry run into project definitions for QMake and Visual
Studio:

Unhandled link option @ line 213: /OPT:REF at [...]

Let's just extend the code that passes through options that start with a
dash, so that it passes through options that start with a slash, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: also handle -lexpat
Johannes Schindelin [Mon, 29 Jul 2019 20:08:10 +0000 (13:08 -0700)] 
contrib/buildsystems: also handle -lexpat

This is a dependency required for the non-smart HTTP backend.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: handle libiconv, too
Johannes Schindelin [Mon, 29 Jul 2019 20:08:10 +0000 (13:08 -0700)] 
contrib/buildsystems: handle libiconv, too

Git's test suite shows tons of breakages unless Git is compiled
*without* NO_ICONV. That means, in turn, that we need to generate
build definitions *with* libiconv, which in turn implies that we
have to handle the -liconv option properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: handle the curl library option
Philip Oakley [Mon, 29 Jul 2019 20:08:09 +0000 (13:08 -0700)] 
contrib/buildsystems: handle the curl library option

Upon seeing the '-lcurl' option, point to the libcurl.lib.

While there, fix the elsif indentation.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: error out on unknown option
Johannes Schindelin [Mon, 29 Jul 2019 20:08:08 +0000 (13:08 -0700)] 
contrib/buildsystems: error out on unknown option

One time too many did this developer call the `generate` script passing
a `--make-out=<PATH>` option that was happily ignored (because there
should be a space, not an equal sign, between `--make-out` and the
path).

And one time too many, this script not only ignored it but did not even
complain. Let's fix that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: optionally capture the dry-run in a file
Philip Oakley [Mon, 29 Jul 2019 20:08:07 +0000 (13:08 -0700)] 
contrib/buildsystems: optionally capture the dry-run in a file

Add an option for capturing the output of the make dry-run used in
determining the msvc-build structure for easy debugging.

You can use the output of `--make-out <path>` in subsequent runs via the
`--in <path>` option.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: redirect errors of the dry run into a log file
Philip Oakley [Mon, 29 Jul 2019 20:08:07 +0000 (13:08 -0700)] 
contrib/buildsystems: redirect errors of the dry run into a log file

Rather than swallowing the errors, it is better to have them in a file.

To make it obvious what this is about, use the file name
'msvc-build-makedryerrors.txt'.

Further, if the output is empty, simply delete that file. As we target
Git for Windows' SDK (which, unlike its predecessor msysGit, offers Perl
versions newer than 5.8), we can use the quite readable syntax `if -f -z
$ErrsFile` (available in Perl >=5.10).

Note that the file will contain the new values of the GIT_VERSION and
GITGUI_VERSION if they were generated by the make file. They are omitted
if the release is tagged and indentically defined in their respective
GIT_VERSION_GEN file DEF_VER variables.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: ignore gettext stuff
Philip Oakley [Mon, 29 Jul 2019 20:08:06 +0000 (13:08 -0700)] 
contrib/buildsystems: ignore gettext stuff

Git's build contains steps to handle internationalization. This caused
hiccups in the parser used to generate QMake/Visual Studio project files.

As those steps are irrelevant in this context, let's just ignore them.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocontrib/buildsystems: handle quoted spaces in filenames
Philip Oakley [Mon, 29 Jul 2019 20:08:05 +0000 (13:08 -0700)] 
contrib/buildsystems: handle quoted spaces in filenames

The engine.pl script expects file names not to contain spaces. However,
paths with spaces are quite prevalent on Windows. Use shellwords() rather
than split() to parse them correctly.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>