]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
21 months agoMerge branch 'hx/lookup-commit-in-graph-fix' into maint
Junio C Hamano [Thu, 11 Aug 2022 04:52:32 +0000 (21:52 -0700)] 
Merge branch 'hx/lookup-commit-in-graph-fix' into maint

A corner case bug where lazily fetching objects from a promisor
remote resulted in infinite recursion has been corrected.
source: <cover.1656593279.git.hanxin.hx@bytedance.com>

* hx/lookup-commit-in-graph-fix:
  t5330: remove run_with_limited_processses()
  commit-graph.c: no lazy fetch in lookup_commit_in_graph()

21 months agoMerge branch 'jc/resolve-undo' into maint
Junio C Hamano [Thu, 11 Aug 2022 04:52:32 +0000 (21:52 -0700)] 
Merge branch 'jc/resolve-undo' into maint

The resolve-undo information in the index was not protected against
GC, which has been corrected.
source: <xmqq35f7kzad.fsf@gitster.g>

* jc/resolve-undo:
  fsck: do not dereference NULL while checking resolve-undo data
  revision: mark blobs needed for resolve-undo as reachable

21 months agoDownmerge a bit more for 2.37.x
Junio C Hamano [Fri, 5 Aug 2022 22:43:57 +0000 (15:43 -0700)] 
Downmerge a bit more for 2.37.x

Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoMerge branch 'sg/index-format-doc-update' into maint
Junio C Hamano [Fri, 5 Aug 2022 22:51:37 +0000 (15:51 -0700)] 
Merge branch 'sg/index-format-doc-update' into maint

Docfix.
source: <20220718085640.7395-1-szeder.dev@gmail.com>

* sg/index-format-doc-update:
  index-format.txt: remove outdated list of supported extensions

21 months agoMerge branch 'ma/sparse-checkout-cone-doc-fix' into maint
Junio C Hamano [Fri, 5 Aug 2022 22:51:37 +0000 (15:51 -0700)] 
Merge branch 'ma/sparse-checkout-cone-doc-fix' into maint

Docfix.
source: <20220718100530.2068354-1-martin.agren@gmail.com>

* ma/sparse-checkout-cone-doc-fix:
  config/core.txt: fix minor issues for `core.sparseCheckoutCone`

21 months agoMerge branch 'ds/win-syslog-compiler-fix' into maint
Junio C Hamano [Fri, 5 Aug 2022 22:51:37 +0000 (15:51 -0700)] 
Merge branch 'ds/win-syslog-compiler-fix' into maint

Workaround for a false positive compiler warning.
source: <pull.1294.git.1658256354725.gitgitgadget@gmail.com>

* ds/win-syslog-compiler-fix:
  compat/win32: correct for incorrect compiler warning

21 months agoMerge branch 'ld/osx-keychain-usage-fix' into maint
Junio C Hamano [Fri, 5 Aug 2022 22:51:37 +0000 (15:51 -0700)] 
Merge branch 'ld/osx-keychain-usage-fix' into maint

Workaround for a compiler warning against use of die() in
osx-keychain (in contrib/).
source: <pull.1293.git.1658251503775.gitgitgadget@gmail.com>

* ld/osx-keychain-usage-fix:
  osx-keychain: fix compiler warning

21 months agoMerge branch 'ds/doc-wo-whitelist' into maint
Junio C Hamano [Fri, 5 Aug 2022 22:51:36 +0000 (15:51 -0700)] 
Merge branch 'ds/doc-wo-whitelist' into maint

Avoid "white/black-list" in documentation and code comments.
source: <pull.1274.v3.git.1658255537.gitgitgadget@gmail.com>

* ds/doc-wo-whitelist:
  transport.c: avoid "whitelist"
  t: avoid "whitelist"
  git.txt: remove redundant language
  git-cvsserver: clarify directory list
  daemon: clarify directory arguments

21 months agoMerge branch 'mb/config-document-include' into maint
Junio C Hamano [Fri, 5 Aug 2022 22:51:36 +0000 (15:51 -0700)] 
Merge branch 'mb/config-document-include' into maint

Add missing documentation for "include" and "includeIf" features in
"git config" file format, which incidentally teaches the command
line completion to include them in its offerings.
source: <pull.1285.v2.git.1658002423864.gitgitgadget@gmail.com>

* mb/config-document-include:
  config.txt: document include, includeIf

21 months agoMerge branch 'rs/mingw-tighten-mkstemp' into maint
Junio C Hamano [Fri, 5 Aug 2022 22:51:35 +0000 (15:51 -0700)] 
Merge branch 'rs/mingw-tighten-mkstemp' into maint

mkstemp() emulation on Windows has been improved.
source: <7265e37f-fd29-3579-b840-19a1df52a59f@web.de>

* rs/mingw-tighten-mkstemp:
  mingw: avoid mktemp() in mkstemp() implementation

21 months agoMerge branch 'jk/clone-unborn-confusion' into maint
Junio C Hamano [Fri, 5 Aug 2022 22:51:35 +0000 (15:51 -0700)] 
Merge branch 'jk/clone-unborn-confusion' into maint

"git clone" from a repository with some ref whose HEAD is unborn
did not set the HEAD in the resulting repository correctly, which
has been corrected.
source: <YsdyLS4UFzj0j/wB@coredump.intra.peff.net>

* jk/clone-unborn-confusion:
  clone: move unborn head creation to update_head()
  clone: use remote branch if it matches default HEAD
  clone: propagate empty remote HEAD even with other branches
  clone: drop extra newline from warning message

21 months agoDownmerge a handful of fixes for 2.37.x maintenance track
Junio C Hamano [Wed, 27 Jul 2022 20:22:06 +0000 (13:22 -0700)] 
Downmerge a handful of fixes for 2.37.x maintenance track

Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoMerge branch 'tk/rev-parse-doc-clarify-at-u' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:52 +0000 (13:19 -0700)] 
Merge branch 'tk/rev-parse-doc-clarify-at-u' into maint

Doc update.
source: <pull.1265.v2.git.1655960512385.gitgitgadget@gmail.com>

* tk/rev-parse-doc-clarify-at-u:
  rev-parse: documentation adjustment - mention remote tracking with @{u}

21 months agoMerge branch 'll/ls-files-tests-update' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:52 +0000 (13:19 -0700)] 
Merge branch 'll/ls-files-tests-update' into maint

Test update.
source: <pull.1269.v6.git.1656863349926.gitgitgadget@gmail.com>

* ll/ls-files-tests-update:
  ls-files: update test style

21 months agoMerge branch 'ds/t5510-brokequote' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:51 +0000 (13:19 -0700)] 
Merge branch 'ds/t5510-brokequote' into maint

Test fix.
source: <484a330e-0902-6e1b-8189-63c72dcea494@github.com>

* ds/t5510-brokequote:
  t5510: replace 'origin' with URL more carefully

21 months agoMerge branch 'tb/pack-objects-remove-pahole-comment' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:51 +0000 (13:19 -0700)] 
Merge branch 'tb/pack-objects-remove-pahole-comment' into maint

