]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
4 years agoMerge branch 'js/update-index-ignore-removal-for-skip-worktree'
Junio C Hamano [Sun, 10 Nov 2019 09:02:16 +0000 (18:02 +0900)] 
Merge branch 'js/update-index-ignore-removal-for-skip-worktree'

"git stash save" in a working tree that is sparsely checked out
mistakenly removed paths that are outside the area of interest.

* js/update-index-ignore-removal-for-skip-worktree:
  stash: handle staged changes in skip-worktree files correctly
  update-index: optionally leave skip-worktree entries alone

4 years agoMerge branch 'pb/pretty-email-without-domain-part'
Junio C Hamano [Sun, 10 Nov 2019 09:02:16 +0000 (18:02 +0900)] 
Merge branch 'pb/pretty-email-without-domain-part'

The custom format for "git log --format=<format>" learned the l/L
placeholder that is similar to e/E that fills in the e-mail
address, but only the local part on the left side of '@'.

* pb/pretty-email-without-domain-part:
  pretty: add "%aL" etc. to show local-part of email addresses
  t4203: use test-lib.sh definitions
  t6006: use test-lib.sh definitions

4 years agoMerge branch 'hw/remove-api-docs-placeholder'
Junio C Hamano [Sun, 10 Nov 2019 09:02:15 +0000 (18:02 +0900)] 
Merge branch 'hw/remove-api-docs-placeholder'

Docfix.

* hw/remove-api-docs-placeholder:
  documentation: remove empty doc files

4 years agoMerge branch 'sg/commit-graph-usage-fix'
Junio C Hamano [Sun, 10 Nov 2019 09:02:15 +0000 (18:02 +0900)] 
Merge branch 'sg/commit-graph-usage-fix'

Message fix.

* sg/commit-graph-usage-fix:
  builtin/commit-graph.c: remove subcommand-less usage string

4 years agoMerge branch 'dl/apply-3way-diff3'
Junio C Hamano [Sun, 10 Nov 2019 09:02:15 +0000 (18:02 +0900)] 
Merge branch 'dl/apply-3way-diff3'

"git apply --3way" learned to honor merge.conflictStyle
configuration variable, like merges would.

* dl/apply-3way-diff3:
  apply: respect merge.conflictStyle in --3way
  t4108: demonstrate bug in apply
  t4108: use `test_config` instead of `git config`
  t4108: remove git command upstream of pipe
  t4108: replace create_file with test_write_lines

4 years agoMerge branch 'sg/dir-trie-fixes'
Junio C Hamano [Sun, 10 Nov 2019 09:02:14 +0000 (18:02 +0900)] 
Merge branch 'sg/dir-trie-fixes'

Code clean-up and a bugfix in the logic used to tell worktree local
and repository global refs apart.

* sg/dir-trie-fixes:
  path.c: don't call the match function without value in trie_find()
  path.c: clarify two field names in 'struct common_dir'
  path.c: mark 'logs/HEAD' in 'common_list' as file
  path.c: clarify trie_find()'s in-code comment
  Documentation: mention more worktree-specific exceptions

4 years agoMerge branch 'jc/am-show-current-patch-docfix'
Junio C Hamano [Sun, 10 Nov 2019 09:02:14 +0000 (18:02 +0900)] 
Merge branch 'jc/am-show-current-patch-docfix'

Doc update.

* jc/am-show-current-patch-docfix:
  doc: am --show-current-patch gives an entire e-mail message

4 years agoMerge branch 'wb/midx-progress'
Junio C Hamano [Sun, 10 Nov 2019 09:02:14 +0000 (18:02 +0900)] 
Merge branch 'wb/midx-progress'

The code to generate multi-pack index learned to show (or not to
show) progress indicators.

* wb/midx-progress:
  multi-pack-index: add [--[no-]progress] option.
  midx: honor the MIDX_PROGRESS flag in midx_repack
  midx: honor the MIDX_PROGRESS flag in verify_midx_file
  midx: add progress to expire_midx_packs
  midx: add progress to write_midx_file
  midx: add MIDX_PROGRESS flag

4 years agoMerge branch 'en/merge-recursive-directory-rename-fixes'
Junio C Hamano [Sun, 10 Nov 2019 09:02:13 +0000 (18:02 +0900)] 
Merge branch 'en/merge-recursive-directory-rename-fixes'

When all files from some subdirectory were renamed to the root
directory, the directory rename heuristics would fail to detect that
as a rename/merge of the subdirectory to the root directory, which has
been corrected.

* en/merge-recursive-directory-rename-fixes:
  t604[236]: do not run setup in separate tests
  merge-recursive: fix merging a subdirectory into the root directory
  merge-recursive: clean up get_renamed_dir_portion()

4 years agoMerge branch 'js/rebase-deprecate-preserve-merges'
Junio C Hamano [Sun, 10 Nov 2019 09:02:13 +0000 (18:02 +0900)] 
Merge branch 'js/rebase-deprecate-preserve-merges'

"git rebase --preserve-merges" has been marked as deprecated; this
release stops advertising it in the "git rebase -h" output.

* js/rebase-deprecate-preserve-merges:
  rebase: hide --preserve-merges option

4 years agoMerge branch 'hv/bitshift-constants-in-blame'
Junio C Hamano [Sun, 10 Nov 2019 09:02:12 +0000 (18:02 +0900)] 
Merge branch 'hv/bitshift-constants-in-blame'

Move the definition of a set of bitmask constants from 0ctal
literal to (1U<<count) notation.

* hv/bitshift-constants-in-blame:
  builtin/blame.c: constants into bit shift format

4 years agoMerge branch 'dd/notes-copy-default-dst-to-head'
Junio C Hamano [Sun, 10 Nov 2019 09:02:12 +0000 (18:02 +0900)] 
Merge branch 'dd/notes-copy-default-dst-to-head'

"git notes copy $original" ought to copy the notes attached to the
original object to HEAD, but a mistaken tightening to command line
parameter validation made earlier disabled that feature by mistake.

* dd/notes-copy-default-dst-to-head:
  notes: fix minimum number of parameters to "copy" subcommand
  t3301: test diagnose messages for too few/many paramters

4 years agoMerge branch 'pw/post-commit-from-sequencer'
Junio C Hamano [Sun, 10 Nov 2019 09:02:12 +0000 (18:02 +0900)] 
Merge branch 'pw/post-commit-from-sequencer'

"rebase -i" ceased to run post-commit hook by mistake in an earlier
update, which has been corrected.

* pw/post-commit-from-sequencer:
  sequencer: run post-commit hook
  move run_commit_hook() to libgit and use it there
  sequencer.h fix placement of #endif
  t3404: remove uneeded calls to set_fake_editor
  t3404: set $EDITOR in subshell
  t3404: remove unnecessary subshell

4 years agoMerge branch 'dl/format-patch-cover-from-desc'
Junio C Hamano [Sun, 10 Nov 2019 09:02:11 +0000 (18:02 +0900)] 
Merge branch 'dl/format-patch-cover-from-desc'

The branch description ("git branch --edit-description") has been
used to fill the body of the cover letters by the format-patch
command; this has been enhanced so that the subject can also be
filled.