Comment fix.
source: <1379af2e9d271b501ef3942398e7f159a9c77973.1656440978.git.me@ttaylorr.com>

* tb/pack-objects-remove-pahole-comment:
  pack-objects.h: remove outdated pahole results

21 months agoMerge branch 'en/t6429-test-must-be-empty-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:50 +0000 (13:19 -0700)] 
Merge branch 'en/t6429-test-must-be-empty-fix' into maint

A test fix.
source: <pull.1276.git.1656652799863.gitgitgadget@gmail.com>

* en/t6429-test-must-be-empty-fix:
  t6429: fix use of non-existent function

21 months agoMerge branch 'ds/vscode-settings' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:50 +0000 (13:19 -0700)] 
Merge branch 'ds/vscode-settings' into maint

* ds/vscode-settings:
  vscode: improve tab size and wrapping

21 months agoMerge branch 'cr/setup-bug-typo' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:49 +0000 (13:19 -0700)] 
Merge branch 'cr/setup-bug-typo' into maint

Typofix in a BUG() message.
source: <pull.1255.git.1654782920256.gitgitgadget@gmail.com>

* cr/setup-bug-typo:
  setup: fix function name in a BUG() message

21 months agoMerge branch 'pb/diff-doc-raw-format' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:49 +0000 (13:19 -0700)] 
Merge branch 'pb/diff-doc-raw-format' into maint

Update "git diff/log --raw" format documentation.
source: <pull.1259.git.1655123383.gitgitgadget@gmail.com>

* pb/diff-doc-raw-format:
  diff-index.txt: update raw output format in examples
  diff-format.txt: correct misleading wording
  diff-format.txt: dst can be 0* SHA-1 when path is deleted, too

21 months agoMerge branch 'jk/revisions-doc-markup-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:19:48 +0000 (13:19 -0700)] 
Merge branch 'jk/revisions-doc-markup-fix' into maint

Documentation mark-up fix.
source: <YrOmsA04FZae89be@coredump.intra.peff.net>

* jk/revisions-doc-markup-fix:
  revisions.txt: escape "..." to avoid asciidoc horizontal ellipsis

21 months agoMerge branch 'rs/combine-diff-with-incompatible-options' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:32 +0000 (13:00 -0700)] 
Merge branch 'rs/combine-diff-with-incompatible-options' into maint

Certain diff options are currently ignored when combined-diff is
shown; mark them as incompatible with the feature.
source: <220524.86v8tuvfl1.gmgdl@evledraar.gmail.com>

* rs/combine-diff-with-incompatible-options:
  combine-diff: abort if --output is given
  combine-diff: abort if --ignore-matching-lines is given

21 months agoMerge branch 'ac/bitmap-format-doc' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:31 +0000 (13:00 -0700)] 
Merge branch 'ac/bitmap-format-doc' into maint

Adjust technical/bitmap-format to be formatted by AsciiDoc, and
add some missing information to the documentation.
source: <pull.1246.v4.git.1655355834.gitgitgadget@gmail.com>

* ac/bitmap-format-doc:
  bitmap-format.txt: add information for trailing checksum
  bitmap-format.txt: fix some formatting issues
  bitmap-format.txt: feed the file to asciidoc to generate html

21 months agoMerge branch 'ab/test-quoting-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:31 +0000 (13:00 -0700)] 
Merge branch 'ab/test-quoting-fix' into maint

Fixes for tests when the source directory has unusual characters in
its path, e.g. whitespaces, double-quotes, etc.
source: <cover-v2-0.3-00000000000-20220630T101646Z-avarab@gmail.com>

* ab/test-quoting-fix:
  config tests: fix harmless but broken "rm -r" cleanup
  test-lib.sh: fix prepend_var() quoting issue
  tests: add missing double quotes to included library paths

21 months agoMerge branch 'ro/mktree-allow-missing-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:30 +0000 (13:00 -0700)] 
Merge branch 'ro/mktree-allow-missing-fix' into maint

"git mktree --missing" lazily fetched objects that are missing from
the local object store, which was totally unnecessary for the purpose
of creating the tree object(s) from its input.
source: <748f39a9-65aa-2110-cf92-7ddf81b5f507@roku.com>

* ro/mktree-allow-missing-fix:
  mktree: do not check type of remote objects

21 months agoMerge branch 'dr/i18n-die-warn-error-usage' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:30 +0000 (13:00 -0700)] 
Merge branch 'dr/i18n-die-warn-error-usage' into maint

Give _() markings to fatal/warning/usage: labels that are shown in
front of these messages.
source: <pull.1279.v2.git.git.1655819877758.gitgitgadget@gmail.com>

* dr/i18n-die-warn-error-usage:
  i18n: mark message helpers prefix for translation

21 months agoMerge branch 'ds/git-rebase-doc-markup' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:29 +0000 (13:00 -0700)] 
Merge branch 'ds/git-rebase-doc-markup' into maint

References to commands-to-be-typed-literally in "git rebase"
documentation mark-up have been corrected.
source: <pull.1270.v3.git.1656508868146.gitgitgadget@gmail.com>

* ds/git-rebase-doc-markup:
  git-rebase.txt: use back-ticks consistently

21 months agoMerge branch 'gg/worktree-from-the-above' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:29 +0000 (13:00 -0700)] 
Merge branch 'gg/worktree-from-the-above' into maint

In a non-bare repository, the behavior of Git when the
core.worktree configuration variable points at a directory that has
a repository as its subdirectory, regressed in Git 2.27 days.
source: <20220616234433.225-1-gg.oss@outlook.com>
source: <20220616231956.154-1-gg.oss@outlook.com>

* gg/worktree-from-the-above:
  dir: minor refactoring / clean-up
  dir: traverse into repository

21 months agoMerge branch 'fr/vimdiff-layout-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:28 +0000 (13:00 -0700)] 
Merge branch 'fr/vimdiff-layout-fix' into maint

Recent update to vimdiff layout code has been made more robust
against different end-user vim settings.
source: <20220708181024.45839-1-greenfoo@u92.eu>

* fr/vimdiff-layout-fix:
  vimdiff: make layout engine more robust against user vim settings

21 months agoMerge branch 'en/merge-dual-dir-renames-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:28 +0000 (13:00 -0700)] 
Merge branch 'en/merge-dual-dir-renames-fix' into maint

Fixes a long-standing corner case bug around directory renames in
the merge-ort strategy.
source: <pull.1268.v4.git.1656984823.gitgitgadget@gmail.com>

* en/merge-dual-dir-renames-fix:
  merge-ort: fix issue with dual rename and add/add conflict
  merge-ort: shuffle the computation and cleanup of potential collisions
  merge-ort: make a separate function for freeing struct collisions
  merge-ort: small cleanups of check_for_directory_rename
  t6423: add tests of dual directory rename plus add/add conflict

21 months agoMerge branch 'jk/diff-files-cleanup-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:27 +0000 (13:00 -0700)] 
Merge branch 'jk/diff-files-cleanup-fix' into maint

An earlier attempt to plug leaks placed a clean-up label to jump to
at a bogus place, which as been corrected.
source: <Ys0c0ePxPOqZ/5ck@coredump.intra.peff.net>