* dl/format-patch-cover-from-desc:
  format-patch: teach --cover-from-description option
  format-patch: use enum variables
  format-patch: replace erroneous and condition

4 years agoMerge branch 'es/walken-tutorial'
Junio C Hamano [Sun, 10 Nov 2019 09:02:11 +0000 (18:02 +0900)] 
Merge branch 'es/walken-tutorial'

A tutorial on object enumeration.

* es/walken-tutorial:
  documentation: add tutorial for object walking

4 years agoMerge branch 'jt/fetch-pack-record-refs-in-the-dot-promisor'
Junio C Hamano [Sun, 10 Nov 2019 09:02:10 +0000 (18:02 +0900)] 
Merge branch 'jt/fetch-pack-record-refs-in-the-dot-promisor'

Debugging support for lazy cloning has been a bit improved.

* jt/fetch-pack-record-refs-in-the-dot-promisor:
  fetch-pack: write fetched refs to .promisor

4 years agoGit 2.24 v2.24.0
Junio C Hamano [Mon, 4 Nov 2019 04:32:41 +0000 (13:32 +0900)] 
Git 2.24

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'bc/doc-use-docbook-5'
Junio C Hamano [Mon, 4 Nov 2019 04:33:06 +0000 (13:33 +0900)] 
Merge branch 'bc/doc-use-docbook-5'

Finishing touches to the recent update to the build procedure for
the documentation.

* bc/doc-use-docbook-5:
  manpage-bold-literal.xsl: match for namespaced "d:literal" in template

4 years agoMerge branch 'ds/commit-graph-on-fetch'
Junio C Hamano [Mon, 4 Nov 2019 04:33:06 +0000 (13:33 +0900)] 
Merge branch 'ds/commit-graph-on-fetch'

Regression fix.

* ds/commit-graph-on-fetch:
  commit-graph: fix writing first commit-graph during fetch
  t5510-fetch.sh: demonstrate fetch.writeCommitGraph bug

4 years agoMerge branch 'jt/delay-fetch-if-missing'
Junio C Hamano [Mon, 4 Nov 2019 04:33:05 +0000 (13:33 +0900)] 
Merge branch 'jt/delay-fetch-if-missing'

Work-around a lazy fetch glitch.

* jt/delay-fetch-if-missing:
  fetch: delay fetch_if_missing=0 until after config

4 years agoMerge https://github.com/prati0100/git-gui
Junio C Hamano [Mon, 4 Nov 2019 04:29:38 +0000 (13:29 +0900)] 
Merge https://github.com/prati0100/git-gui

* https://github.com/prati0100/git-gui:
  git-gui: improve Japanese translation
  git-gui: add a readme
  git-gui: support for diff3 conflict style
  git-gui: use existing interface to query a path's attribute
  git-gui (Windows): use git-bash.exe if it is available
  treewide: correct several "up-to-date" to "up to date"
  Fix build with core.autocrlf=true

4 years agoMerge tag 'l10n-2.24.0-rnd2' of https://github.com/git-l10n/git-po
Junio C Hamano [Mon, 4 Nov 2019 04:25:13 +0000 (13:25 +0900)] 
Merge tag 'l10n-2.24.0-rnd2' of https://github.com/git-l10n/git-po

l10n-2.24.0-rnd2

* tag 'l10n-2.24.0-rnd2' of https://github.com/git-l10n/git-po:
  l10n: zh_CN: for git v2.24.0 l10n round 1~2
  l10n: de.po: Update German translation
  l10n: sv.po: Update Swedish translation (4695t0f0u)
  l10n: bg.po: Updated Bulgarian translation (4694)
  l10n: vi(4694t): Updated translation for v2.24.0
  l10n: es: 2.24.0 round 2
  l10n: it.po: update the Italian translation for Git 2.24.0 round #2
  l10n: fr v2.24.0 rnd2
  l10n: git.pot: v2.24.0 round 2 (1 new)
  l10n: it.po: update the Italian translation for Git 2.24.0
  l10n: fr 2.24.0 rnd 1
  l10n: git.pot: v2.24.0 round 1 (35 new, 16 removed)
  l10n: bg.po: Updated Bulgarian translation (4693)
  l10n: sv.po: Update Swedish translation (4674t0f0u)
  l10n: Update Catalan translation

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

Translate 36 new messages (4694t0f0u) for git 2.24.0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agostash: handle staged changes in skip-worktree files correctly
Johannes Schindelin [Wed, 30 Oct 2019 10:49:38 +0000 (10:49 +0000)] 
stash: handle staged changes in skip-worktree files correctly

When calling `git stash` while changes were staged for files that are
marked with the `skip-worktree` bit (e.g. files that are excluded in a
sparse checkout), the files are recorded as _deleted_ instead.

The reason is that `git stash` tries to construct the tree reflecting
the worktree essentially by copying the index to a temporary one and
then updating the files from the worktree. Crucially, it calls `git
diff-index` to update also those files that are in the HEAD but have
been unstaged in the index.

However, when the temporary index is updated via `git update-index --add
--remove`, skip-worktree entries mark the files as deleted by mistake.

Let's use the newly-introduced `--ignore-skip-worktree-entries` option
of `git update-index` to prevent exactly this from happening.

Note that the regression test case deliberately avoids replicating the
scenario described above and instead tries to recreate just the symptom.

Reported by Dan Thompson.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoupdate-index: optionally leave skip-worktree entries alone
Johannes Schindelin [Wed, 30 Oct 2019 10:49:37 +0000 (10:49 +0000)] 
update-index: optionally leave skip-worktree entries alone

While `git update-index` mostly ignores paths referring to index entries
whose skip-worktree bit is set, in b4d1690df11 (Teach Git to respect
skip-worktree bit (reading part), 2009-08-20), for reasons that are not
entirely obvious, the `--remove` option was made special: it _does_
remove index entries even if their skip-worktree bit is set.

Seeing as this behavior has been in place for a decade now, it does not
make sense to change it.

However, in preparation for fixing a bug in `git stash` where it
pretends that skip-worktree entries have actually been removed, we need
a mode where `git update-index` leaves all skip-worktree entries alone,
even if the `--remove` option was passed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoRelNotes/2.24.0: fix self-contradictory note
Elijah Newren [Wed, 30 Oct 2019 20:21:18 +0000 (20:21 +0000)] 
RelNotes/2.24.0: fix self-contradictory note

As per Wikipedia, "In current technical usage, for one to state that a
feature is deprecated is merely a recommendation against using it."  It
is thus contradictory to claim that something is not "officially
deprecated" and then to immediately state that we are both discouraging
its use and pointing people elsewhere.

Signed-off-by: Elijah Newren <newren@gmail.com>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomanpage-bold-literal.xsl: match for namespaced "d:literal" in template
Martin Ågren [Thu, 31 Oct 2019 06:22:27 +0000 (07:22 +0100)] 
manpage-bold-literal.xsl: match for namespaced "d:literal" in template

We recently regressed our rendering with Asciidoctor of "literal"
elements in our manpages, i.e, stuff we have placed within `backticks`
in order to render as monospace. In particular, we lost the bold
rendering of such literal text.

The culprit is f6461b82b9 ("Documentation: fix build with Asciidoctor 2",
2019-09-15), where we switched from DocBook 4.5 to DocBook 5 with
Asciidoctor. As part of the switch, we started using the namespaced
DocBook XSLT stylesheets rather than the non-namespaced ones. (See
f6461b82b9 for more details on why we changed to the namespaced ones.)

The bold literals are implemented as an XSLT snippet <xsl:template
match="literal">...</xsl:template>. Now that we use namespaces, this
doesn't pick up our literals like it used to.

Match for "d:literal" in addition to just "literal", after defining the
d namespace. ("d" is what
http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl
uses.) Note that we need to keep matching without the namespace for
AsciiDoc.

This boldness was introduced by 5121a6d993 ("Documentation: option to
render literal text as bold for manpages", 2009-03-27) and made the
default in 5945717009 ("Documentation: bold literals in man",
2016-05-31).

One reason this was not caught in review is that our doc-diff tool diffs
without any boldness, i.e., it "only" compares text. As pointed out by
Peff in review of this patch, one can use `MAN_KEEP_FORMATTING=1
./doc-diff <...>`

This has been optically tested with AsciiDoc 8.6.10, Asciidoctor 1.5.5
and Asciidoctor 2.0.10. I've also verified that doc-diff produces the
empty output for all three programs, as expected, and that with the
MAN_KEEP_FORMATTING trick, AsciiDoc yields no diff, whereas with
Asciidoctor, we get bold literals, just like we want.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Acked-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoRelNotes/2.24.0: typofix
Elijah Newren [Wed, 30 Oct 2019 20:21:17 +0000 (20:21 +0000)] 
RelNotes/2.24.0: typofix

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: de.po: Update German translation
Matthias Rüster [Wed, 23 Oct 2019 17:13:19 +0000 (19:13 +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 agol10n: sv.po: Update Swedish translation (4695t0f0u)
Peter Krefting [Wed, 30 Oct 2019 22:22:13 +0000 (23:22 +0100)] 
l10n: sv.po: Update Swedish translation (4695t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
4 years agoGit 2.24-rc2 v2.24.0-rc2
Junio C Hamano [Wed, 30 Oct 2019 06:12:53 +0000 (15:12 +0900)] 
Git 2.24-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'wb/fsmonitor-bitmap-fix'
Junio C Hamano [Wed, 30 Oct 2019 06:13:13 +0000 (15:13 +0900)] 
Merge branch 'wb/fsmonitor-bitmap-fix'

Comment update.

* wb/fsmonitor-bitmap-fix:
  t7519-status-fsmonitor: improve comments

4 years agoMerge branch 'rl/gitweb-blame-prev-fix'
Junio C Hamano [Wed, 30 Oct 2019 06:13:13 +0000 (15:13 +0900)] 
Merge branch 'rl/gitweb-blame-prev-fix'

Fix a rather old bug in gitweb---incremental blame output in
javascript actions mode never worked.

* rl/gitweb-blame-prev-fix:
  gitweb: correctly store previous rev in javascript-actions mode

4 years agoMerge branch 'js/mingw-needs-hiding-fix'
Junio C Hamano [Wed, 30 Oct 2019 06:13:13 +0000 (15:13 +0900)] 
Merge branch 'js/mingw-needs-hiding-fix'

Fix for a (rather old) buffer-overrun bug.

* js/mingw-needs-hiding-fix:
  mingw: avoid a buffer overrun in `needs_hiding()`

4 years agoMerge branch 'master' of github.com:vnwildman/git
Jiang Xin [Wed, 30 Oct 2019 06:07:58 +0000 (14:07 +0800)] 
Merge branch 'master' of github.com:vnwildman/git

* 'master' of github.com:vnwildman/git:
  l10n: vi(4694t): Updated translation for v2.24.0

4 years agoMerge branch 'next' of github.com:ChrisADR/git-po
Jiang Xin [Wed, 30 Oct 2019 06:02:22 +0000 (14:02 +0800)] 
Merge branch 'next' of github.com:ChrisADR/git-po

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

4 years agot7519-status-fsmonitor: improve comments
William Baker [Wed, 16 Oct 2019 19:35:47 +0000 (19:35 +0000)] 
t7519-status-fsmonitor: improve comments

The comments for the staging/unstaging test did not accurately
describe the scenario being tested.  It is not essential that
the test files being staged/unstaged appear at the end of the
index.  All that is required is that the test files are not
flagged with CE_FSMONITOR_VALID and have a position in the
index greater than the number of entries in the index after
unstaging.

The comment for this test has been updated to be more
accurate with respect to the scenario that's being tested.

Signed-off-by: William Baker <William.Baker@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopretty: add "%aL" etc. to show local-part of email addresses
Prarit Bhargava [Tue, 29 Oct 2019 12:09:14 +0000 (08:09 -0400)] 
pretty: add "%aL" etc. to show local-part of email addresses

In many projects the number of contributors is low enough that users know
each other and the full email address doesn't need to be displayed.
Displaying only the author's username saves a lot of columns on the screen.

Existing 'e/E' (as in "%ae" and "%aE") placeholders would show the
author's address as "prarit@redhat.com", which would waste columns to show
the same domain-part for all contributors when used in a project internal
to redhat.  Introduce 'l/L' placeholders that strip '@' and domain part from
the e-mail address.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: bg.po: Updated Bulgarian translation (4694)
Alexander Shopov [Tue, 29 Oct 2019 10:37:45 +0000 (11:37 +0100)] 
l10n: bg.po: Updated Bulgarian translation (4694)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
4 years agol10n: vi(4694t): Updated translation for v2.24.0
Tran Ngoc Quan [Tue, 29 Oct 2019 07:38:42 +0000 (14:38 +0700)] 
l10n: vi(4694t): Updated translation for v2.24.0

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
4 years agol10n: es: 2.24.0 round 2
Christopher Diaz Riveros [Sun, 15 Sep 2019 21:56:56 +0000 (23:56 +0200)] 
l10n: es: 2.24.0 round 2

Signed-off-by: Christopher Diaz Riveros <christopher.diaz.riv@gmail.com>
4 years agoMerge branch 'l10n/it/update-italian-translation'
Jiang Xin [Mon, 28 Oct 2019 23:27:51 +0000 (07:27 +0800)] 
Merge branch 'l10n/it/update-italian-translation'

* 'update-italian-translation' of github.com:AlessandroMenti/git-po:
  l10n: it.po: update the Italian translation for Git 2.24.0 round #2

4 years agol10n: it.po: update the Italian translation for Git 2.24.0 round #2
Alessandro Menti [Mon, 28 Oct 2019 19:44:05 +0000 (20:44 +0100)] 
l10n: it.po: update the Italian translation for Git 2.24.0 round #2

Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
4 years agol10n: fr v2.24.0 rnd2
Jean-Noël Avila [Mon, 28 Oct 2019 19:36:01 +0000 (20:36 +0100)] 
l10n: fr v2.24.0 rnd2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
4 years agol10n: git.pot: v2.24.0 round 2 (1 new)
Jiang Xin [Mon, 28 Oct 2019 05:16:31 +0000 (13:16 +0800)] 
l10n: git.pot: v2.24.0 round 2 (1 new)

Generate po/git.pot from v2.24.0-rc1 for git v2.24.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agoMerge tag 'v2.24.0-rc1' of github.com:git/git into master
Jiang Xin [Mon, 28 Oct 2019 05:18:55 +0000 (13:18 +0800)] 
Merge tag 'v2.24.0-rc1' of github.com:git/git into master

Git 2.24-rc1

* tag 'v2.24.0-rc1' of github.com:git/git:
  Git 2.24-rc1
  repo-settings: read an int for index.version
  ci: fix GCC install in the Travis CI GCC OSX job
  Eleventh batch
  ci(osx): use new location of the `perforce` cask
  t7419: change test_must_fail to ! for grep
  t4014: make output-directory tests self-contained
  ci(visual-studio): actually run the tests in parallel
  ci(visual-studio): use strict compile flags, and optimization
  userdiff: fix some corner cases in dts regex
  test-progress: fix test failures on big-endian systems
  completion: clarify installation instruction for zsh
  grep: avoid leak of chartables in PCRE2
  grep: make PCRE2 aware of custom allocator
  grep: make PCRE1 aware of custom allocator
  remote-curl: pass on atomic capability to remote side
  diff-highlight: fix a whitespace nit
  fsmonitor: don't fill bitmap with entries to be removed

4 years agomingw: avoid a buffer overrun in `needs_hiding()`
Johannes Schindelin [Fri, 25 Oct 2019 14:13:36 +0000 (14:13 +0000)] 
mingw: avoid a buffer overrun in `needs_hiding()`

When this function is passed a path with a trailing slash, it runs right
over the end of that path.

Let's fix this.

Co-authored-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agobuiltin/commit-graph.c: remove subcommand-less usage string
SZEDER Gábor [Fri, 25 Oct 2019 16:49:09 +0000 (18:49 +0200)] 
builtin/commit-graph.c: remove subcommand-less usage string

The first line in 'git commit-graph's usage string indicates that this
command can be invoked without specifying a subcommand.  However, this
is not the case:

  $ git commit-graph
  usage: git commit-graph [--object-dir <objdir>]
     or: git commit-graph read [--object-dir <objdir>]
  [...]
  $ echo $?
  129

Remove this line from the usage string.

The synopsis in the manpage doesn't contain this line.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agogitweb: correctly store previous rev in javascript-actions mode
Robert Luberda [Sun, 27 Oct 2019 09:14:26 +0000 (10:14 +0100)] 
gitweb: correctly store previous rev in javascript-actions mode

Without this change, the setting

 $feature{'javascript-actions'}{'default'} = [1];

in gitweb.conf breaks gitweb's blame page: clicking on line numbers
displayed in the second column on the page has no effect.

For comparison, with javascript-actions disabled, clicking on line
numbers loads the previous version of the line.

Addresses https://bugs.debian.org/741883.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Robert Luberda <robert@debian.org>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot4203: use test-lib.sh definitions
Prarit Bhargava [Thu, 24 Oct 2019 23:36:16 +0000 (19:36 -0400)] 
t4203: use test-lib.sh definitions

Use name and email definitions from test-lib.sh.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot6006: use test-lib.sh definitions
Prarit Bhargava [Thu, 24 Oct 2019 23:36:15 +0000 (19:36 -0400)] 
t6006: use test-lib.sh definitions

Use name and email definitions from test-lib.sh.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: fix writing first commit-graph during fetch
Derrick Stolee [Thu, 24 Oct 2019 13:40:42 +0000 (13:40 +0000)] 
commit-graph: fix writing first commit-graph during fetch

The previous commit includes a failing test for an issue around
fetch.writeCommitGraph and fetching in a repo with a submodule. Here, we
fix that bug and set the test to "test_expect_success".

The problem arises with this set of commands when the remote repo at
<url> has a submodule. Note that --recurse-submodules is not needed to
demonstrate the bug.

$ git clone <url> test
$ cd test
$ git -c fetch.writeCommitGraph=true fetch origin
Computing commit graph generation numbers: 100% (12/12), done.
BUG: commit-graph.c:886: missing parent <hash1> for commit <hash2>
Aborted (core dumped)

As an initial fix, I converted the code in builtin/fetch.c that calls
write_commit_graph_reachable() to instead launch a "git commit-graph
write --reachable --split" process. That code worked, but is not how we
want the feature to work long-term.

That test did demonstrate that the issue must be something to do with
internal state of the 'git fetch' process.

The write_commit_graph() method in commit-graph.c ensures the commits we
plan to write are "closed under reachability" using close_reachable().
This method walks from the input commits, and uses the UNINTERESTING
flag to mark which commits have already been visited. This allows the
walk to take O(N) time, where N is the number of commits, instead of
O(P) time, where P is the number of paths. (The number of paths can be
exponential in the number of commits.)

However, the UNINTERESTING flag is used in lots of places in the
codebase. This flag usually means some barrier to stop a commit walk,
such as in revision-walking to compare histories. It is not often
cleared after the walk completes because the starting points of those
walks do not have the UNINTERESTING flag, and clear_commit_marks() would
stop immediately.

This is happening during a 'git fetch' call with a remote. The fetch
negotiation is comparing the remote refs with the local refs and marking
some commits as UNINTERESTING.

I tested running clear_commit_marks_many() to clear the UNINTERESTING
flag inside close_reachable(), but the tips did not have the flag, so
that did nothing.

It turns out that the calculate_changed_submodule_paths() method is at
fault. Thanks, Peff, for pointing out this detail! More specifically,
for each submodule, the collect_changed_submodules() runs a revision
walk to essentially do file-history on the list of submodules. That
revision walk marks commits UNININTERESTING if they are simplified away
by not changing the submodule.

Instead, I finally arrived on the conclusion that I should use a flag
that is not used in any other part of the code. In commit-reach.c, a
number of flags were defined for commit walk algorithms. The REACHABLE
flag seemed like it made the most sense, and it seems it was not
actually used in the file. The REACHABLE flag was used in early versions
of commit-reach.c, but was removed by 4fbcca4 (commit-reach: make
can_all_from_reach... linear, 2018-07-20).

Add the REACHABLE flag to commit-graph.c and use it instead of
UNINTERESTING in close_reachable(). This fixes the bug in manual
testing.

Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Helped-by: Jeff King <peff@peff.net>
Helped-by: Szeder Gábor <szeder.dev@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5510-fetch.sh: demonstrate fetch.writeCommitGraph bug
Derrick Stolee [Thu, 24 Oct 2019 13:40:41 +0000 (13:40 +0000)] 
t5510-fetch.sh: demonstrate fetch.writeCommitGraph bug

While dogfooding, Johannes found a bug in the fetch.writeCommitGraph
config behavior. His example initially happened during a clone with
--recurse-submodules, we found that this happens with the first fetch
after cloning a repository that contains a submodule:

$ git clone <url> test
$ cd test
$ git -c fetch.writeCommitGraph=true fetch origin
Computing commit graph generation numbers: 100% (12/12), done.
BUG: commit-graph.c:886: missing parent <hash1> for commit <hash2>
Aborted (core dumped)

In the repo I had cloned, there were really 60 commits to scan, but
only 12 were in the list to write when calling
compute_generation_numbers(). A commit in the list expects to see a
parent, but that parent is not in the list.

A follow-up will fix the bug, but first we create a test that
demonstrates the problem. This test must be careful about an existing
commit-graph file, since GIT_TEST_COMMIT_GRAPH=1 will cause the repo we
are cloning to already have one. This then prevents the incremtnal
commit-graph write during the first 'git fetch'.

Helped-by: Jeff King <peff@peff.net>
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Helped-by: Szeder Gábor <szeder.dev@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodocumentation: remove empty doc files
Heba Waly [Thu, 24 Oct 2019 11:29:11 +0000 (11:29 +0000)] 
documentation: remove empty doc files

Remove empty and redundant documentation files from the
Documentation/technical/ directory.

The empty doc files included only TODO messages with no documentation for
years. Instead an approach is being taken to keep all doc beside the code
in the relevant header files.
Having empty doc files is confusing and disappointing to anybody looking
for information, besides having the documentation in header files makes it
easier for developers to find the information they are looking for.

Some of the content which could have gone here already exists elsewhere:
- api-object-access.txt -> sha1-file.c and object.h have some details.
- api-quote.txt -> quote.h has some details.
- api-xdiff-interface.txt -> xdiff-interface.h has some details.
- api-grep.txt -> grep.h does not have enough documentation at the moment.

Signed-off-by: Heba Waly <heba.waly@gmail.com>
Reviewed-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.24-rc1 v2.24.0-rc1
Junio C Hamano [Thu, 24 Oct 2019 04:33:49 +0000 (13:33 +0900)] 
Git 2.24-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'sg/ci-osx-gcc8-fix'
Junio C Hamano [Thu, 24 Oct 2019 04:34:03 +0000 (13:34 +0900)] 
Merge branch 'sg/ci-osx-gcc8-fix'

CI build fix.

* sg/ci-osx-gcc8-fix:
  ci: fix GCC install in the Travis CI GCC OSX job

4 years agoMerge branch 'ds/feature-macros'
Junio C Hamano [Thu, 24 Oct 2019 04:34:02 +0000 (13:34 +0900)] 
Merge branch 'ds/feature-macros'

The codepath that reads the index.version configuration was broken
with a recent update, which has been corrected.

* ds/feature-macros:
  repo-settings: read an int for index.version

4 years agoMerge branch 'js/azure-ci-osx-fix'
Junio C Hamano [Thu, 24 Oct 2019 04:34:02 +0000 (13:34 +0900)] 
Merge branch 'js/azure-ci-osx-fix'

Update installation procedure for Perforce on MacOS in the CI jobs
running on Azure pipelines, which was failing.

* js/azure-ci-osx-fix:
  ci(osx): use new location of the `perforce` cask

4 years agoMerge branch 'bw/format-patch-o-create-leading-dirs'
Junio C Hamano [Thu, 24 Oct 2019 04:34:02 +0000 (13:34 +0900)] 
Merge branch 'bw/format-patch-o-create-leading-dirs'

Test update.

* bw/format-patch-o-create-leading-dirs:
  t4014: make output-directory tests self-contained

4 years agoMerge branch 'dl/submodule-set-branch'
Junio C Hamano [Thu, 24 Oct 2019 04:34:02 +0000 (13:34 +0900)] 
Merge branch 'dl/submodule-set-branch'

Test update.

* dl/submodule-set-branch:
  t7419: change test_must_fail to ! for grep

4 years agofetch: delay fetch_if_missing=0 until after config
Jonathan Tan [Wed, 23 Oct 2019 23:34:03 +0000 (16:34 -0700)] 
fetch: delay fetch_if_missing=0 until after config

Suppose, from a repository that has ".gitmodules", we clone with
--filter=blob:none:

  git clone --filter=blob:none --no-checkout \
    https://kernel.googlesource.com/pub/scm/git/git

Then we fetch:

  git -C git fetch

This will cause a "unable to load config blob object", because the
fetch_config_from_gitmodules() invocation in cmd_fetch() will attempt to
load ".gitmodules" (which Git knows to exist because the client has the
tree of HEAD) while fetch_if_missing is set to 0.

fetch_if_missing is set to 0 too early - ".gitmodules" here should be
lazily fetched.  Git must set fetch_if_missing to 0 before the fetch
because as part of the fetch, packfile negotiation happens (and we do
not want to fetch any missing objects when checking existence of
objects), but we do not need to set it so early. Move the setting of
fetch_if_missing to the earliest possible point in cmd_fetch(), right
before any fetching happens.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorepo-settings: read an int for index.version
Derrick Stolee [Wed, 23 Oct 2019 20:38:57 +0000 (20:38 +0000)] 
repo-settings: read an int for index.version

Several config options were combined into a repo_settings struct in
ds/feature-macros, including a move of the "index.version" config
setting in 7211b9e (repo-settings: consolidate some config settings,
2019-08-13).

Unfortunately, that file looked like a lot of boilerplate and what is
clearly a factor of copy-paste overload, the config setting is parsed
with repo_config_ge_bool() instead of repo_config_get_int(). This means
that a setting "index.version=4" would not register correctly and would
revert to the default version of 3.

I caught this while incorporating v2.24.0-rc0 into the VFS for Git
codebase, where we really care that the index is in version 4.

This was not caught by the codebase because the version checks placed
in t1600-index.sh did not test the "basic" scenario enough. Here, we
modify the test to include these normal settings to not be overridden by
features.manyFiles or GIT_INDEX_VERSION. While the "default" version is
3, this is demoted to version 2 in do_write_index() when not necessary.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoapply: respect merge.conflictStyle in --3way
Denton Liu [Wed, 23 Oct 2019 23:32:38 +0000 (16:32 -0700)] 
apply: respect merge.conflictStyle in --3way

Before, when doing a 3-way merge, the merge.conflictStyle option was not
respected and the "merge" style was always used, even if "diff3" was
specified.

Call git_xmerge_config() at the end of git_apply_config() so that the
merge.conflictStyle config is read.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot4108: demonstrate bug in apply
Denton Liu [Wed, 23 Oct 2019 23:32:36 +0000 (16:32 -0700)] 
t4108: demonstrate bug in apply

Currently, apply does not respect the merge.conflictStyle setting.
Demonstrate this by making the 'apply with --3way' test case generic and
extending it to show that the configuration of
merge.conflictStyle = diff3 causes a breakage.

Change print_sanitized_conflicted_diff() to also sanitize `|||||||`
conflict markers.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot4108: use `test_config` instead of `git config`
Denton Liu [Wed, 23 Oct 2019 23:32:33 +0000 (16:32 -0700)] 
t4108: use `test_config` instead of `git config`

Since `git config` leaves the configurations set even after the test
case completes, use `test_config` instead so that the configurations are
reset once the test case finishes.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot4108: remove git command upstream of pipe
Denton Liu [Wed, 23 Oct 2019 23:32:31 +0000 (16:32 -0700)] 
t4108: remove git command upstream of pipe

Before, the output of `git diff HEAD` would always be piped to
sanitize_conflicted_diff(). However, since the Git command was upstream
of the pipe, in case the Git command fails, the return code would be
lost. Rewrite into separate statements so that the return code is no
longer lost.

Since only the command `git diff HEAD` was being piped to
sanitize_conflicted_diff(), move the command into the function and rename
it to print_sanitized_conflicted_diff().

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot4108: replace create_file with test_write_lines
Denton Liu [Wed, 23 Oct 2019 23:32:28 +0000 (16:32 -0700)] 
t4108: replace create_file with test_write_lines

Since the locally defined create_file() duplicates the functionality of
the test_write_lines() helper function, remove create_file() and replace
all instances with test_write_lines(). While we're at it, move
redirection operators to the end of the command which is the more
conventional place to put it.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoci: fix GCC install in the Travis CI GCC OSX job
SZEDER Gábor [Thu, 24 Oct 2019 00:20:40 +0000 (02:20 +0200)] 
ci: fix GCC install in the Travis CI GCC OSX job

A few days ago Travis CI updated their existing OSX images, including
the Homebrew database in the xcode10.1 OSX image that we use.  Since
then installing dependencies in the 'osx-gcc' job fails when it tries
to link gcc@8:

  + brew link gcc@8
  Error: No such keg: /usr/local/Cellar/gcc@8

GCC8 is still installed but not linked to '/usr/local' in the updated
image, as it was before this update, but now we have to link it by
running 'brew link gcc'.  So let's do that then, and fall back to
linking gcc@8 if it doesn't, just to be sure.

Our builds on Azure Pipelines are unaffected by this issue.  The OSX
image over there doesn't contain the gcc@8 package, so we have to
'brew install' it, which already takes care of linking it to
'/usr/local'.  After that the 'brew link gcc' command added by this
patch fails, but the ||-chained fallback 'brew link gcc@8' command
succeeds with an "already linked" warning.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoEleventh batch
Junio C Hamano [Wed, 23 Oct 2019 05:42:27 +0000 (14:42 +0900)] 
Eleventh batch

The tenth was at -rc0 ;-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'cb/pcre2-chartables-leakfix'
Junio C Hamano [Wed, 23 Oct 2019 05:43:11 +0000 (14:43 +0900)] 
Merge branch 'cb/pcre2-chartables-leakfix'

Leakfix.

* cb/pcre2-chartables-leakfix:
  grep: avoid leak of chartables in PCRE2
  grep: make PCRE2 aware of custom allocator
  grep: make PCRE1 aware of custom allocator

4 years agoMerge branch 'bc/smart-http-atomic-push'
Junio C Hamano [Wed, 23 Oct 2019 05:43:11 +0000 (14:43 +0900)] 
Merge branch 'bc/smart-http-atomic-push'

The atomic push over smart HTTP transport did not work, which has
been corrected.

* bc/smart-http-atomic-push:
  remote-curl: pass on atomic capability to remote side

4 years agoMerge branch 'wb/fsmonitor-bitmap-fix'
Junio C Hamano [Wed, 23 Oct 2019 05:43:10 +0000 (14:43 +0900)] 
Merge branch 'wb/fsmonitor-bitmap-fix'

A segfault fix.

* wb/fsmonitor-bitmap-fix:
  fsmonitor: don't fill bitmap with entries to be removed

4 years agoMerge branch 'sb/userdiff-dts'
Junio C Hamano [Wed, 23 Oct 2019 05:43:10 +0000 (14:43 +0900)] 
Merge branch 'sb/userdiff-dts'

Tweak userdiff patterns for dts.

* sb/userdiff-dts:
  userdiff: fix some corner cases in dts regex

4 years agoMerge branch 'sg/progress-fix'
Junio C Hamano [Wed, 23 Oct 2019 05:43:09 +0000 (14:43 +0900)] 
Merge branch 'sg/progress-fix'

Byte-order fix the recent update to progress display code.

* sg/progress-fix:
  test-progress: fix test failures on big-endian systems

4 years agoMerge branch 'nr/diff-highlight-indent-fix'
Junio C Hamano [Wed, 23 Oct 2019 05:43:09 +0000 (14:43 +0900)] 
Merge branch 'nr/diff-highlight-indent-fix'

Code cleanup.

* nr/diff-highlight-indent-fix:
  diff-highlight: fix a whitespace nit

4 years agoMerge branch 'mb/clarify-zsh-completion-doc'
Junio C Hamano [Wed, 23 Oct 2019 05:43:09 +0000 (14:43 +0900)] 
Merge branch 'mb/clarify-zsh-completion-doc'

The installation instruction for zsh completion script (in
contrib/) has been a bit improved.

* mb/clarify-zsh-completion-doc:
  completion: clarify installation instruction for zsh

4 years agopath.c: don't call the match function without value in trie_find()
SZEDER Gábor [Mon, 21 Oct 2019 16:00:43 +0000 (18:00 +0200)] 
path.c: don't call the match function without value in trie_find()

'logs/refs' is not a working tree-specific path, but since commit
b9317d55a3 (Make sure refs/rewritten/ is per-worktree, 2019-03-07)
'git rev-parse --git-path' has been returning a bogus path if a
trailing '/' is present:

  $ git -C WT/ rev-parse --git-path logs/refs --git-path logs/refs/
  /home/szeder/src/git/.git/logs/refs
  /home/szeder/src/git/.git/worktrees/WT/logs/refs/

We use a trie data structure to efficiently decide whether a path
belongs to the common dir or is working tree-specific.  As it happens
b9317d55a3 triggered a bug that is as old as the trie implementation
itself, added in 4e09cf2acf (path: optimize common dir checking,
2015-08-31).

  - According to the comment describing trie_find(), it should only
    call the given match function 'fn' for a "/-or-\0-terminated
    prefix of the key for which the trie contains a value".  This is
    not true: there are three places where trie_find() calls the match
    function, but one of them is missing the check for value's
    existence.

  - b9317d55a3 added two new keys to the trie: 'logs/refs/rewritten'
    and 'logs/refs/worktree', next to the already existing
    'logs/refs/bisect'.  This resulted in a trie node with the path
    'logs/refs/', which didn't exist before, and which doesn't have a
    value attached.  A query for 'logs/refs/' finds this node and then
    hits that one callsite of the match function which doesn't check
    for the value's existence, and thus invokes the match function
    with NULL as value.

  - When the match function check_common() is invoked with a NULL
    value, it returns 0, which indicates that the queried path doesn't
    belong to the common directory, ultimately resulting the bogus
    path shown above.

Add the missing condition to trie_find() so it will never invoke the
match function with a non-existing value.  check_common() will then no
longer have to check that it got a non-NULL value, so remove that
condition.

I believe that there are no other paths that could cause similar bogus
output.  AFAICT the only other key resulting in the match function
being called with a NULL value is 'co' (because of the keys 'common'
and 'config').  However, as they are not in a directory that belongs
to the common directory the resulting working tree-specific path is
expected.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopath.c: clarify two field names in 'struct common_dir'
SZEDER Gábor [Mon, 21 Oct 2019 16:00:42 +0000 (18:00 +0200)] 
path.c: clarify two field names in 'struct common_dir'

An array of 'struct common_dir' instances is used to specify whether
various paths in $GIT_DIR are specific to a worktree, or are common,
i.e. belong to main worktree.  The names of two fields in this
struct are somewhat confusing or ambigious:

  - The path is recorded in the struct's 'dirname' field, even though
    several entries are regular files e.g. 'gc.pid', 'packed-refs',
    etc.

    Rename this field to 'path' to reduce confusion.

  - The field 'exclude' tells whether the path is excluded...  from
    where?  Excluded from the common dir or from the worktree?  It
    means the former, but it's ambigious.

    Rename this field to 'is_common' to make it unambigious what it
    means.  This, however, means the exact opposite of what 'exclude'
    meant, so we have to negate the field's value in all entries as
    well.

The diff is best viewed with '--color-words'.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopath.c: mark 'logs/HEAD' in 'common_list' as file
SZEDER Gábor [Mon, 21 Oct 2019 16:00:41 +0000 (18:00 +0200)] 
path.c: mark 'logs/HEAD' in 'common_list' as file

'logs/HEAD', i.e. HEAD's reflog, is a file, but its entry in
'common_list' has the 'is_dir' bit set.

Unset that bit to make it consistent with what 'logs/HEAD' is supposed
to be.

This doesn't make a difference in behavior: check_common() is the only
function that looks at the 'is_dir' bit, and that function either
returns 0, or '!exclude', which for 'logs/HEAD' results in 0 as well.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopath.c: clarify trie_find()'s in-code comment
SZEDER Gábor [Mon, 21 Oct 2019 16:00:40 +0000 (18:00 +0200)] 
path.c: clarify trie_find()'s in-code comment

A fairly long comment describes trie_find()'s behavior and shows
examples, but it's slightly incomplete/inaccurate.  Update this
comment to specify how trie_find() handles a negative return value
from the given match function.

Furthermore, update the list of examples to include not only two but
three levels of path components.  This makes the examples slightly
more complicated, but it can illustrate the behavior in more corner
cases.

Finally, basically everything refers to the data stored for a key as
"value", with two confusing exceptions:

  - The type definition of the match function calls its corresponding
    parameter 'data'.
    Rename that parameter to 'value'.  (check_common(), the only
    function of this type already calls it 'value').

  - The table of examples above trie_find() has a "val from node"
    column, which has nothing to do with the value stored in the trie:
    it's a "prefix of the key for which the trie contains a value"
    that led to that node.
    Rename that column header to "prefix to node".

Note that neither the original nor the updated description and
examples correspond 100% to the current implementation, because the
implementation is a bit buggy, but the comment describes the desired
behavior.  The bug will be fixed in the last patch of this series.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoDocumentation: mention more worktree-specific exceptions
SZEDER Gábor [Mon, 21 Oct 2019 16:00:39 +0000 (18:00 +0200)] 
Documentation: mention more worktree-specific exceptions

If a directory in $GIT_DIR is overridden when $GIT_COMMON_DIR is set,
then usually all paths within that directory are overridden as well.
There are a couple of exceptions, though, and two of them, namely
'refs/rewritten' and 'logs/HEAD' are not mentioned in
'gitrepository-layout'.  Document them as well.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomulti-pack-index: add [--[no-]progress] option.
William Baker [Mon, 21 Oct 2019 18:40:03 +0000 (18:40 +0000)] 
multi-pack-index: add [--[no-]progress] option.

Add the --[no-]progress option to git multi-pack-index.
Pass the MIDX_PROGRESS flag to the subcommand functions
when progress should be displayed by multi-pack-index.
The progress feature was added to 'verify' in 144d703
("multi-pack-index: report progress during 'verify'", 2018-09-13)
but some subcommands were not updated to display progress, and
the ability to opt-out was overlooked.

Signed-off-by: William Baker <William.Baker@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomidx: honor the MIDX_PROGRESS flag in midx_repack
William Baker [Mon, 21 Oct 2019 18:40:02 +0000 (18:40 +0000)] 
midx: honor the MIDX_PROGRESS flag in midx_repack

Update midx_repack to only display progress when
the MIDX_PROGRESS flag is set.

Signed-off-by: William Baker <William.Baker@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomidx: honor the MIDX_PROGRESS flag in verify_midx_file
William Baker [Mon, 21 Oct 2019 18:40:01 +0000 (18:40 +0000)] 
midx: honor the MIDX_PROGRESS flag in verify_midx_file

Update verify_midx_file to only display progress when
the MIDX_PROGRESS flag is set.

Signed-off-by: William Baker <William.Baker@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomidx: add progress to expire_midx_packs
William Baker [Mon, 21 Oct 2019 18:40:00 +0000 (18:40 +0000)] 
midx: add progress to expire_midx_packs

Add progress to expire_midx_packs.  Progress is
displayed when the MIDX_PROGRESS flag is set.

Signed-off-by: William Baker <William.Baker@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomidx: add progress to write_midx_file
William Baker [Mon, 21 Oct 2019 18:39:59 +0000 (18:39 +0000)] 
midx: add progress to write_midx_file

Add progress to write_midx_file.  Progress is displayed
when the MIDX_PROGRESS flag is set.

Signed-off-by: William Baker <William.Baker@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomidx: add MIDX_PROGRESS flag
William Baker [Mon, 21 Oct 2019 18:39:58 +0000 (18:39 +0000)] 
midx: add MIDX_PROGRESS flag

Add the MIDX_PROGRESS flag and update the
write|verify|expire|repack functions in midx.h
to accept a flags parameter.  The MIDX_PROGRESS
flag indicates whether the caller of the function
would like progress information to be displayed.
This patch only changes the method prototypes
and does not change the functionality. The
functionality change will be handled by a later patch.

Signed-off-by: William Baker <William.Baker@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoci(osx): use new location of the `perforce` cask
Johannes Schindelin [Wed, 23 Oct 2019 00:19:38 +0000 (00:19 +0000)] 
ci(osx): use new location of the `perforce` cask

The Azure Pipelines builds are failing for macOS due to a change in the
location of the perforce cask. The command outputs the following error:

    + brew install caskroom/cask/perforce
    Error: caskroom/cask was moved. Tap homebrew/cask-cask instead.

So let's try to call `brew cask install perforce` first (which is what
that error message suggests, in a most round-about way).

Prior to 672f51cb we used to install the 'perforce' package with 'brew
install perforce' (note: no 'cask' in there). The justification for
672f51cb was that the command 'brew install perforce' simply stopped
working, after Homebrew folks decided that it's better to move the
'perforce' package to a "cask". Their justification for this move was
that 'brew install perforce' "can fail due to a checksum mismatch ...",
and casks can be installed without checksum verification. And indeed,
both 'brew cask install perforce' and 'brew install
caskroom/cask/perforce' printed something along the lines of:

  ==> No checksum defined for Cask perforce, skipping verification

It is unclear why 672f51cb used 'brew install caskroom/cask/perforce'
instead of 'brew cask install perforce'. It appears (by running both
commands on old Travis CI macOS images) that both commands worked all
the same already back then.

In any case, as the error message at the top of this commit message
shows, 'brew install caskroom/cask/perforce' has stopped working
recently, but 'brew cask install perforce' still does, so let's use
that.

CI servers are typically fresh virtual machines, but not always. To
accommodate for that, let's try harder if `brew cask install perforce`
fails, by specifically pulling the latest `master` of the
`homebrew-cask` repository.

This will still fail, of course, when `homebrew-cask` falls behind
Perforce's release schedule. But once it is updated, we can now simply
re-run the failed jobs and they will pick up that update.

As for updating `homebrew-cask`: the beginnings of automating this in
https://dev.azure.com/gitgitgadget/git/_build?definitionId=11&_a=summary
will be finished once the next Perforce upgrade comes around.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot604[236]: do not run setup in separate tests
Elijah Newren [Tue, 22 Oct 2019 21:22:51 +0000 (21:22 +0000)] 
t604[236]: do not run setup in separate tests

Transform the setup "tests" to setup functions, and have the actual
tests call the setup functions.  Advantages:

  * Should make life easier for people working with webby CI/PR builds
    who have to abuse mice (and their own index finger as well) in
    order to switch from viewing one testcase to another.  Sounds
    awful; hopefully this will improve things for them.

  * Improves re-runnability: any failed test in any of these three
    files can now be re-run in isolation, e.g.
       ./t6042* --ver --imm -x --run=21
    whereas before it would require two tests to be specified to the
    --run argument, the other needing to be picked out as the relevant
    setup test from one or two tests before.

  * Importantly, this still keeps the "setup" and "test" sections
    somewhat separate to make it easier for readers to discern what is
    just ancillary setup and what the intent of the test is.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: fix merging a subdirectory into the root directory
Elijah Newren [Tue, 22 Oct 2019 21:22:50 +0000 (21:22 +0000)] 
merge-recursive: fix merging a subdirectory into the root directory

We allow renaming all entries in e.g. a directory named z/ into a
directory named y/ to be detected as a z/ -> y/ rename, so that if the
other side of history adds any files to the directory z/ in the mean
time, we can provide the hint that they should be moved to y/.

There is no reason to not allow 'y/' to be the root directory, but the
code did not handle that case correctly.  Add a testcase and the
necessary special checks to support this case.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: clean up get_renamed_dir_portion()
Elijah Newren [Tue, 22 Oct 2019 21:22:49 +0000 (21:22 +0000)] 
merge-recursive: clean up get_renamed_dir_portion()

Dscho noted a few things making this function hard to follow.
Restructure it a bit and add comments to make it easier to follow.  The
restructurings include:

  * There was a special case if-check at the end of the function
    checking whether someone just renamed a file within its original
    directory, meaning that there could be no directory rename involved.
    That check was slightly convoluted; it could be done in a more
    straightforward fashion earlier in the function, and can be done
    more cheaply too (no call to strncmp).

  * The conditions for advancing end_of_old and end_of_new before
    calling strchr were both confusing and unnecessary.  If either
    points at a '/', then they need to be advanced in order to find the
    next '/'.  If either doesn't point at a '/', then advancing them one
    char before calling strchr() doesn't hurt.  So, just rip out the
    if conditions and advance both before calling strchr().

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodoc: am --show-current-patch gives an entire e-mail message
Junio C Hamano [Wed, 23 Oct 2019 02:26:37 +0000 (11:26 +0900)] 
doc: am --show-current-patch gives an entire e-mail message

The existing wording gives an impression that it only gives the
contents of the $GIT_DIR/rebase-apply/patch file, i.e. the patch
proper, but the option actually emits the entire e-mail message
being processed (iow, one of the output files from "git mailsplit").

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot7419: change test_must_fail to ! for grep
Denton Liu [Tue, 22 Oct 2019 09:57:01 +0000 (02:57 -0700)] 
t7419: change test_must_fail to ! for grep

According to t/README, test_must_fail() should only be used to test for
failure in Git commands. Replace the invocations of
`test_must_fail grep` with `! grep`.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot4014: make output-directory tests self-contained
Bert Wesarg [Mon, 21 Oct 2019 13:23:42 +0000 (15:23 +0200)] 
t4014: make output-directory tests self-contained

As noted by Gábor in [1], the new tests in edefc31873 ("format-patch:
create leading components of output directory", 2019-10-11) cannot be
run independently. Fix this.

[1] https://public-inbox.org/git/20191011144650.GM29845@szeder.dev/

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'js/azure-pipelines-msvc'
Junio C Hamano [Wed, 23 Oct 2019 02:06:46 +0000 (11:06 +0900)] 
Merge branch 'js/azure-pipelines-msvc'

* js/azure-pipelines-msvc:
  ci(visual-studio): actually run the tests in parallel
  ci(visual-studio): use strict compile flags, and optimization

4 years agoci(visual-studio): actually run the tests in parallel
Johannes Schindelin [Mon, 21 Oct 2019 19:59:58 +0000 (19:59 +0000)] 
ci(visual-studio): actually run the tests in parallel

Originally, the CI/PR builds that build and test using Visual Studio
were implemented imitating `linux-clang`, i.e. still using the
`Makefile`-based build infrastructure.

Later (but still before the patches made their way into git.git's
`master`), however, this was changed to generate Visual Studio project
files and build the binaries using `MSBuild`, as this reflects more
accurately how Visual Studio users would want to build Git (internally,
Visual Studio uses `MSBuild`, or at least something very similar).

During that transition, we needed to implement a new way to run the test
suite in parallel, as Visual Studio users typically will only have a Git
Bash available (which does not ship with `make` nor with support for
`prove`): we simply implemented a new test helper to run the test suite.

This helper even knows how to run the tests in parallel, but due to a
mistake on this developer's part, it was never turned on in the CI/PR
builds. This results in 2x-3x longer run times of the test phase.

Let's use the `--jobs=10` option to fix this.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoci(visual-studio): use strict compile flags, and optimization
Johannes Schindelin [Mon, 21 Oct 2019 19:59:57 +0000 (19:59 +0000)] 
ci(visual-studio): use strict compile flags, and optimization

To make full use of the work that went into the Visual Studio build &
test jobs in our CI/PR builds, let's turn on strict compiler flags. This
will give us the benefit of Visual C's compiler warnings (which, at
times, seem to catch things that GCC does not catch, and vice versa).

While at it, also turn on optimization; It does not make sense to
produce binaries with debug information, and we can use any ounce of
speed that we get (because the test suite is particularly slow on
Windows, thanks to the need to run inside a Unix shell, which
requires us to use the POSIX emulation layer provided by MSYS2).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: it.po: update the Italian translation for Git 2.24.0
Alessandro Menti [Mon, 21 Oct 2019 21:00:52 +0000 (23:00 +0200)] 
l10n: it.po: update the Italian translation for Git 2.24.0

Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
4 years agoMerge branch 'master' of github.com:jnavila/git into git-po-master
Jiang Xin [Tue, 22 Oct 2019 01:47:23 +0000 (09:47 +0800)] 
Merge branch 'master' of github.com:jnavila/git into git-po-master

* 'master' of github.com:jnavila/git:
  l10n: fr 2.24.0 rnd 1

4 years agoMerge branch 'master' of github.com:alshopov/git-po into git-po-master
Jiang Xin [Tue, 22 Oct 2019 01:16:24 +0000 (09:16 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po into git-po-master

* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (4693)