* jk/diff-files-cleanup-fix:
  diff-files: move misplaced cleanup label

21 months agoMerge branch 'js/vimdiff-quotepath-fix' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:26 +0000 (13:00 -0700)] 
Merge branch 'js/vimdiff-quotepath-fix' into maint

Variable quoting fix in the vimdiff driver of "git mergetool"
source: <pull.1287.v2.git.1657809063728.gitgitgadget@gmail.com>

* js/vimdiff-quotepath-fix:
  mergetool(vimdiff): allow paths to contain spaces again

21 months agoMerge branch 'js/shortlog-sort-stably' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:26 +0000 (13:00 -0700)] 
Merge branch 'js/shortlog-sort-stably' into maint

"git shortlog -n" relied on the underlying qsort() to be stable,
which shouldn't have.  Fixed.
source: <pull.1290.git.1657813429221.gitgitgadget@gmail.com>

* js/shortlog-sort-stably:
  shortlog: use a stable sort

21 months agoMerge branch 'js/ci-github-workflow-markup' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:25 +0000 (13:00 -0700)] 
Merge branch 'js/ci-github-workflow-markup' into maint

A fix for a regression in test framework.
source: <pull.1288.git.1657789234416.gitgitgadget@gmail.com>

* js/ci-github-workflow-markup:
  tests: fix incorrect --write-junit-xml code

21 months agocompat/win32: correct for incorrect compiler warning
Derrick Stolee [Tue, 19 Jul 2022 18:45:54 +0000 (18:45 +0000)] 
compat/win32: correct for incorrect compiler warning

The 'win build' job of our CI build is failing with the following error:

compat/win32/syslog.c: In function 'syslog':
compat/win32/syslog.c:53:17: error: pointer 'pos' may be used after \
    'realloc' [-Werror=use-after-free]
   53 |                 memmove(pos + 2, pos + 1, strlen(pos));
    CC compat/poll/poll.o
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compat/win32/syslog.c:47:23: note: call to 'realloc' here
   47 |                 str = realloc(str, st_add(++str_len, 1));
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

However, between this realloc() and the use we have a line that resets
the value of 'pos'. Thus, this error is incorrect. It is likely due to a
new version of the compiler on the CI machines.

Instead of waiting for a new compiler, create a new variable to avoid
this error.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agotransport.c: avoid "whitelist"
Derrick Stolee [Tue, 19 Jul 2022 18:32:17 +0000 (18:32 +0000)] 
transport.c: avoid "whitelist"

The word "whitelist" has cultural implications that are not inclusive.
Thankfully, it is not difficult to reword and avoid its use.

The GIT_ALLOW_PROTOCOL environment variable was referred to as a
"whitelist", but the word "allow" is already part of the variable.
Replace "whitelist" with "allow_list" in these cases to demonstrate that
we are processing a list of allowed protocols.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agot: avoid "whitelist"
Derrick Stolee [Tue, 19 Jul 2022 18:32:16 +0000 (18:32 +0000)] 
t: avoid "whitelist"

The word "whitelist" has cultural implications that are not inclusive.
Thankfully, it is not difficult to reword and avoid its use.

Focus on changes in the test scripts, since most of the changes are in
comments and test names. The renamed test_allow_var helper is only used
once inside the widely-used test_proto helper.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agogit.txt: remove redundant language
Derrick Stolee [Tue, 19 Jul 2022 18:32:15 +0000 (18:32 +0000)] 
git.txt: remove redundant language

The documentation for GIT_ALLOW_PROTOCOL has a sentence that adds no
value, since it repeats the meaning from the previous sentence (twice!).

The word "whitelist" has cultural implications that are not inclusive,
which brought attention to this sentence.

Helped-by: Jeff King <peff@peff.net>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agogit-cvsserver: clarify directory list
Derrick Stolee [Tue, 19 Jul 2022 18:32:14 +0000 (18:32 +0000)] 
git-cvsserver: clarify directory list

The documentation and error messages for git-cvsserver include some
references to a "whitelist" that is not otherwise included in the
documentation. When different parts of the documentation do not use
common language, this can lead to confusion as to how things are meant
to operate.

Further, the word "whitelist" has cultural implications that make its
use non-inclusive. Thankfully, we can remove it while increasing
clarity.

Update Documentation/git-cvsserver.txt in a similar way to the previous
change to Documentation/git-daemon.txt. The optional '<directory>...'
list can specify a list of allowed directories. We refer to that list
directly inside of the documentation for the GIT_CVSSERVER_ROOT
environment variable.

While modifying this documentation, update the environment variables to
use a list format. We use the modern way of tabbing the description of
each variable in this section. We do _not_ update the description of
'<directory>...' to use tabs this way since the rest of the items in the
OPTIONS list do not use this modern formatting.

A single error message in the actual git-cvsserver.perl code refers to
the whitelist during argument parsing. Instead, refer to the directory
list that has been clarified in the documentation.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agodaemon: clarify directory arguments
Derrick Stolee [Tue, 19 Jul 2022 18:32:13 +0000 (18:32 +0000)] 
daemon: clarify directory arguments

The undecorated arguments to the 'git-daemon' command provide a list of
directories. When at least one directory is specified, then 'git-daemon'
only serves requests that are within that directory list. The boolean
'--strict-paths' option makes the list more explicit in that
subdirectories are no longer included.

The existing documentation and error messages around this directory list
refer to it and its behavior as a "whitelist". The word "whitelist" has
cultural implications that are not inclusive.  Thankfully, it is not
difficult to reword and avoid its use. In the process, we can define the
purpose of this directory list directly.

In Documentation/git-daemon.txt, rewrite the OPTIONS section around the
'<directory>' option. Add additional clarity to the other options that
refer to these directories.

Some error messages can also be improved in daemon.c. The
'--strict-paths' option requires '<directory>' arguments, so refer to
that section of the documentation directly. A logerror() call points out
that a requested directory is not in the specified directory list. We
can use "list" here without any loss of information.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoosx-keychain: fix compiler warning
Lessley Dennington [Tue, 19 Jul 2022 17:25:03 +0000 (17:25 +0000)] 
osx-keychain: fix compiler warning

Update git-credential-osxkeychain.c to remove 'format string is not a string
literal (potentially insecure)' compiler warning by treating the string as
an argument.

Signed-off-by: Lessley Dennington <lessleydennington@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoconfig/core.txt: fix minor issues for `core.sparseCheckoutCone`
Martin Ågren [Mon, 18 Jul 2022 10:05:30 +0000 (12:05 +0200)] 
config/core.txt: fix minor issues for `core.sparseCheckoutCone`

The sparse checkout feature can be used in "cone mode" or "non-cone
mode". In this one instance in the documentation, we refer to the latter
as "non cone mode" with whitespace rather than a hyphen. Align this with
the rest of our documentation.

A few words later in the same paragraph, there's mention of "a more
flexible patterns". Drop that leading "a" to fix the grammar.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoindex-format.txt: remove outdated list of supported extensions
SZEDER Gábor [Mon, 18 Jul 2022 08:56:40 +0000 (10:56 +0200)] 
index-format.txt: remove outdated list of supported extensions

The first section of 'Documentation/technical/index-format.txt'
mentions that "Git currently supports cache tree and resolve undo
extensions", but then goes on, and in the "Extensions" section
describes not only these two, but six other extensions [1].

Remove this sentence, as it's misleading about the status of all those
other extensions.

Alternatively we could keep that sentence and update the list of
extensions, but that might well lead to a recurring issue, because
apparently this list is never updated when a new index extension is
added.

[1] Split index, untracked cache, FS monitor cache, end of index
    entry, index entry offset table and sparse directory entries.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoconfig.txt: document include, includeIf
Manuel Boni [Sat, 16 Jul 2022 20:13:43 +0000 (20:13 +0000)] 
config.txt: document include, includeIf

Git config's tab completion does not yet know about the "include"
and "includeIf" sections, nor the related "path" variable.

Add a description for these two sections in
'Documentation/config/includeif.txt', which points to git-config's
documentation, specifically the "Includes" and "Conditional Includes"
subsections.

As a side effect, tab completion can successfully complete the
'include', 'includeIf', and 'include.add' expressions.
This effect is tested by two new ad-hoc tests.
Variable completion only works for "include" for now.

Credit for the ideas behind this patch goes to
Ævar Arnfjörð Bjarmason.

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Manuel Boni <ziosombrero@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agomingw: avoid mktemp() in mkstemp() implementation
René Scharfe [Fri, 15 Jul 2022 03:58:50 +0000 (05:58 +0200)] 
mingw: avoid mktemp() in mkstemp() implementation

The implementation of mkstemp() for MinGW uses mktemp() and open()
without the flag O_EXCL, which is racy.  It's not a security problem
for now because all of its callers only create files within the
repository (incl. worktrees).  Replace it with a call to our more
secure internal function, git_mkstemp_mode(), to prevent possible
future issues.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoshortlog: use a stable sort
Johannes Schindelin [Thu, 14 Jul 2022 15:43:49 +0000 (15:43 +0000)] 
shortlog: use a stable sort

When sorting the output of `git shortlog` by count, a list of authors in
alphabetical order is then sorted by contribution count. Obviously, the
idea is to maintain the alphabetical order for items with identical
contribution count.

At the moment, this job is performed by `qsort()`. As that function is
not guaranteed to implement a stable sort algorithm, this can lead to
inconsistent and/or surprising behavior: items with identical
contribution count could lose their alphabetical sub-order.

The `qsort()` in MS Visual C's runtime does _not_ implement a stable
sort algorithm, and under certain circumstances this even causes a test
failure in t4201.21 "shortlog can match multiple groups", where two
authors both are listed with 2 contributions, and are listed in inverse
alphabetical order.

Let's instead use the stable sort provided by `git_stable_qsort()` to
avoid this inconsistency.

This is a companion to 2049b8dc65 (diffcore_rename(): use a stable sort,
2019-09-30).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agomergetool(vimdiff): allow paths to contain spaces again
Johannes Schindelin [Thu, 14 Jul 2022 14:31:03 +0000 (14:31 +0000)] 
mergetool(vimdiff): allow paths to contain spaces again

In 0041797449d (vimdiff: new implementation with layout support,
2022-03-30), we introduced a completely new implementation of the
`vimdiff` backend for `git mergetool`.

In this implementation, we no longer call `vim` directly but we
accumulate in the variable `FINAL_CMD` an arbitrary number of commands
for `vim` to execute, which necessitates the use of `eval` to split the
commands properly into multiple command-line arguments.

That same `eval` command also needs to pass the paths to `vim`, and
while it looks as if they are quoted correctly, that quoting only
reaches the `eval` instruction and is lost after that, therefore paths
that contain whitespace characters (or other characters that are
interpreted by the POSIX shell) are handled incorrectly.

This is a simple reproducer:

git init -b main bam-merge-fail
cd bam-merge-fail
echo a>"a file.txt"
git add "a file.txt"
git commit -m "added 'a file.txt'"
echo b>"a file.txt"
git add "a file.txt"
git commit -m "diverged b 'a file.txt'"
git checkout -b c HEAD~
echo c>"a file.txt"
git add "a file.txt"
git commit -m "diverged c 'a file.txt'"
git checkout main
git merge c
git mergetool --tool=vimdiff

With Git v2.37.0/v2.37.1, this will open 7 buffers, not four, and not
display the correct contents at all.

To fix this, let's not expand the variables containing the path
parameters before passing them to the `eval` command, but let that
command expand the variables instead.

This fixes https://github.com/git-for-windows/git/issues/3945

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agotests: fix incorrect --write-junit-xml code
Johannes Schindelin [Thu, 14 Jul 2022 09:00:34 +0000 (09:00 +0000)] 
tests: fix incorrect --write-junit-xml code

In 78d5e4cfb4b (tests: refactor --write-junit-xml code, 2022-05-21),
this developer refactored the `--write-junit-xml` code a bit, including
the part where the current test case's title was used in a `set`
invocation, but failed to account for the fact that some test cases'
titles start with a long option, which the `set` misinterprets as being
intended for parsing.

Let's fix this by using the `set -- <...>` form.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agot5330: remove run_with_limited_processses()
Han Xin [Tue, 12 Jul 2022 08:01:43 +0000 (16:01 +0800)] 
t5330: remove run_with_limited_processses()

run_with_limited_processses() is used to end the loop faster when an
infinite loop happen. But "ulimit" is tied to the entire development
station, and the test will fail due to too many other processes or using
"--stress".

Without run_with_limited_processses() the infinite loop can also be
stopped due to global configrations or quotas, and the verification
still works fine. So let's remove run_with_limited_processses().

Signed-off-by: Han Xin <hanxin.hx@bytedance.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agodiff-files: move misplaced cleanup label
Jeff King [Tue, 12 Jul 2022 07:03:45 +0000 (03:03 -0400)] 
diff-files: move misplaced cleanup label

Commit 0139c58ab9 (revisions API users: add "goto cleanup" for
release_revisions(), 2022-04-13) converted an early return in
cmd_diff_files() into a goto. But it put the cleanup label too early: if
read_cache_preload() returns an error, we'll set result to "-1", but
then jump to calling run_diff_files(), overwriting our result.

We should jump past the call to run_diff_files(). Likewise, we should go
past diff_result_code(), which is expecting to see a code from an actual
diff, not a negative error code.

In practice, I suspect this bug cannot actually be triggered, because
read_cache_preload() does not seem to ever return an error. Its return
value (eventually) comes from do_read_index(), which gives the number of
cache entries found, and calls die() on error. Still, it makes sense to
fix the inadvertent change from 0139c58ab9 first, and we can look into
the overall error handling of read_cache() separately (which is present
in many other callsites).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agofsck: do not dereference NULL while checking resolve-undo data
Junio C Hamano [Mon, 11 Jul 2022 23:25:14 +0000 (16:25 -0700)] 
fsck: do not dereference NULL while checking resolve-undo data

When we found an invalid object recorded in the resolve-undo data,
we would have ended up dereferencing NULL while fsck.  Reporting the
problem and going on to the next object is the right thing to do
here.

Noticed by SZEDER Gábor.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoclone: move unborn head creation to update_head()
Jeff King [Mon, 11 Jul 2022 09:21:52 +0000 (05:21 -0400)] 
clone: move unborn head creation to update_head()

Prior to 4f37d45706 (clone: respect remote unborn HEAD, 2021-02-05),
creation of the local HEAD was always done in update_head(). That commit
added code to handle an unborn head in an empty repository, and just did
all symref creation and config setup there.

This makes the code flow a little bit confusing, especially as new
corner cases have been covered (like the previous commit to match our
default branch name to a non-HEAD remote branch).

Let's move the creation of the unborn symref into update_head(). This
matches the other HEAD-creation cases, and now the logic is consistently
separated: the main cmd_clone() function only examines the situation and
sets variables based on what it finds, and update_head() actually
performs the update.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agovimdiff: make layout engine more robust against user vim settings
Fernando Ramos [Fri, 8 Jul 2022 18:10:24 +0000 (20:10 +0200)] 
vimdiff: make layout engine more robust against user vim settings

'vim' has two configuration options ('splitbelow' and 'splitright') that
change the way the 'split' command behaves. When they are set, the
commands that the layout engine generates no longer work as expected.

In order to fix this we can append special keyword 'leftabove' to each
'split' and 'vertical split' subcommand found inside the command string
generated by the layout engine.

This works because whatever comes after 'leftabove' will temporally
ignore settings 'splitbelow' and 'splitright'.

Reported-by: Matthew Klein <mklein994@gmail.com>
Signed-off-by: Fernando Ramos <greenfoo@u92.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoclone: use remote branch if it matches default HEAD
Jeff King [Thu, 7 Jul 2022 23:59:35 +0000 (19:59 -0400)] 
clone: use remote branch if it matches default HEAD

Usually clone tries to use the same local HEAD as the remote (unless the
user has given --branch explicitly). Even if the remote HEAD is detached
or unborn, we can detect those situations with modern versions of Git.
If the remote is too old to support the "unborn" extension (or it has
been disabled via config), then we can't know the name of the remote's
unborn HEAD, and we fall back whatever the local default branch name is
configured to be.

But that leads to one weird corner case. It's rare because it needs a
number of factors:

  - the remote has an unborn HEAD

  - the remote is too old to support "unborn", or has disabled it

  - the remote has another branch "foo"

  - the local default branch name is "foo"

In that case you end up with a local clone on an unborn "foo" branch,
disconnected completely from the remote's "foo". This is rare in
practice, but the result is quite confusing.

When choosing "foo", we can double check whether the remote has such a
name, and if so, start our local "foo" at the same spot, rather than
making it unborn.

Note that this causes a test failure in t5605, which is cloning from a
bundle that doesn't contain HEAD (so it behaves like a remote that
doesn't support "unborn"), but has a single "main" branch. That test
expects that we end up in the weird "unborn main" case, where we don't
actually check out the remote branch of the same name. Even though we
have to update the test, this seems like an argument in favor of this
patch: checking out main is what I'd expect from such a bundle.

So this patch updates the test for the new behavior and adds an adjacent
one that checks what the original was going for: if there's no HEAD and
the bundle _doesn't_ have a branch that matches our local default name,
then we end up with nothing checked out.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoclone: propagate empty remote HEAD even with other branches
Jeff King [Thu, 7 Jul 2022 23:57:45 +0000 (19:57 -0400)] 
clone: propagate empty remote HEAD even with other branches

Unless "--branch" was given, clone generally tries to match the local
HEAD to the remote one. For most repositories, this is easy: the remote
tells us which branch HEAD was pointing to, and we call our local
checkout() function on that branch.

When cloning an empty repository, it's a little more tricky: we have
special code that checks the transport's "unborn" extension, or falls back
to our local idea of what the default branch should be. In either case,
we point the new HEAD to that, and set up the branch.* config.

But that leaves one case unhandled: when the remote repository _isn't_
empty, but its HEAD is unborn. The checkout() function is smart enough
to realize we didn't fetch the remote HEAD and it bails with a warning.
But we'll have ignored any information the remote gave us via the unborn
extension. This leads to nonsense outcomes:

  - If the remote has its HEAD pointing to an unborn "foo" and contains
    another branch "bar", cloning will get branch "bar" but leave the
    local HEAD pointing at "master" (or whatever our local default is),
    which is useless. The project does not use "master" as a branch.

  - Worse, if the other branch "bar" is instead called "master" (but
    again, the remote HEAD is not pointing to it), then we end up with a
    local unborn branch "master", which is not connected to the remote
    "master" (it shares no history, and there's no branch.* config).

Instead, we should try to use the remote's HEAD, even if its unborn, to
be consistent with the other cases.

The reason this case was missed is that cmd_clone() handles empty and
non-empty repositories on two different sides of a conditional:

  if (we have any refs) {
      fetch refs;
      check for --branch;
      otherwise, try to point our head at remote head;
      otherwise, our head is NULL;
  } else {
      check for --branch;
      otherwise, try to use "unborn" extension;
      otherwise, fall back to our default name name;
  }

So the smallest change would be to repeat the "unborn" logic at the end
of the first block. But we can note some other overlaps and
inconsistencies:

  - both sides have to handle --branch (though note that it's always an
    error for the empty repo case, since an empty repo by definition
    does not have a matching branch)

  - the fall back to the default name is much more explicit in the
    empty-repo case. The non-empty case eventually ends up bailing
    from checkout() with a warning, which produces a similar result, but
    fails to set up the branch config we do in the empty case.

So let's pull the HEAD setup out of this conditional entirely. This
de-duplicates some of the code and the result is easy to follow, because
helper functions like find_ref_by_name() do the right thing even in the
empty-repo case (i.e., by returning NULL).

There are two subtleties:

  - for a remote with a detached HEAD, it will advertise an oid for HEAD
    (which we store in our "remote_head" variable), but we won't find a
    matching refname (so our "remote_head_points_at" is NULL). In this
    case we make a local detached HEAD to match. Right now this happens
    implicitly by reaching update_head() with a non-NULL remote_head
    (since we skip all of the unborn-fallback). We'll now need to
    account for it explicitly before doing the fallback.

  - for an empty repo, we issue a warning to the user that they've
    cloned an empty repo. The text of that warning doesn't make sense
    for a non-empty repo with an unborn HEAD, so we'll have to
    differentiate the two cases there. We could just use different text,
    but instead let's allow the code to continue down to checkout(),
    which will issue an appropriate warning, like:

      remote HEAD refers to nonexistent ref, unable to checkout

    Continuing down to checkout() will make it easier to do more fixes
    on top (see below).

Note that this patch fixes the case where the other side reports an
unborn head to us using the protocol extension. It _doesn't_ fix the
case where the other side doesn't tell us, we locally guess "master",
and the other side happens to have a "master" which its HEAD doesn't
point. But it doesn't make anything worse there, and it should actually
make it easier to fix that problem on top.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoclone: drop extra newline from warning message
Jeff King [Thu, 7 Jul 2022 23:54:51 +0000 (19:54 -0400)] 
clone: drop extra newline from warning message

We don't need to put a "\n" in calls to warning(), since it adds one
itself (and the user sees an extra blank line). Drop it, and while we're
here, drop the full-stop from the message, which goes against our
guidelines.

This bug dates all the way back to 8434c2f1af (Build in clone,
2008-04-27), but presumably nobody noticed because it's hard to trigger:
you have to clone a repository whose HEAD is unborn, but which is not
otherwise empty.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agols-files: update test style
Li Linchao [Sun, 3 Jul 2022 15:49:09 +0000 (15:49 +0000)] 
ls-files: update test style

Update test style in t/t30[*].sh for uniformity, that's to
keep test title the same line with helper function itself,
and fix some indentions.

Add a new section "recommended style" in t/README to
encourage people to use more modern style in test.

Signed-off-by: Li Linchao <lilinchao@oschina.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agomerge-ort: fix issue with dual rename and add/add conflict
Elijah Newren [Tue, 5 Jul 2022 01:33:43 +0000 (01:33 +0000)] 
merge-ort: fix issue with dual rename and add/add conflict

There is code in both merge-recursive and merge-ort for avoiding doubly
transitive renames (i.e. one side renames directory A/ -> B/, and the
other side renames directory B/ -> C/), because this combination would
otherwise make a mess for new files added to A/ on the first side and
wondering which directory they end up in -- especially if there were
even more renames such as the first side renaming C/ -> D/.  In such
cases, it just turns "off" directory rename detection for the higher
order transitive cases.

The testcases added in t6423 a couple commits ago are slightly different
but similar in principle.  They involve a similar case of paired
renaming but instead of A/ -> B/ and B/ -> C/, the second side renames
a leading directory of B/ to C/.  And both sides add a new file
somewhere under the directory that the other side will rename.  While
the new files added start within different directories and thus could
logically end up within different directories, it is weird for a file
on one side to end up where the other one started and not move along
with it.  So, let's just turn off directory rename detection in this
case as well.

Another way to look at this is that if the source name involved in a
directory rename on one side is the target name of a directory rename
operation for a file from the other side, then we avoid the doubly
transitive rename.  (More concretely, if a directory rename on side D
wants to rename a file on side E from OLD_NAME -> NEW_NAME, and side D
already had a file named NEW_NAME, and a directory rename on side E
wants to rename side D's NEW_NAME -> NEWER_NAME, then we turn off the
directory rename detection for NEW_NAME to prevent the
NEW_NAME -> NEWER_NAME rename, and instead end up with an add/add
conflict on NEW_NAME.)

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agomerge-ort: shuffle the computation and cleanup of potential collisions
Elijah Newren [Tue, 5 Jul 2022 01:33:42 +0000 (01:33 +0000)] 
merge-ort: shuffle the computation and cleanup of potential collisions

Run compute_collisions() for renames on both sides of history before
any calls to collect_renames(), and do not free the computed collisions
until after both calls to collect_renames().  This is just a code
reorganization at this point that doesn't make sense on its own, but
will permit us to use the computed collision info from both sides
within each call to collect_renames() in a subsequent commit.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agomerge-ort: make a separate function for freeing struct collisions
Elijah Newren [Tue, 5 Jul 2022 01:33:41 +0000 (01:33 +0000)] 
merge-ort: make a separate function for freeing struct collisions

This commit makes no functional changes, it's just some code movement in
preparation for later changes.

Signed-off-by: Elijah Newren <newren@palantir.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agomerge-ort: small cleanups of check_for_directory_rename
Elijah Newren [Tue, 5 Jul 2022 01:33:40 +0000 (01:33 +0000)] 
merge-ort: small cleanups of check_for_directory_rename

No functional changes, just some preparatory cleanups.

Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Elijah Newren <newren@palantir.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agot6423: add tests of dual directory rename plus add/add conflict
Elijah Newren [Tue, 5 Jul 2022 01:33:39 +0000 (01:33 +0000)] 
t6423: add tests of dual directory rename plus add/add conflict

This is an attempt at minimalizing a testcase reported by Glen Choo
with tensorflow where merge-ort would report an assertion failure:

    Assertion failed: (ci->filemask == 2 || ci->filemask == 4), function apply_directory_rename_modifications, file merge-ort.c, line 2410

reversing the direction of the merge provides a different error:

    error: cache entry has null sha1: ...
    fatal: unable to write .git/index

so we add testcases for both.  With these new testcases, the
recursive strategy differs in that it returns the latter error for
both merge directions.

These testcases are somehow a little different than Glen's original
tensorflow testcase in that these ones trigger a bug with the recursive
algorithm whereas his testcase didn't.  I figure that means these
testcases somehow manage to be more comprehensive.

Reported-by: Glen Choo <chooglen@google.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoGit 2.37.1 v2.37.1
Junio C Hamano [Mon, 4 Jul 2022 20:45:08 +0000 (13:45 -0700)] 
Git 2.37.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge 'js/add-i-delete' into maint-2.37
Junio C Hamano [Mon, 4 Jul 2022 20:40:31 +0000 (13:40 -0700)] 
Merge 'js/add-i-delete' into maint-2.37

Rewrite of "git add -i" in C that appeared in Git 2.25 didn't
correctly record a removed file to the index, which is an old
regression but has become widely known because the C version
has become the default in the latest release.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agot6429: fix use of non-existent function
Elijah Newren [Fri, 1 Jul 2022 05:19:59 +0000 (05:19 +0000)] 
t6429: fix use of non-existent function

This test had a line reading

    ! test_file_is_empty actual

which was meant to be

    ! test_must_be_empty actual

The test worked despite the error, because even though
test_file_is_empty is a non-existent function, the '!' negated the
return value and made it pass.  It'd be better to avoid the negation,
so something like

    test_file_not_empty actual

would be better, but perhaps it makes even more sense to specify the
number of lines of expected output to make the test a bit tighter.

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Elijah Newren <newren@palantir.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agocommit-graph.c: no lazy fetch in lookup_commit_in_graph()
Han Xin [Fri, 1 Jul 2022 01:34:30 +0000 (09:34 +0800)] 
commit-graph.c: no lazy fetch in lookup_commit_in_graph()

The commit-graph is used to opportunistically optimize accesses to
certain pieces of information on commit objects, and
lookup_commit_in_graph() tries to say "no" when the requested commit
does not locally exist by returning NULL, in which case the caller
can ask for (which may result in on-demand fetching from a promisor
remote) and parse the commit object itself.

However, it uses a wrong helper, repo_has_object_file(), to do so.
This helper not only checks if an object is mmediately available in
the local object store, but also tries to fetch from a promisor remote.
But the fetch machinery calls lookup_commit_in_graph(), thus causing an
infinite loop.

We should make lookup_commit_in_graph() expect that a commit given to it
can be legitimately missing from the local object store, by using the
has_object_file() helper instead.

Signed-off-by: Han Xin <hanxin.hx@bytedance.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoconfig tests: fix harmless but broken "rm -r" cleanup
Ævar Arnfjörð Bjarmason [Thu, 30 Jun 2022 10:18:36 +0000 (12:18 +0200)] 
config tests: fix harmless but broken "rm -r" cleanup

The "test_when_finished" cleanup phase added in 4179b4897f2 (config:
allow overriding of global and system configuration, 2021-04-19) has
never worked as intended, firstly the ".config/git" is a directory, so
we'd need the "-r" flag, but more importantly the $HOME variable
wasn't properly quoted.

We'd thus end up trying to remove the "trash" part of "trash
directory", which wouldn't fail with "-f", since "rm -f" won't fail on
non-existing files.

It's possible that this would have caused an actual failure if someone
had a $HOME with a space character in it, such that our "rm -f" would
fail to remove an existing directory, but in practice that probably
never happened.

Let's fix both the quoting issue, and the other issue cleanup issue in
4179b4897f2, which is that we were attempting to clean up
~/.config/git, but weren't cleaing up ~/.gitconfig.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agotest-lib.sh: fix prepend_var() quoting issue
Ævar Arnfjörð Bjarmason [Thu, 30 Jun 2022 10:18:35 +0000 (12:18 +0200)] 
test-lib.sh: fix prepend_var() quoting issue

Fix a quoting issue in the function introduced in
b9638d7286f (test-lib: make $GIT_BUILD_DIR an absolute path,
2022-02-27), running the test suite where the git checkout was on a
path with e.g. a space in it would fail.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agotests: add missing double quotes to included library paths
Ævar Arnfjörð Bjarmason [Thu, 30 Jun 2022 10:18:34 +0000 (12:18 +0200)] 
tests: add missing double quotes to included library paths

Fix inclusion errors which would occur if the $TEST_DIRECTORY had $IFS
whitespace in it.

See d42bab442d7 (core.fsyncmethod: tests for batch mode, 2022-04-04)
and a242c150ebb (vimdiff: integrate layout tests in the unit tests
framework ('t' folder), 2022-03-30) for the two relevant commits. Both
were first released with v2.37.0-rc0 (and were also part of v2.37.0).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agogit-rebase.txt: use back-ticks consistently
Derrick Stolee [Wed, 29 Jun 2022 13:21:07 +0000 (13:21 +0000)] 
git-rebase.txt: use back-ticks consistently

While inspecting the 'git rebase' documentation, I noticed that it is
inconsistent with how it uses back-ticks (or other punctuation) for
identifying Git commands, command-line arguments, or values for those
arguments.

Sometimes, an argument (like '--interactive') would appear without any
punctuation, causing the argument to not have any special formatting.
Other times, arguments or 'git rebase' itself would have single-quotes
giving a bold look (in the HTML documentation at least).

By consistently using back-ticks, these types of strings appear in a
monospace font with special highlighting to appear more clearly as text
that exists in a command-line invocation of a Git command.

This rather-large diff is the result of scanning git-rebase.txt and
adding back-ticks as appropriate. Some are adding back-ticks where there
was no punctuation. Others are replacing single quotes.

There are also a few minor cleanups in the process, including those
found by reviewers.

Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agopack-objects.h: remove outdated pahole results
Taylor Blau [Tue, 28 Jun 2022 18:30:20 +0000 (14:30 -0400)] 
pack-objects.h: remove outdated pahole results

The size and padding of `struct object_entry` is an important factor in
determining the memory usage of `pack-objects`. For this reason,
3b13a5f263 (pack-objects: reorder members to shrink struct object_entry,
2018-04-14) added a comment containing some information from pahole
indicating the size and padding of that struct.

Unfortunately, this comment hasn't been updated since 9ac3f0e5b3
(pack-objects: fix performance issues on packing large deltas,
2018-07-22), despite the size of this struct changing many times since
that commit.

To see just how often the size of object_entry changes, I skimmed the
first-parent history with this script:

    for sha in $(git rev-list --first-parent --reverse 9ac3f0e..)
    do
      echo -n "$sha "
      git checkout -q $sha
      make -s pack-objects.o 2>/dev/null
      pahole -C object_entry pack-objects.o | sed -n \
        -e 's/\/\* size: \([0-9]*\).*/size \1/p' \
        -e 's/\/\*.*padding: \([0-9]*\).*/padding \1/p' | xargs
    done | uniq -f1

In between each merge, the size of object_entry changes too often to
record every instance here. But the important merges (along with their
corresponding sizes and bit paddings) in chronological order are:

    ad635e82d6 (Merge branch 'nd/pack-objects-pack-struct', 2018-05-23) size 80 padding 4
    29d9e3e2c4 (Merge branch 'nd/pack-deltify-regression-fix', 2018-08-22) size 80 padding 9
    3ebdef2e1b (Merge branch 'jk/pack-delta-reuse-with-bitmap', 2018-09-17) size 80 padding 8
    33e4ae9c50 (Merge branch 'bc/sha-256', 2019-01-29) size 96 padding 8

(indicating that the current size of the struct is 96 bytes, with 8
padding bits).

Even though this comment was written in a good spirit, it is updated
infrequently enough that it serves to confuse rather than to encourage
contributors to update the appropriate values when the modify the
definition of object_entry.

For that reason, eliminate the confusion by removing the comment
altogether.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoadd --interactive: allow `update` to stage deleted files
Johannes Schindelin [Tue, 28 Jun 2022 22:22:44 +0000 (22:22 +0000)] 
add --interactive: allow `update` to stage deleted files

The scripted version of `git add -i` used `git update-index --add
--remove`, but the built-in version implemented only the `--add` part.

This fixes https://github.com/msys2/MSYS2-packages/issues/3066

Reported-by: Christoph Reiter <reiter.christoph@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agovscode: improve tab size and wrapping
Derrick Stolee [Mon, 27 Jun 2022 18:29:47 +0000 (18:29 +0000)] 
vscode: improve tab size and wrapping

The contrib/vscode/init.sh script initializes the .vscode directory with
some helpful metadata so VS Code handles Git code better.

One big issue that VS Code has is detecting the tab width based on file
type. ".txt" files were not covered by this script before, so add them
with the appropriate tab widths. This prevents inserting spaces instead
of tabs and keeps the tab width to eight instead of four or two.

While we are here, remove the "editor.wordWrap" settings. The editor's
word wrap is only cosmetic: it does not actually insert newlines when
your typing goes over the column limit. This can make it appear like you
have properly wrapped code, but it is incorrect. Further, existing code
that is over the column limit is wrapped even if your editor window is
wider than the limit. This can make reading such code more difficult.
Without these lines, VS Code renders the lines accurately, without
"ghost" newlines.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoSync with Git 2.36.2
Junio C Hamano [Mon, 27 Jun 2022 19:36:11 +0000 (12:36 -0700)] 
Sync with Git 2.36.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoGit 2.37 v2.37.0
Junio C Hamano [Mon, 27 Jun 2022 16:17:55 +0000 (09:17 -0700)] 
Git 2.37

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge branch 'jc/revert-show-parent-info'
Junio C Hamano [Mon, 27 Jun 2022 16:13:41 +0000 (09:13 -0700)] 
Merge branch 'jc/revert-show-parent-info'

* jc/revert-show-parent-info:
  revert: config documentation fixes

22 months agoMerge tag 'l10n-2.37.0-rnd1' of https://github.com/git-l10n/git-po
Junio C Hamano [Mon, 27 Jun 2022 15:39:10 +0000 (08:39 -0700)] 
Merge tag 'l10n-2.37.0-rnd1' of https://github.com/git-l10n/git-po

l10n-2.37.0-rnd1

* tag 'l10n-2.37.0-rnd1' of https://github.com/git-l10n/git-po:
  l10n: sv.po: Update Swedish translation (5367t0f0u)
  l10n: ru.po: update Russian translation
  l10n: zh_TW: v2.37.0 round 1
  l10n: vi(5367t): Updated translation
  l10n: fr v2.37 round 1
  l10n: Update Catalan translation
  l10n: po-id for 2.37 (first batch)
  l10n: tr: v2.37.0 round #1
  l10n: README: fix typo
  l10n: TEAMS: Change German translation team leader
  l10n: de.po: Update German translation
  l10n: bg.po: Updated Bulgarian translation (5367t)
  l10n: zh_CN: v2.37.0 round 1
  l10n: es: update translation

22 months agorevert: config documentation fixes
René Scharfe [Sun, 26 Jun 2022 09:29:35 +0000 (11:29 +0200)] 
revert: config documentation fixes

43966ab315 (revert: optionally refer to commit in the "reference"
format, 2022-05-26) added the documentation file config/revert.txt.
Actually include it in config.txt.

Make is used with a bare infinitive after the object; remove the "to".

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agol10n: sv.po: Update Swedish translation (5367t0f0u)
Peter Krefting [Fri, 24 Jun 2022 20:23:54 +0000 (21:23 +0100)] 
l10n: sv.po: Update Swedish translation (5367t0f0u)

Run msgmerge with --no-location to drop file locations to decrease the
size of future patches. Also removed old translations.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
22 months agol10n: ru.po: update Russian translation
Dimitriy Ryazantcev [Mon, 20 Jun 2022 13:02:39 +0000 (16:02 +0300)] 
l10n: ru.po: update Russian translation

Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
22 months agoMerge branch 'l10n/zh_TW/220623' of github.com:l10n-tw/git-po
Jiang Xin [Sun, 26 Jun 2022 05:54:26 +0000 (13:54 +0800)] 
Merge branch 'l10n/zh_TW/220623' of github.com:l10n-tw/git-po

* 'l10n/zh_TW/220623' of github.com:l10n-tw/git-po:
  l10n: zh_TW: v2.37.0 round 1

22 months agol10n: zh_TW: v2.37.0 round 1
Yi-Jyun Pan [Thu, 23 Jun 2022 13:08:28 +0000 (21:08 +0800)] 
l10n: zh_TW: v2.37.0 round 1

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
22 months agoMerge branch 'master' of github.com:vnwildman/git
Jiang Xin [Sat, 25 Jun 2022 03:01:20 +0000 (11:01 +0800)] 
Merge branch 'master' of github.com:vnwildman/git

* 'master' of github.com:vnwildman/git:
  l10n: vi(5367t): Updated translation

22 months agol10n: vi(5367t): Updated translation
Tran Ngoc Quan [Sat, 25 Jun 2022 01:40:42 +0000 (08:40 +0700)] 
l10n: vi(5367t): Updated translation

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
22 months agol10n: fr v2.37 round 1
Jean-Noël Avila [Fri, 24 Jun 2022 09:04:25 +0000 (11:04 +0200)] 
l10n: fr v2.37 round 1

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
22 months agol10n: Update Catalan translation
Jordi Mas [Fri, 24 Jun 2022 11:30:45 +0000 (13:30 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
22 months agoMerge branch 'ab/credentials-in-url-more'
Junio C Hamano [Thu, 23 Jun 2022 20:22:35 +0000 (13:22 -0700)] 
Merge branch 'ab/credentials-in-url-more'

* ab/credentials-in-url-more:
  Documentation/config/transfer.txt: fix typo

22 months agoDocumentation/config/transfer.txt: fix typo
Taylor Blau [Thu, 23 Jun 2022 19:02:01 +0000 (15:02 -0400)] 
Documentation/config/transfer.txt: fix typo

Commit 7281c196b1 (transfer doc: move fetch.credentialsInUrl to
"transfer" config namespace, 2022-06-15) propagates a typo from
6dcbdc0d66 (remote: create fetch.credentialsInUrl config, 2022-06-06),
where "other" is misspelled as "oher". Fix the typo accordingly.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agorev-parse: documentation adjustment - mention remote tracking with @{u}
Tao Klerks [Thu, 23 Jun 2022 05:01:52 +0000 (05:01 +0000)] 
rev-parse: documentation adjustment - mention remote tracking with @{u}

The documentation explained the conversion from remote branch path to
local tracking ref path for @{push}, but not for @{upstream}.

Add the explanation to @{upstream}, and reference it in @{push} to avoid
undue repetition.

Signed-off-by: Tao Klerks <tao@klerks.biz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Thu, 23 Jun 2022 13:01:47 +0000 (21:01 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.37 (first batch)

22 months agoGit 2.36.2 v2.36.2
Johannes Schindelin [Thu, 23 Jun 2022 10:36:14 +0000 (12:36 +0200)] 
Git 2.36.2

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
22 months agoSync with 2.35.4
Johannes Schindelin [Thu, 23 Jun 2022 10:36:12 +0000 (12:36 +0200)] 
Sync with 2.35.4

* maint-2.35:
  Git 2.35.4
  Git 2.34.4
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

22 months agoGit 2.35.4 v2.35.4
Johannes Schindelin [Thu, 23 Jun 2022 10:36:05 +0000 (12:36 +0200)] 
Git 2.35.4

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
22 months agoSync with 2.34.4
Johannes Schindelin [Thu, 23 Jun 2022 10:36:03 +0000 (12:36 +0200)] 
Sync with 2.34.4

* maint-2.34:
  Git 2.34.4
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

22 months agoGit 2.34.4 v2.34.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:49 +0000 (12:35 +0200)] 
Git 2.34.4

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
22 months agoSync with 2.33.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:47 +0000 (12:35 +0200)] 
Sync with 2.33.4

* maint-2.33:
  Git 2.33.4
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

22 months agoGit 2.33.4 v2.33.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:41 +0000 (12:35 +0200)] 
Git 2.33.4

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
22 months agoSync with 2.32.3
Johannes Schindelin [Thu, 23 Jun 2022 10:35:38 +0000 (12:35 +0200)] 
Sync with 2.32.3

* maint-2.32:
  Git 2.32.3
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

22 months agoGit 2.32.3 v2.32.3
Johannes Schindelin [Thu, 23 Jun 2022 10:35:32 +0000 (12:35 +0200)] 
Git 2.32.3

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
22 months agoSync with 2.31.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:30 +0000 (12:35 +0200)] 
Sync with 2.31.4

* maint-2.31:
  Git 2.31.4
  Git 2.30.5
  setup: tighten ownership checks post CVE-2022-24765
  git-compat-util: allow root to access both SUDO_UID and root owned
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo