]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
20 months agoMerge branch 'ds/omit-trailing-hash-in-index'
Junio C Hamano [Mon, 16 Jan 2023 20:07:47 +0000 (12:07 -0800)] 
Merge branch 'ds/omit-trailing-hash-in-index'

Introduce an optional configuration to allow the trailing hash that
protects the index file from bit flipping.

* ds/omit-trailing-hash-in-index:
  features: feature.manyFiles implies fast index writes
  test-lib-functions: add helper for trailing hash
  read-cache: add index.skipHash config option
  hashfile: allow skipping the hash function

20 months agoMerge branch 'ws/single-file-cone'
Junio C Hamano [Mon, 16 Jan 2023 20:07:47 +0000 (12:07 -0800)] 
Merge branch 'ws/single-file-cone'

The logic to see if we are using the "cone" mode by checking the
sparsity patterns has been tightened to avoid mistaking a pattern
that names a single file as specifying a cone.

* ws/single-file-cone:
  dir: check for single file cone patterns

20 months agoMerge branch 'jk/ext-diff-with-relative'
Junio C Hamano [Mon, 16 Jan 2023 20:07:46 +0000 (12:07 -0800)] 
Merge branch 'jk/ext-diff-with-relative'

"git diff --relative" did not mix well with "git diff --ext-diff",
which has been corrected.

* jk/ext-diff-with-relative:
  diff: drop "name" parameter from prepare_temp_file()
  diff: clean up external-diff argv setup
  diff: use filespec path to set up tempfiles for ext-diff

20 months agoMerge branch 'ds/bundle-uri-4'
Junio C Hamano [Mon, 16 Jan 2023 20:07:46 +0000 (12:07 -0800)] 
Merge branch 'ds/bundle-uri-4'

Code clean-up.

* ds/bundle-uri-4:
  test-bundle-uri: drop unused variables

20 months agoMerge branch 'tr/am--no-verify'
Junio C Hamano [Mon, 16 Jan 2023 20:07:46 +0000 (12:07 -0800)] 
Merge branch 'tr/am--no-verify'

Conditionally skip the pre-applypatch and applypatch-msg hooks when
applying patches with 'git am'.

* tr/am--no-verify:
  am: allow passing --no-verify flag

20 months agoMerge branch 'tb/ci-concurrency'
Junio C Hamano [Mon, 16 Jan 2023 20:07:46 +0000 (12:07 -0800)] 
Merge branch 'tb/ci-concurrency'

Avoid unnecessary builds in CI, with settings configured in
ci-config.

* tb/ci-concurrency:
  ci: avoid unnecessary builds

20 months agoMerge branch 'pw/ci-print-failure-name-fix'
Junio C Hamano [Mon, 16 Jan 2023 20:07:45 +0000 (12:07 -0800)] 
Merge branch 'pw/ci-print-failure-name-fix'

(cosmetic) CI regression fix.

* pw/ci-print-failure-name-fix:
  ci(github): restore "print test failures" step name

20 months agoMerge branch 'es/t1509-root-fixes'
Junio C Hamano [Mon, 16 Jan 2023 20:07:45 +0000 (12:07 -0800)] 
Merge branch 'es/t1509-root-fixes'

Test fixes.

* es/t1509-root-fixes:
  t1509: facilitate repeated script invocations
  t1509: make "setup" test more robust
  t1509: fix failing "root work tree" test due to owner-check

20 months agoThe sixth batch
Junio C Hamano [Sun, 8 Jan 2023 03:38:15 +0000 (12:38 +0900)] 
The sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoMerge branch 'cw/ci-whitespace'
Junio C Hamano [Sun, 8 Jan 2023 04:25:19 +0000 (13:25 +0900)] 
Merge branch 'cw/ci-whitespace'

CI updates.  We probably want a clean-up to move the long shell
script embedded in yaml file into a separate file, but that can
come later.

* cw/ci-whitespace:
  ci (check-whitespace): move to actions/checkout@v3
  ci (check-whitespace): add links to job output
  ci (check-whitespace): suggest fixes for errors

20 months agoMerge branch 'js/drop-mingw-test-cmp'
Junio C Hamano [Sun, 8 Jan 2023 04:25:19 +0000 (13:25 +0900)] 
Merge branch 'js/drop-mingw-test-cmp'

Use `git diff --no-index` as a test_cmp on Windows.

We'd probably need to revisit "do we really want to, and have to,
lose CRLF vs LF?" later, at which time we may be able to further
clean this up by replacing "git diff --no-index" with "diff -u".

* js/drop-mingw-test-cmp:
  tests(mingw): avoid very slow `mingw_test_cmp`

20 months agoMerge branch 'js/ci-disable-cmake-by-default'
Junio C Hamano [Sun, 8 Jan 2023 04:25:19 +0000 (13:25 +0900)] 
Merge branch 'js/ci-disable-cmake-by-default'

Stop running win+VS build by default.

* js/ci-disable-cmake-by-default:
  ci: only run win+VS build & tests in Git for Windows' fork

20 months agofeatures: feature.manyFiles implies fast index writes
Derrick Stolee [Fri, 6 Jan 2023 16:31:56 +0000 (16:31 +0000)] 
features: feature.manyFiles implies fast index writes

The recent addition of the index.skipHash config option allows index
writes to speed up by skipping the hash computation for the trailing
checksum. This is particularly critical for repositories with many files
at HEAD, so add this config option to two cases where users in that
scenario may opt-in to such behavior:

 1. The feature.manyFiles config option enables some options that are
    helpful for repositories with many files at HEAD.

 2. 'scalar register' and 'scalar reconfigure' set config options that
    optimize for large repositories.

In both of these cases, set index.skipHash=true to gain this
speedup. Add tests that demonstrate the proper way that
index.skipHash=true can override feature.manyFiles=true.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agotest-lib-functions: add helper for trailing hash
Derrick Stolee [Fri, 6 Jan 2023 16:31:55 +0000 (16:31 +0000)] 
test-lib-functions: add helper for trailing hash

It can be helpful to check that a file format with a trailing hash has a
specific hash in the final bytes of a written file. This is made more
apparent by recent changes that allow skipping the hash algorithm and
writing a null hash at the end of the file instead.

Add a new test_trailing_hash helper and use it in t1600 to verify that
index.skipHash=true really does skip the hash computation, since
'git fsck' does not actually verify the hash. This confirms that when
the config is disabled explicitly in a super project but enabled in a
submodule, then the use of repo_config_get_bool() loads config from the
correct repository in the case of 'git add'. There are other cases where
istate->repo is NULL and thus this config is loaded instead from
the_repository, but that's due to many different code paths initializing
index_state structs in their own way.

Keep the 'git fsck' call to ensure that any potential future change to
check the index hash does not cause an error in this case.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoread-cache: add index.skipHash config option
Derrick Stolee [Fri, 6 Jan 2023 16:31:54 +0000 (16:31 +0000)] 
read-cache: add index.skipHash config option

The previous change allowed skipping the hashing portion of the
hashwrite API, using it instead as a buffered write API. Disabling the
hashwrite can be particularly helpful when the write operation is in a
critical path.

One such critical path is the writing of the index. This operation is so
critical that the sparse index was created specifically to reduce the
size of the index to make these writes (and reads) faster.

This trade-off between file stability at rest and write-time performance
is not easy to balance. The index is an interesting case for a couple
reasons:

1. Writes block users. Writing the index takes place in many user-
   blocking foreground operations. The speed improvement directly
   impacts their use. Other file formats are typically written in the
   background (commit-graph, multi-pack-index) or are super-critical to
   correctness (pack-files).

2. Index files are short lived. It is rare that a user leaves an index
   for a long time with many staged changes. Outside of staged changes,
   the index can be completely destroyed and rewritten with minimal
   impact to the user.

Following a similar approach to one used in the microsoft/git fork [1],
add a new config option (index.skipHash) that allows disabling this
hashing during the index write. The cost is that we can no longer
validate the contents for corruption-at-rest using the trailing hash.

[1] https://github.com/microsoft/git/commit/21fed2d91410f45d85279467f21d717a2db45201

We load this config from the repository config given by istate->repo,
with a fallback to the_repository if it is not set.

While older Git versions will not recognize the null hash as a special
case, the file format itself is still being met in terms of its
structure. Using this null hash will still allow Git operations to
function across older versions.

The one exception is 'git fsck' which checks the hash of the index file.
This used to be a check on every index read, but was split out to just
the index in a33fc72fe91 (read-cache: force_verify_index_checksum,
2017-04-14) and released first in Git 2.13.0. Document the versions that
relaxed these restrictions, with the optimistic expectation that this
change will be included in Git 2.40.0.

Here, we disable this check if the trailing hash is all zeroes. We add a
warning to the config option that this may cause undesirable behavior
with older Git versions.

As a quick comparison, I tested 'git update-index --force-write' with
and without index.skipHash=true on a copy of the Linux kernel
repository.

Benchmark 1: with hash
  Time (mean ± σ):      46.3 ms ±  13.8 ms    [User: 34.3 ms, System: 11.9 ms]
  Range (min … max):    34.3 ms …  79.1 ms    82 runs

Benchmark 2: without hash
  Time (mean ± σ):      26.0 ms ±   7.9 ms    [User: 11.8 ms, System: 14.2 ms]
  Range (min … max):    16.3 ms …  42.0 ms    69 runs

Summary
  'without hash' ran
    1.78 ± 0.76 times faster than 'with hash'

These performance benefits are substantial enough to allow users the
ability to opt-in to this feature, even with the potential confusion
with older 'git fsck' versions.

Test this new config option, both at a command-line level and within a
submodule. The confirmation is currently limited to confirm that 'git
fsck' does not complain about the index. Future updates will make this
test more robust.

It is critical that this test is placed before the test_index_version
tests, since those tests obliterate the .git/config file and hence lose
the setting from GIT_TEST_DEFAULT_HASH, if set.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agohashfile: allow skipping the hash function
Derrick Stolee [Fri, 6 Jan 2023 16:31:53 +0000 (16:31 +0000)] 
hashfile: allow skipping the hash function

The hashfile API is useful for generating files that include a trailing
hash of the file's contents up to that point. Using such a hash is
helpful for verifying the file for corruption-at-rest, such as a faulty
drive causing flipped bits.

Git's index file includes this trailing hash, so it uses a 'struct
hashfile' to handle the I/O to the file. This was very convenient to
allow using the hashfile methods during these operations.

However, hashing the file contents during write comes at a performance
penalty. It's slower to hash the bytes on their way to the disk than
without that step. This problem is made worse by the replacement of
hardware-accelerated SHA1 computations with the software-based sha1dc
computation.

This write cost is significant, and the checksum capability is likely
not worth that cost for such a short-lived file. The index is rewritten
frequently and the only time the checksum is checked is during 'git
fsck'. Thus, it would be helpful to allow a user to opt-out of the hash
computation.

We first need to allow Git to opt-out of the hash computation in the
hashfile API. The buffered writes of the API are still helpful, so it
makes sense to make the change here.

Introduce a new 'skip_hash' option to 'struct hashfile'. When set, the
update_fn and final_fn members of the_hash_algo are skipped. When
finalizing the hashfile, the trailing hash is replaced with the null
hash.

This use of a trailing null hash would be desireable in either case,
since we do not want to special case a file format to have a different
length depending on whether it was hashed or not. When the final bytes
of a file are all zero, we can infer that it was written without
hashing, and thus that verification is not available as a check for file
consistency. This also means that we could easily toggle hashing for any
file format we desire.

A version of this patch has existed in the microsoft/git fork since
2017 [1] (the linked commit was rebased in 2018, but the original dates
back to January 2017). Here, the change to make the index use this fast
path is delayed until a later change.

[1] https://github.com/microsoft/git/commit/21fed2d91410f45d85279467f21d717a2db45201

Co-authored-by: Kevin Willford <kewillf@microsoft.com>
Signed-off-by: Kevin Willford <kewillf@microsoft.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agodiff: drop "name" parameter from prepare_temp_file()
Jeff King [Fri, 6 Jan 2023 11:05:00 +0000 (06:05 -0500)] 
diff: drop "name" parameter from prepare_temp_file()

The prepare_temp_file() function takes a diff_filespec as well as a
filename. But it is almost certainly an error to pass in a name that
isn't the filespec's "path" parameter, since that is the only thing that
reliably tells us how to find the content (and indeed, this was the
source of a recently-fixed bug).

So let's drop the redundant "name" parameter and just use one->path
throughout the function. This simplifies the interface a little bit, and
makes it impossible for calling code to get it wrong.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agodiff: clean up external-diff argv setup
Jeff King [Fri, 6 Jan 2023 11:04:18 +0000 (06:04 -0500)] 
diff: clean up external-diff argv setup

Since the previous commit, setting up the tempfile for an external diff
uses df->path from the diff_filespec, rather than the logical name. This
means add_external_diff_name() does not need to take a "name" parameter
at all, and we can drop it. And that in turn lets us simplify the
conditional for handling renames (when the "other" name is non-NULL).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agodiff: use filespec path to set up tempfiles for ext-diff
Jeff King [Fri, 6 Jan 2023 11:03:57 +0000 (06:03 -0500)] 
diff: use filespec path to set up tempfiles for ext-diff

When we're going to run an external diff, we have to make the contents
of the pre- and post-images available either by dumping them to a
tempfile, or by pointing at a valid file in the worktree. The logic of
this is all handled by prepare_temp_file(), and we just pass in the
filename and the diff_filespec.

But there's a gotcha here. The "filename" we have is a logical filename
and not necessarily a path on disk or in the repository. This matters in
at least one case: when using "--relative", we may have a name like
"foo", even though the file content is found at "subdir/foo". As a
result, we look for the wrong path, fail to find "foo", and claim that
the file has been deleted (passing "/dev/null" to the external diff,
rather than the correct worktree path).

We can fix this by passing the pathname from the diff_filespec, which
should always be a full repository path (and that's what we want even if
reusing a worktree file, since we're always operating from the top-level
of the working tree).

The breakage seems to go all the way back to cd676a5136 (diff
--relative: output paths as relative to the current subdirectory,
2008-02-12). As far as I can tell, before then "name" would always have
been the same as the filespec's "path".

There are two related cases I looked at that aren't buggy:

  1. the only other caller of prepare_temp_file() is run_textconv(). But
     it always passes the filespec's path field, so it's OK.

  2. I wondered if file renames/copies might cause similar confusion.
     But they don't, because run_external_diff() receives two names in
     that case: "name" and "other", which correspond to the two sides of
     the diff. And we did correctly pass "other" when handling the
     post-image side. Barring the use of "--relative", that would always
     match "two->path", the path of the second filespec (and the rename
     destination).

So the only bug is just the interaction with external diff drivers and
--relative.

Reported-by: Carl Baldwin <carl@ecbaldwin.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agotest-bundle-uri: drop unused variables
Jeff King [Fri, 6 Jan 2023 08:48:23 +0000 (03:48 -0500)] 
test-bundle-uri: drop unused variables

Commit 70b9c10373 (bundle-uri client: add helper for testing server,
2022-12-22) added a cmd_ls_remote() function which contains "uploadpack"
and "server_options" variables. Neither of these variables is ever
modified after being initialized, so the code to handle non-NULL and
non-empty values is impossible to reach.

While in theory we might add command-line parsing to set these, let's
drop the dead code for now in the name of cleanliness. It's easy enough
to add it back later if need be.

Noticed by Coverity.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoThe fifth batch
Junio C Hamano [Thu, 5 Jan 2023 06:00:42 +0000 (15:00 +0900)] 
The fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoMerge branch 'ab/no-more-git-global-super-prefix'
Junio C Hamano [Thu, 5 Jan 2023 06:07:22 +0000 (15:07 +0900)] 
Merge branch 'ab/no-more-git-global-super-prefix'

Stop using "git --super-prefix" and narrow the scope of its use to
the submodule--helper.

* ab/no-more-git-global-super-prefix:
  read-tree: add "--super-prefix" option, eliminate global
  submodule--helper: convert "{update,clone}" to their own "--super-prefix"
  submodule--helper: convert "status" to its own "--super-prefix"
  submodule--helper: convert "sync" to its own "--super-prefix"
  submodule--helper: convert "foreach" to its own "--super-prefix"
  submodule--helper: don't use global --super-prefix in "absorbgitdirs"
  submodule.c & submodule--helper: pass along "super_prefix" param
  read-tree + fetch tests: test failing "--super-prefix" interaction
  submodule absorbgitdirs tests: add missing "Migrating git..." tests

20 months agoMerge branch 'ab/bundle-wo-args'
Junio C Hamano [Thu, 5 Jan 2023 06:07:22 +0000 (15:07 +0900)] 
Merge branch 'ab/bundle-wo-args'

Fix to a small regression in 2.38 days.

* ab/bundle-wo-args:
  bundle <cmd>: have usage_msg_opt() note the missing "<file>"
  builtin/bundle.c: remove superfluous "newargc" variable
  bundle: don't segfault on "git bundle <subcmd>"

20 months agoMerge branch 'km/doc-branch-start-point'
Junio C Hamano [Thu, 5 Jan 2023 06:07:21 +0000 (15:07 +0900)] 
Merge branch 'km/doc-branch-start-point'

Typofix.

* km/doc-branch-start-point:
  doc/git-branch: fix --force description typo

20 months agoMerge branch 'ar/typofix-gitattributes-doc'
Junio C Hamano [Thu, 5 Jan 2023 06:07:21 +0000 (15:07 +0900)] 
Merge branch 'ar/typofix-gitattributes-doc'

Typofix.

* ar/typofix-gitattributes-doc:
  gitattributes.txt: fix typo in "comma separated"

20 months agoMerge branch 'sg/test-oid-wo-incomplete-line'
Junio C Hamano [Thu, 5 Jan 2023 06:07:18 +0000 (15:07 +0900)] 
Merge branch 'sg/test-oid-wo-incomplete-line'

Test helper updates.

* sg/test-oid-wo-incomplete-line:
  tests: make 'test_oid' print trailing newline

20 months agoMerge branch 'dh/mingw-ownership-check-typofix'
Junio C Hamano [Thu, 5 Jan 2023 06:07:18 +0000 (15:07 +0900)] 
Merge branch 'dh/mingw-ownership-check-typofix'

Error message typofix.

* dh/mingw-ownership-check-typofix:
  mingw: fix typo in an error message from ownership check

20 months agoMerge branch 'jt/avoid-lazy-fetch-commits'
Junio C Hamano [Thu, 5 Jan 2023 06:07:17 +0000 (15:07 +0900)] 
Merge branch 'jt/avoid-lazy-fetch-commits'

Even in a repository with promisor remote, it is useless to
attempt to lazily attempt fetching an object that is expected to be
commit, because no "filter" mode omits commit objects.  Take
advantage of this assumption to fail fast on errors.

* jt/avoid-lazy-fetch-commits:
  commit: don't lazy-fetch commits
  object-file: emit corruption errors when detected
  object-file: refactor map_loose_object_1()
  object-file: remove OBJECT_INFO_IGNORE_LOOSE

20 months agoMerge branch 'sa/cat-file-mailmap--batch-check'
Junio C Hamano [Thu, 5 Jan 2023 06:07:17 +0000 (15:07 +0900)] 
Merge branch 'sa/cat-file-mailmap--batch-check'

'cat-file' gains mailmap support for its '--batch-check' and '-s'
options.

* sa/cat-file-mailmap--batch-check:
  cat-file: add mailmap support to --batch-check option
  cat-file: add mailmap support to -s option

20 months agoam: allow passing --no-verify flag
Thierry Reding [Wed, 30 Nov 2022 17:28:33 +0000 (18:28 +0100)] 
am: allow passing --no-verify flag

The git-am --no-verify flag is analogous to the same flag passed to
git-commit. It bypasses the pre-applypatch and applypatch-msg hooks
if they are enabled.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agodir: check for single file cone patterns
William Sprent [Tue, 3 Jan 2023 08:20:59 +0000 (08:20 +0000)] 
dir: check for single file cone patterns

The sparse checkout documentation states that the cone mode pattern set
is limited to patterns that either recursively include directories or
patterns that match all files in a directory. In the sparse checkout
file, the former manifest in the form:

    /A/B/C/

while the latter become a pair of patterns either in the form:

    /A/B/
    !/A/B/*/

or in the special case of matching the toplevel files:

    /*
    !/*/

The 'add_pattern_to_hashsets()' function contains checks which serve to
disable cone-mode when non-cone patterns are encountered. However, these
do not catch when the pattern list attempts to match a single file or
directory, e.g. a pattern in the form:

    /A/B/C

This causes sparse-checkout to exhibit unexpected behaviour when such a
pattern is in the sparse-checkout file and cone mode is enabled.
Concretely, with the pattern like the above, sparse-checkout, in
non-cone mode, will only include the directory or file located at
'/A/B/C'. However, with cone mode enabled, sparse-checkout will instead
just manifest the toplevel files but not any file located at '/A/B/C'.

Relatedly, issues occur when supplying the same kind of filter when
partial cloning with '--filter=sparse:oid=<oid>'. 'upload-pack' will
correctly just include the objects that match the non-cone pattern
matching. Which means that checking out the newly cloned repo with the
same filter, but with cone mode enabled, fails due to missing objects.

To fix these issues, add a cone mode pattern check that asserts that
every pattern is either a directory match or the pattern '/*'. Add a
test to verify the new pattern check and modify another to reflect that
non-directory patterns are caught earlier.

Signed-off-by: William Sprent <williams@unity3d.com>
Acked-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoci(github): restore "print test failures" step name
Phillip Wood [Tue, 3 Jan 2023 10:27:20 +0000 (10:27 +0000)] 
ci(github): restore "print test failures" step name

As well as removing the explicit shell setting d8b21a0fe2 (CI: don't
explicitly pick "bash" shell outside of Windows, fix regression,
2022-12-07) also reverted the name of the print test failures step
introduced by 5aeb145780f (ci(github): bring back the 'print test
failures' step, 2022-06-08). This is unfortunate as 5aeb145780f added a
message to direct contributors to the "print test failures" step when a
test fails and that step is no-longer known by that name on the
non-windows ci jobs.

In principle we could update the message to print the correct name for
the step but then we'd have to deal with having two different names for
the same step on different jobs. It is simpler for the implementation
and contributors to use the same name for this step on all jobs.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoThe fourth batch
Junio C Hamano [Mon, 2 Jan 2023 10:04:26 +0000 (19:04 +0900)] 
The fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoMerge branch 'ps/fsync-refs-fix'
Junio C Hamano [Mon, 2 Jan 2023 12:37:19 +0000 (21:37 +0900)] 
Merge branch 'ps/fsync-refs-fix'

Fix the sequence to fsync $GIT_DIR/packed-refs file that forgot to
flush its output to the disk..

* ps/fsync-refs-fix:
  refs: fix corruption by not correctly syncing packed-refs to disk

20 months agoMerge branch 'sk/win32-pthread-exit-fix'
Junio C Hamano [Mon, 2 Jan 2023 12:37:19 +0000 (21:37 +0900)] 
Merge branch 'sk/win32-pthread-exit-fix'

An API emulation fix.

* sk/win32-pthread-exit-fix:
  win32: use _endthreadex to terminate threads, not ExitThread

20 months agoMerge branch 'ew/format-patch-mboxrd'
Junio C Hamano [Mon, 2 Jan 2023 12:37:19 +0000 (21:37 +0900)] 
Merge branch 'ew/format-patch-mboxrd'

"git format-patch" learned to honor format.mboxrd even when sending
patches to the standard output stream,

* ew/format-patch-mboxrd:
  format-patch: support format.mboxrd with --stdout

20 months agoMerge branch 'ds/bundle-uri-4'
Junio C Hamano [Mon, 2 Jan 2023 12:37:18 +0000 (21:37 +0900)] 
Merge branch 'ds/bundle-uri-4'

Bundle URIs part 4.

* ds/bundle-uri-4:
  clone: unbundle the advertised bundles
  bundle-uri: download bundles from an advertised list
  bundle-uri: allow relative URLs in bundle lists
  strbuf: introduce strbuf_strip_file_from_path()
  bundle-uri: serve bundle.* keys from config
  bundle-uri client: add helper for testing server
  transport: rename got_remote_heads
  bundle-uri client: add boolean transfer.bundleURI setting
  clone: request the 'bundle-uri' command when available
  t: create test harness for 'bundle-uri' command
  protocol v2: add server-side "bundle-uri" skeleton

20 months agoMerge branch 'lk/line-range-parsing-fix'
Junio C Hamano [Mon, 2 Jan 2023 12:37:18 +0000 (21:37 +0900)] 
Merge branch 'lk/line-range-parsing-fix'

When given a pattern that matches an empty string at the end of a
line, the code to parse the "git diff" line-ranges fell into an
infinite loop, which has been corrected.

* lk/line-range-parsing-fix:
  line-range: fix infinite loop bug with '$' regex

20 months agoThe third batch
Junio C Hamano [Wed, 28 Dec 2022 01:53:44 +0000 (10:53 +0900)] 
The third batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoMerge branch 'sa/git-var-sequence-editor'
Junio C Hamano [Wed, 28 Dec 2022 03:06:17 +0000 (12:06 +0900)] 
Merge branch 'sa/git-var-sequence-editor'

Just like "git var GIT_EDITOR" abstracts the complex logic to
choose which editor gets used behind it, "git var" now give support
to GIT_SEQUENCE_EDITOR.

* sa/git-var-sequence-editor:
  var: add GIT_SEQUENCE_EDITOR variable

20 months agoMerge branch 'ss/pull-v-recurse-fix'
Junio C Hamano [Wed, 28 Dec 2022 03:06:16 +0000 (12:06 +0900)] 
Merge branch 'ss/pull-v-recurse-fix'

"git pull -v --recurse-submodules" attempted to pass "-v" down to
underlying "git submodule update", which did not understand the
request and barfed, which has been corrected.

* ss/pull-v-recurse-fix:
  submodule: accept -v for the update command

20 months agobundle <cmd>: have usage_msg_opt() note the missing "<file>"
Ævar Arnfjörð Bjarmason [Tue, 27 Dec 2022 18:39:10 +0000 (19:39 +0100)] 
bundle <cmd>: have usage_msg_opt() note the missing "<file>"

Improve the usage we emit on e.g. "git bundle create" to note why
we're showing the usage, it's because the "<file>" argument is
missing.

We know that'll be the case for all parse_options_cmd_bundle() users,
as they're passing the "char **bundle_file" parameter, which as the
context shows we're expected to populate.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agobuiltin/bundle.c: remove superfluous "newargc" variable
Ævar Arnfjörð Bjarmason [Tue, 27 Dec 2022 18:39:09 +0000 (19:39 +0100)] 
builtin/bundle.c: remove superfluous "newargc" variable

As noted in 891cb09db6c (bundle: don't segfault on "git bundle
<subcmd>", 2022-12-20) the "newargc" in this function is redundant to
using our own "argc". Let's refactor the function to avoid needlessly
introducing another variable.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agogitattributes.txt: fix typo in "comma separated"
Andrei Rybak [Tue, 27 Dec 2022 21:01:56 +0000 (22:01 +0100)] 
gitattributes.txt: fix typo in "comma separated"

Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agodoc/git-branch: fix --force description typo
Kyle Meyer [Mon, 26 Dec 2022 16:54:41 +0000 (11:54 -0500)] 
doc/git-branch: fix --force description typo

Update the description of --force to use '<start-point>' rather than
'<startpoint>' to match the spelling used everywhere else in the
git-branch documentation.

Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoThe second batch
Junio C Hamano [Mon, 26 Dec 2022 02:42:31 +0000 (11:42 +0900)] 
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoMerge branch 'ab/darwin-default-to-sha1dc'
Junio C Hamano [Mon, 26 Dec 2022 02:42:07 +0000 (11:42 +0900)] 
Merge branch 'ab/darwin-default-to-sha1dc'

Use the SHA1DC implementation on macOS, just like other platforms,
by default.

* ab/darwin-default-to-sha1dc:
  Makefile: use sha1collisiondetection by default on OSX and Darwin

20 months agoMerge branch 'sk/remove-duplicate-includes'
Junio C Hamano [Mon, 26 Dec 2022 02:42:07 +0000 (11:42 +0900)] 
Merge branch 'sk/remove-duplicate-includes'

Code clean-up.

* sk/remove-duplicate-includes:
  git: remove duplicate includes

20 months agoMerge branch 'pg/diff-stat-unmerged-regression-fix'
Junio C Hamano [Mon, 26 Dec 2022 02:42:07 +0000 (11:42 +0900)] 
Merge branch 'pg/diff-stat-unmerged-regression-fix'

The output from "git diff --stat" on an unmerged path lost the
terminating LF in Git 2.39, which has been corrected.

* pg/diff-stat-unmerged-regression-fix:
  diff: fix regression with --stat and unmerged file

20 months agoMerge branch 'jk/ref-filter-error-reporting-fix'
Junio C Hamano [Mon, 26 Dec 2022 02:42:06 +0000 (11:42 +0900)] 
Merge branch 'jk/ref-filter-error-reporting-fix'

Clean-ups in error messages produced by "git for-each-ref" and friends.

* jk/ref-filter-error-reporting-fix:
  ref-filter: convert email atom parser to use err_bad_arg()
  ref-filter: truncate atom names in error messages
  ref-filter: factor out "unrecognized %(foo) arg" errors
  ref-filter: factor out "%(foo) does not take arguments" errors
  ref-filter: reject arguments to %(HEAD)

20 months agoMerge branch 'rs/clarify-error-in-write-loose-object'
Junio C Hamano [Mon, 26 Dec 2022 02:42:06 +0000 (11:42 +0900)] 
Merge branch 'rs/clarify-error-in-write-loose-object'

Code clean-up.

* rs/clarify-error-in-write-loose-object:
  object-file: inline write_buffer()

20 months agoMerge branch 'rs/reflog-expiry-cleanup'
Junio C Hamano [Mon, 26 Dec 2022 02:42:06 +0000 (11:42 +0900)] 
Merge branch 'rs/reflog-expiry-cleanup'

Code clean-up.

* rs/reflog-expiry-cleanup:
  reflog: clear leftovers in reflog_expiry_cleanup()

20 months agoMerge branch 'rs/clear-commit-marks-cleanup'
Junio C Hamano [Mon, 26 Dec 2022 02:42:05 +0000 (11:42 +0900)] 
Merge branch 'rs/clear-commit-marks-cleanup'

Code clean-up.

* rs/clear-commit-marks-cleanup:
  commit: skip already cleared parents in clear_commit_marks_1()

20 months agoMerge branch 'rs/am-parse-options-cleanup'
Junio C Hamano [Mon, 26 Dec 2022 02:42:05 +0000 (11:42 +0900)] 
Merge branch 'rs/am-parse-options-cleanup'

Code clean-up.

* rs/am-parse-options-cleanup:
  am: don't pass strvec to apply_parse_options()

20 months agoMerge branch 'jk/server-supports-v2-cleanup'
Junio C Hamano [Mon, 26 Dec 2022 02:42:05 +0000 (11:42 +0900)] 
Merge branch 'jk/server-supports-v2-cleanup'

Code clean-up.

* jk/server-supports-v2-cleanup:
  server_supports_v2(): use a separate function for die_on_error

20 months agoMerge branch 'jk/unused-post-2.39'
Junio C Hamano [Mon, 26 Dec 2022 02:42:04 +0000 (11:42 +0900)] 
Merge branch 'jk/unused-post-2.39'

Code clean-up around unused function parameters.

* jk/unused-post-2.39:
  userdiff: mark unused parameter in internal callback
  list-objects-filter: mark unused parameters in virtual functions
  diff: mark unused parameters in callbacks
  xdiff: mark unused parameter in xdl_call_hunk_func()
  xdiff: drop unused parameter in def_ff()
  ws: drop unused parameter from ws_blank_line()
  list-objects: drop process_gitlink() function
  blob: drop unused parts of parse_blob_buffer()
  ls-refs: use repository parameter to iterate refs

20 months agoMerge branch 'jt/http-fetch-trace2-report-name'
Junio C Hamano [Mon, 26 Dec 2022 02:42:04 +0000 (11:42 +0900)] 
Merge branch 'jt/http-fetch-trace2-report-name'

"git http-fetch" (which is rarely used) forgot to identify itself
in the trace2 output.

* jt/http-fetch-trace2-report-name:
  http-fetch: invoke trace2_cmd_name()

20 months agoMerge branch 'sg/help-autocorrect-config-fix'
Junio C Hamano [Mon, 26 Dec 2022 02:42:04 +0000 (11:42 +0900)] 
Merge branch 'sg/help-autocorrect-config-fix'

The code to auto-correct a misspelt subcommand unnecessarily called
into git_default_config() from the early config codepath, which was
a no-no.  This has bee corrected.

* sg/help-autocorrect-config-fix:
  help.c: fix autocorrect in work tree for bare repository

20 months agoread-tree: add "--super-prefix" option, eliminate global
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2022 12:39:56 +0000 (13:39 +0100)] 
read-tree: add "--super-prefix" option, eliminate global

The "--super-prefix" option to "git" was initially added in [1] for
use with "ls-files"[2], and shortly thereafter "submodule--helper"[3]
and "grep"[4]. It wasn't until [5] that "read-tree" made use of it.

At the time [5] made sense, but since then we've made "ls-files"
recurse in-process in [6], "grep" in [7], and finally
"submodule--helper" in the preceding commits.

Let's also remove it from "read-tree", which allows us to remove the
option to "git" itself.

We can do this because the only remaining user of it is the submodule
API, which will now invoke "read-tree" with its new "--super-prefix"
option. It will only do so when the "submodule_move_head()" function
is called.

That "submodule_move_head()" function was then only invoked by
"read-tree" itself, but now rather than setting an environment
variable to pass "--super-prefix" between cmd_read_tree() we:

- Set a new "super_prefix" in "struct unpack_trees_options". The
  "super_prefixed()" function in "unpack-trees.c" added in [5] will now
  use this, rather than get_super_prefix() looking up the environment
  variable we set earlier in the same process.

- Add the same field to the "struct checkout", which is only needed to
  ferry the "super_prefix" in the "struct unpack_trees_options" all the
  way down to the "entry.c" callers of "submodule_move_head()".

  Those calls which used the super prefix all originated in
  "cmd_read_tree()". The only other caller is the "unlink_entry()"
  caller in "builtin/checkout.c", which now passes a "NULL".

1. 74866d75793 (git: make super-prefix option, 2016-10-07)
2. e77aa336f11 (ls-files: optionally recurse into submodules, 2016-10-07)
3. 89c86265576 (submodule helper: support super prefix, 2016-12-08)
4. 0281e487fd9 (grep: optionally recurse into submodules, 2016-12-16)
5. 3d415425c7b (unpack-trees: support super-prefix option, 2017-01-17)
6. 188dce131fa (ls-files: use repository object, 2017-06-22)
7. f9ee2fcdfa0 (grep: recurse in-process using 'struct repository', 2017-08-02)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agosubmodule--helper: convert "{update,clone}" to their own "--super-prefix"
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2022 12:39:55 +0000 (13:39 +0100)] 
submodule--helper: convert "{update,clone}" to their own "--super-prefix"

As with a preceding commit to convert "absorbgitdirs", we can convert
"submodule--helper status" to use its own "--super-prefix", instead of
relying on the global "--super-prefix" argument to "git".

We need to convert both of these away from the global "--super-prefix"
at the same time, because "update" will call "clone", but "clone"
itself didn't make use of the global "--super-prefix" for displaying
paths. It was only on the list of sub-commands that accepted it
because "update"'s use of it would set it in its environment.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agosubmodule--helper: convert "status" to its own "--super-prefix"
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2022 12:39:54 +0000 (13:39 +0100)] 
submodule--helper: convert "status" to its own "--super-prefix"

As with a preceding commit to convert "absorbgitdirs", we can convert
"submodule--helper status" to use its own "--super-prefix", instead of
relying on the global "--super-prefix" argument to "git" itself. See
that earlier commit for the rationale and background.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agosubmodule--helper: convert "sync" to its own "--super-prefix"
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2022 12:39:53 +0000 (13:39 +0100)] 
submodule--helper: convert "sync" to its own "--super-prefix"

As with a preceding commit to convert "absorbgitdirs", we can convert
"submodule--helper sync" to use its own "--super-prefix", instead of
relying on the global "--super-prefix" argument to "git" itself. See
that earlier commit for the rationale and background.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agosubmodule--helper: convert "foreach" to its own "--super-prefix"
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2022 12:39:52 +0000 (13:39 +0100)] 
submodule--helper: convert "foreach" to its own "--super-prefix"

As with a preceding commit to convert "absorbgitdirs", we can convert
"submodule--helper foreach" to use its own "--super-prefix", instead
of relying on the global "--super-prefix" argument to "git"
itself. See that earlier commit for the rationale and background.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agosubmodule--helper: don't use global --super-prefix in "absorbgitdirs"
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2022 12:39:51 +0000 (13:39 +0100)] 
submodule--helper: don't use global --super-prefix in "absorbgitdirs"

The "--super-prefix" facility was introduced in [1] has always been a
transitory hack, which is why we've made it an error to supply it as
an option to "git" to commands that don't know about it.

That's been a good goal, as it has a global effect we haven't wanted
calls to get_super_prefix() from built-ins we didn't expect.

But it has meant that when we've had chains of different built-ins
using it all of the processes in that "chain" have needed to support
it, and worse processes that don't need it have needed to ask for
"SUPPORT_SUPER_PREFIX" because their parent process needs it.

That's how "fsmonitor--daemon" ended up with it, per [2] it's called
from (among other things) "submodule--helper absorbgitdirs", but as we
declared "submodule--helper" as "SUPPORT_SUPER_PREFIX" we needed to
declare "fsmonitor--daemon" as accepting it too, even though it
doesn't care about it.

But in the case of "absorbgitdirs" it only needed "--super-prefix" to
invoke itself recursively, and we'd never have another "in-between"
process in the chain. So we didn't need the bigger hammer of "git
--super-prefix", and the "setenv(GIT_SUPER_PREFIX_ENVIRONMENT, ...)"
that it entails.

Let's instead accept a hidden "--super-prefix" option to
"submodule--helper absorbgitdirs" itself.

Eventually (as with all other "--super-prefix" users) we'll want to
clean this code up so that this all happens in-process. I.e. needing
any variant of "--super-prefix" is itself a hack around our various
global state, and implicit reliance on "the_repository". This stepping
stone makes such an eventual change easier, as we'll need to deal with
less global state at that point.

The "fsmonitor--daemon" test adjusted here was added in [3]. To assert
that it didn't run into the "--super-prefix" message it was asserting
the output it didn't have. Let's instead assert the full output that
we *do* have, using the same pattern as a preceding change to
"t/t7412-submodule-absorbgitdirs.sh" used.

We could also remove the test entirely (as [4] did), but even though
the initial reason for having it is gone we're still getting some
marginal benefit from testing the "fsmonitor" and "submodule
absorbgitdirs" interaction, so let's keep it.

The change here to have either a NULL or non-"" string as a
"super_prefix" instead of the previous arrangement of "" or non-"" is
somewhat arbitrary. We could also decide to never have to check for
NULL.

As we'll be changing the rest of the "git --super-prefix" users to the
same pattern, leaving them all consistent makes sense. Why not pick ""
over NULL? Because that's how the "prefix" works[5], and having
"prefix" and "super_prefix" work the same way will be less
confusing. That "prefix" picked NULL instead of "" is itself
arbitrary, but as it's easy to make this small bit of our overall API
consistent, let's go with that.

1. 74866d75793 (git: make super-prefix option, 2016-10-07)
2. 53fcfbc84f6 (fsmonitor--daemon: allow --super-prefix argument,
   2022-05-26)
3. 53fcfbc84f6 (fsmonitor--daemon: allow --super-prefix argument,
   2022-05-26)
4. https://lore.kernel.org/git/20221109004708.97668-5-chooglen@google.com/
5. 9725c8dda20 (built-ins: trust the "prefix" from run_builtin(),
   2022-02-16)

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agosubmodule.c & submodule--helper: pass along "super_prefix" param
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2022 12:39:50 +0000 (13:39 +0100)] 
submodule.c & submodule--helper: pass along "super_prefix" param

Start passing the "super_prefix" along as a parameter to
get_submodule_displaypath() and absorb_git_dir_into_superproject(),
rather than get the value directly as a global.

This is in preparation for subsequent commits, where we'll gradually
phase out get_super_prefix() for an alternative way of getting the
"super_prefix".

Most of the users of this get a get_super_prefix() value, either
directly or by indirection. The exceptions are:

- builtin/rm.c: Doesn't declare SUPPORT_SUPER_PREFIX, so we'd have
  died if this was provided, so it's safe to pass "NULL".

- deinit_submodule(): The "deinit_submodule()" function has never been
  able to use the "git -super-prefix". It will call
  "absorb_git_dir_into_superproject()", but it will only do so from the
  top-level project.

  If "absorbgitdirs" recurses will use the "path" passed to
  "absorb_git_dir_into_superproject()" in "deinit_submodule()" as its
  starting "--super-prefix". So we can safely remove the
  get_super_prefix() call here, and pass NULL instead.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoread-tree + fetch tests: test failing "--super-prefix" interaction
Glen Choo [Tue, 20 Dec 2022 12:39:49 +0000 (13:39 +0100)] 
read-tree + fetch tests: test failing "--super-prefix" interaction

Ever since "git fetch --refetch" was introduced in 0f5e8851737 (Merge
branch 'rc/fetch-refetch', 2022-04-04) the test being added here would
fail. This is because "restore" will "read-tree .. --reset <hash>",
which will in turn invoke "fetch". The "fetch" will then die with:

fatal: fetch doesn't support --super-prefix

This edge case and other "--super-prefix" bugs will be fixed in
subsequent commits, but let's first add a "test_expect_failure" test
for it. It passes until the very last command in the test.

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agosubmodule absorbgitdirs tests: add missing "Migrating git..." tests
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2022 12:39:48 +0000 (13:39 +0100)] 
submodule absorbgitdirs tests: add missing "Migrating git..." tests

Fix a blind spots in the tests surrounding "submodule absorbgitdirs"
and test what output we emit, and how emitted the message and behavior
interacts with a "git worktree" where the repository isn't at the base
of the working directory.

The "$(pwd)" instead of "$PWD" here is needed due to Windows, where
the latter will be a path like "/d/a/git/[...]", whereas we need
"D:/a/git/[...]".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agowin32: use _endthreadex to terminate threads, not ExitThread
Seija Kijin [Sun, 25 Dec 2022 01:41:50 +0000 (01:41 +0000)] 
win32: use _endthreadex to terminate threads, not ExitThread

Because we use the C runtime and
use _beginthreadex to create pthreads,
pthread_exit MUST use _endthreadex.

Otherwise, according to Microsoft:
"Failure to do so results in small
memory leaks when the thread
calls ExitThread."

Simply put, this is not the same as ExitThread.

Signed-off-by: Seija Kijin <doremylover123@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoformat-patch: support format.mboxrd with --stdout
Eric Wong [Thu, 22 Dec 2022 20:16:19 +0000 (20:16 +0000)] 
format-patch: support format.mboxrd with --stdout

mboxrd is a more robust output format when used with --stdout
and needs more exposure.  Introducing this config knob lets
users choose the more robust format for all their --stdout
uses.

Relying on --pretty=mboxrd and including all of pretty-formats.txt
in the `git format-patch' documentation would likely be
confusing to users.  Furthermore, this setting is useful across
multiple invocations.  So introduce `format.mboxrd' as a boolean
configuration knob that changes the default --pretty=email format
to --pretty=mboxrd when (and only when) --stdout is in use.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoclone: unbundle the advertised bundles
Derrick Stolee [Thu, 22 Dec 2022 15:14:17 +0000 (15:14 +0000)] 
clone: unbundle the advertised bundles

A previous change introduced the transport methods to acquire a bundle
list from the 'bundle-uri' protocol v2 command, when advertised _and_
when the client has chosen to enable the feature.

Teach Git to download and unbundle the data advertised by those bundles
during 'git clone'. This takes place between the ref advertisement and
the object data download, and stateful connections will linger while
the client downloads bundles. In the future, we should consider closing
the remote connection during this process.

Also, since the --bundle-uri option exists, we do not want to mix the
advertised bundles with the user-specified bundles.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agobundle-uri: download bundles from an advertised list
Derrick Stolee [Thu, 22 Dec 2022 15:14:16 +0000 (15:14 +0000)] 
bundle-uri: download bundles from an advertised list

The logic in fetch_bundle_uri() is useful for the --bundle-uri option of
'git clone', but is not helpful when the clone operation discovers a
list of URIs from the bundle-uri protocol v2 command. To actually
download and unbundle the advertised bundles, we need a different
mechanism.

Create the new fetch_bundle_list() method which is very similar to
fetch_bundle_uri() except that it relies on download_bundle_list()
instead of fetch_bundle_uri_internal(). The download_bundle_list()
method will recursively call fetch_bundle_uri_internal() if any of the
advertised URIs serve a bundle list instead of a bundle. This will also
follow the bundle.list.mode setting from the input list: "any" will
download only one such URI while "all" will download data from all of
the URIs.

In an identical way to fetch_bundle_uri(), the bundles are unbundled
after all of the bundle lists have been expanded and all necessary URIs.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agobundle-uri: allow relative URLs in bundle lists
Derrick Stolee [Thu, 22 Dec 2022 15:14:15 +0000 (15:14 +0000)] 
bundle-uri: allow relative URLs in bundle lists

Bundle providers may want to distribute that data across multiple CDNs.
This might require a change in the base URI, all the way to the domain
name. If all bundles require an absolute URI in their 'uri' value, then
every push to a CDN would require altering the table of contents to
match the expected domain and exact location within it.

Allow a bundle list to specify a relative URI for the bundles. This URI
is based on where the client received the bundle list. For a list
provided in the 'bundle-uri' protocol v2 command, the Git remote URI is
the base URI. Otherwise, the bundle list was provided from an HTTP URI
not using the Git protocol, and that URI is the base URI. This allows
easier distribution of bundle data.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agostrbuf: introduce strbuf_strip_file_from_path()
Derrick Stolee [Thu, 22 Dec 2022 15:14:14 +0000 (15:14 +0000)] 
strbuf: introduce strbuf_strip_file_from_path()

The strbuf_parent_directory() method was added as a static method in
contrib/scalar by d0feac4e8c0 (scalar: 'register' sets recommended
config and starts maintenance, 2021-12-03) and then removed in
65f6a9eb0b9 (scalar: constrain enlistment search, 2022-08-18), but now
there is a need for a similar method in the bundle URI feature.

Re-add the method, this time in strbuf.c, but with a new name:
strbuf_strip_file_from_path(). The method requirements are slightly
modified to allow a trailing slash, in which case nothing is done, which
makes the name change valuable.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agobundle-uri: serve bundle.* keys from config
Derrick Stolee [Thu, 22 Dec 2022 15:14:13 +0000 (15:14 +0000)] 
bundle-uri: serve bundle.* keys from config

Implement the "bundle-uri" protocol v2 capability by populating the
key=value packet lines from the local Git config. The list of bundles is
provided from the keys beginning with "bundle.".

In the future, we may want to filter this list to be more specific to
the exact known keys that the server intends to share, but for
flexibility at the moment we will assume that the config values are
well-formed.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agobundle-uri client: add helper for testing server
Ævar Arnfjörð Bjarmason [Thu, 22 Dec 2022 15:14:12 +0000 (15:14 +0000)] 
bundle-uri client: add helper for testing server

Add a 'test-tool bundle-uri ls-remote' command. This is a thin wrapper
for issuing protocol v2 "bundle-uri" commands to a server, and to the
parsing routines in bundle-uri.c.

In the "git clone" case we'll have already done the handshake(),
but not here. Add an extra case to check for this handshake in
get_bundle_uri() for ease of use for future callers.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agotransport: rename got_remote_heads
Derrick Stolee [Thu, 22 Dec 2022 15:14:11 +0000 (15:14 +0000)] 
transport: rename got_remote_heads

The 'got_remote_heads' member of 'struct git_transport_data' was used
historically to indicate that the initial server connection was made and
the ref advertisement was returned. With protocol v2, that initial
handshake does not necessarily include the ref advertisement, so this
member is not an accurate name. Thankfully, all uses of the member are
only checking to see if the handshake should take place, not whether or
not some local data has the ref advertisement.

Rename the member to 'finished_handshake' to represent the proper state.
Note that the variable is only set to 1 during the handshake() method.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agobundle-uri client: add boolean transfer.bundleURI setting
Ævar Arnfjörð Bjarmason [Thu, 22 Dec 2022 15:14:10 +0000 (15:14 +0000)] 
bundle-uri client: add boolean transfer.bundleURI setting

The yet-to-be introduced client support for bundle-uri will always
fall back on a full clone, but we'd still like to be able to ignore a
server's bundle-uri advertisement entirely.

The new transfer.bundleURI config option defaults to 'false', but a user
can set it to 'true' to enable checking for bundle URIs from the origin
Git server using protocol v2.

Co-authored-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoclone: request the 'bundle-uri' command when available
Ævar Arnfjörð Bjarmason [Thu, 22 Dec 2022 15:14:09 +0000 (15:14 +0000)] 
clone: request the 'bundle-uri' command when available

Set up all the needed client parts of the 'bundle-uri' protocol v2
command, without actually doing anything with the bundle URIs.

If the server says it supports 'bundle-uri' teach Git to issue the
'bundle-uri' command after the 'ls-refs' during 'git clone'. The
returned key=value pairs are passed to the bundle list code which is
tested using a different ingest mechanism in t5750-bundle-uri-parse.sh.

At this point, Git does nothing with that bundle list. It will not
download any of the bundles. That will come in a later change after
these protocol bits are finalized.

The no-op client is initially used only by 'git clone' to test the basic
functionality, and eventually will bootstrap the initial download of Git
objects during a fresh clone. The bundle URI client will not be
integrated into other fetches until a mechanism is created to select a
subset of bundles for download.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agot: create test harness for 'bundle-uri' command
Ævar Arnfjörð Bjarmason [Thu, 22 Dec 2022 15:14:08 +0000 (15:14 +0000)] 
t: create test harness for 'bundle-uri' command

The previous change allowed for a Git server to advertise the
'bundle-uri' command as a capability based on the
uploadPack.advertiseBundleURIs config option. Create a set of tests that
check that this capability is advertised using 'git ls-remote'.

In order to test this functionality across three protocols (file, git,
and http), create lib-bundle-uri-protocol.sh to generalize the tests,
allowing the other test scripts to set an environment variable and
otherwise inherit the setup and tests from this script.

The tests currently only test that the 'bundle-uri' command is
advertised or not. Other actions will be tested as the Git client learns
to request the 'bundle-uri' command and parse its response.

To help with URI escaping, specifically for file paths with a space in
them, extract a 'sed' invocation from t9199-git-svn-info.sh into a
helper function for use here, too.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoprotocol v2: add server-side "bundle-uri" skeleton
Ævar Arnfjörð Bjarmason [Thu, 22 Dec 2022 15:14:07 +0000 (15:14 +0000)] 
protocol v2: add server-side "bundle-uri" skeleton

Add a skeleton server-side implementation of a new "bundle-uri" command
to protocol v2. This will allow conforming clients to optionally seed
their initial clones or incremental fetches from URLs containing
"*.bundle" files created with "git bundle create".

This change only performs the basic boilerplate of advertising a new
protocol v2 capability. The new 'bundle-uri' capability allows a client
to request a list of bundles. Right now, the server only returns a flush
packet, which corresponds to an empty advertisement. The bundle.* config
namespace describes which key-value pairs will be communicated across
this interface in future updates.

The critical bit right now is that the new boolean
uploadPack.adverstiseBundleURIs config value signals whether or not this
capability should be advertised at all.

An earlier version of this patch [1] used a different transfer format
than the "key=value" pairs in the current implementation. The change was
made to unify the protocol v2 command with the bundle lists provided by
independent bundle servers. Further, the standard allows for the server
to advertise a URI that contains a bundle list. This allows users
automatically discovering bundle providers that are loosely associated
with the origin server, but without the origin server knowing exactly
which bundles are currently available.

[1] https://lore.kernel.org/git/RFC-patch-v2-01.13-2fc87ce092b-20220311T155841Z-avarab@gmail.com/

The very-deep headings needed to be modified to stop at level 4 due to
documentation build issues. These were not recognized in earlier builds
since the file was previously in the Documentation/technical/ directory
and was built in a different way. With its current location, the
heavily-nested details were causing build issues and they are now
replaced with a bulletted list of details.

Co-authored-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agorefs: fix corruption by not correctly syncing packed-refs to disk
Patrick Steinhardt [Tue, 20 Dec 2022 14:52:14 +0000 (15:52 +0100)] 
refs: fix corruption by not correctly syncing packed-refs to disk

At GitLab we have recently received a report where a repository was left
with a corrupted `packed-refs` file after the node hard-crashed even
though `core.fsync=reference` was set. This is something that in theory
should not happen if we correctly did the atomic-rename dance to:

    1. Write the data into a temporary file.

    2. Synchronize the temporary file to disk.

    3. Rename the temporary file into place.

So if we crash in the middle of writing the `packed-refs` file we should
only ever see either the old or the new state of the file.

And while we do the dance when writing the `packed-refs` file, there is
indeed one gotcha: we use a `FILE *` stream to write the temporary file,
but don't flush it before synchronizing it to disk. As a consequence any
data that is still buffered will not get synchronized and a crash of the
machine may cause corruption.

Fix this bug by flushing the file stream before we fsync.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agobundle: don't segfault on "git bundle <subcmd>"
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2022 13:40:18 +0000 (14:40 +0100)] 
bundle: don't segfault on "git bundle <subcmd>"

Since aef7d75e580 (builtin/bundle.c: let parse-options parse
subcommands, 2022-08-19) we've been segfaulting if no argument was
provided.

The fix is easy, as all of the "git bundle" subcommands require a
non-option argument we can check that we have arguments left after
calling parse-options().

This makes use of code added in 73c3253d75e (bundle: framework for
options before bundle file, 2019-11-10), before this change that code
has always been unreachable. In 73c3253d75e we'd never reach it as we
already checked "argc < 2" in cmd_bundle() itself.

Then when aef7d75e580 (whose segfault we're fixing here) migrated this
code to the subcommand API it removed that "argc < 2" check, but we
were still checking the wrong "argc" in parse_options_cmd_bundle(), we
need to check the "newargc". The "argc" will always be >= 1, as it
will necessarily contain at least the subcommand name
itself (e.g. "create").

As an aside, this could be safely squashed into this, but let's not do
that for this minimal segfault fix, as it's an unrelated refactoring:

--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -55,13 +55,12 @@ static int parse_options_cmd_bundle(int argc,
  const char * const usagestr[],
  const struct option options[],
  char **bundle_file) {
- int newargc;
- newargc = parse_options(argc, argv, NULL, options, usagestr,
+ argc = parse_options(argc, argv, NULL, options, usagestr,
       PARSE_OPT_STOP_AT_NON_OPTION);
- if (!newargc)
+ if (!argc)
  usage_with_options(usagestr, options);
  *bundle_file = prefix_filename(prefix, argv[0]);
- return newargc;
+ return argc;
 }

 static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {

Reported-by: Hubert Jasudowicz <hubertj@stmcyber.pl>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Tested-by: Hubert Jasudowicz <hubertj@stmcyber.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agocat-file: add mailmap support to --batch-check option
Siddharth Asthana [Tue, 20 Dec 2022 06:01:13 +0000 (11:31 +0530)] 
cat-file: add mailmap support to --batch-check option

Even though the cat-file command with `--batch-check` option does not
complain when `--use-mailmap` option is given, the latter option is
ignored. Compute the size of the object after replacing the idents and
report it instead.

In order to make `--batch-check` option honour the mailmap mechanism we
have to read the contents of the commit/tag object.

There were two ways to do it:

1. Make two calls to `oid_object_info_extended()`. If `--use-mailmap`
   option is given, the first call will get us the type of the object
   and second call will only be made if the object type is either a
   commit or tag to get the contents of the object.

2. Make one call to `oid_object_info_extended()` to get the type of the
   object. Then, if the object type is either of commit or tag, make a
   call to `repo_read_object_file()` to read the contents of the object.

I benchmarked the following command with both the above approaches and
compared against the current implementation where `--use-mailmap`
option is ignored:

`git cat-file --use-mailmap --batch-all-objects --batch-check --buffer
--unordered`

The results can be summarized as follows:
                       Time (mean ± σ)
default               827.7 ms ± 104.8 ms
first approach        6.197 s ± 0.093 s
second approach       1.975 s ± 0.217 s

Since, the second approach is faster than the first one, I implemented
it in this patch.

The command git cat-file can now use the mailmap mechanism to replace
idents with canonical versions for commit and tag objects. There are
several options like `--batch`, `--batch-check` and `--batch-command`
that can be combined with `--use-mailmap`. But the documentation for
`--batch`, `--batch-check` and `--batch-command` doesn't say so. This
patch fixes that documentation.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: John Cai <johncai86@gmail.com>
Helped-by: Taylor Blau <me@ttaylorr.com>
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Siddharth Asthana <siddharthasthana31@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agocat-file: add mailmap support to -s option
Siddharth Asthana [Tue, 20 Dec 2022 06:01:12 +0000 (11:31 +0530)] 
cat-file: add mailmap support to -s option

Even though the cat-file command with `-s` option does not complain when
`--use-mailmap` option is given, the latter option is ignored. Compute
the size of the object after replacing the idents and report it instead.

In order to make `-s` option honour the mailmap mechanism we have to
read the contents of the commit/tag object. Make use of the call to
`oid_object_info_extended()` to get the contents of the object and store
in `buf`. `buf` is later freed in the function.

Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: John Cai <johncai86@gmail.com>
Helped-by: Taylor Blau <me@ttaylorr.com>
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Siddharth Asthana <siddharthasthana31@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoci (check-whitespace): move to actions/checkout@v3
Chris. Webster [Tue, 20 Dec 2022 00:35:47 +0000 (00:35 +0000)] 
ci (check-whitespace): move to actions/checkout@v3

Get rid of deprecation warnings in the CI runs.  Also gets the latest
security patches.

Signed-off-by: Chris. Webster <chris@webstech.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoci (check-whitespace): add links to job output
Chris. Webster [Tue, 20 Dec 2022 00:35:46 +0000 (00:35 +0000)] 
ci (check-whitespace): add links to job output

A message in the step log will refer to the Summary output.

The job summary output is using markdown to improve readability.  The
git commands and commits with errors are now in ordered lists.
Commits and files in error are links to the user's repository.

Signed-off-by: Chris. Webster <chris@webstech.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoci (check-whitespace): suggest fixes for errors
Chris. Webster [Tue, 20 Dec 2022 00:35:45 +0000 (00:35 +0000)] 
ci (check-whitespace): suggest fixes for errors

Make the errors more visible by adding them to the job summary and
display the git commands that will usually fix the problem.

Signed-off-by: Chris. Webster <chris@webstech.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoci: only run win+VS build & tests in Git for Windows' fork
Johannes Schindelin [Mon, 19 Dec 2022 14:50:14 +0000 (14:50 +0000)] 
ci: only run win+VS build & tests in Git for Windows' fork

It has been a frequent matter of contention that the win+VS jobs not
only take a long time to run, but are also more easily broken than the
other jobs (because they do not use the same `Makefile`-based builds as
all other jobs), and to make matters worse, these breakages are also
much harder to diagnose and fix than other jobs', especially for
contributors who are happy to stay away from Windows.

The purpose of these win+VS jobs is to maintain the CMake-based build
of Git, with the target audience being Visual Studio users on Windows
who are typically quite unfamiliar with `make` and POSIX shell
scripting, but the benefit of whose expertise we want for the Git
project nevertheless.

The CMake support was introduced for that specific purpose, and already
early on concerns were raised that it would put an undue burden on
contributors to ensure that these jobs pass in CI, when they do not have
access to Windows machines (nor want to have that).

This developer's initial hope was that it would be enough to fix win+VS
failures and provide the changes to be squashed into contributors'
patches, and that it would be worth the benefit of attracting
Windows-based developers' contributions.

Neither of these hopes have panned out.

To lower the frustration, and incidentally benefit from using way less
build minutes, let's just not run the win+VS jobs by default, which
appears to be the consensus of the mail thread leading up to
https://lore.kernel.org/git/xmqqk0311blt.fsf@gitster.g/

Since the Git for Windows project still needs to at least try to attract
more of said Windows-based developers, let's keep the jobs, but disable
them everywhere except in Git for Windows' fork. This will help because
Git for Windows' branch thicket is "continuously rebased" via automation
to the `shears/maint`, `shears/main`, `shears/next` and `shears/seen`
branches at https://github.com/git-for-windows/git. That way, the Git
for Windows project will still be notified early on about potential
breakages, but the Git project won't be burdened with fixing them
anymore, which seems to be the best compromise we can get on this issue.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoline-range: fix infinite loop bug with '$' regex
Lars Kellogg-Stedman [Mon, 19 Dec 2022 22:48:50 +0000 (17:48 -0500)] 
line-range: fix infinite loop bug with '$' regex

When the -L argument to "git log" is passed the zero-width regular
expression "$" (as in "-L :$:line-range.c"), this results in an
infinite loop in find_funcname_matching_regexp().

Modify find_funcname_matching_regexp to correctly match the entire line
instead of the zero-width match at eol and update the loop condition to
prevent an infinite loop in the event of other undiscovered corner cases.

The primary change is that we pre-decrement the beginning-of-line marker
('bol') before comparing it to '\n'. In the case of '$', where we match the
'\n' at the end of the line and start the loop with bol == eol, this
ensures that bol will find the beginning of the line on which the match
occurred.

Originally reported in <https://stackoverflow.com/q/74690545/147356>.

Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agomingw: fix typo in an error message from ownership check
Daniël Haazen [Mon, 19 Dec 2022 02:26:50 +0000 (02:26 +0000)] 
mingw: fix typo in an error message from ownership check

When a repository is on a FAT32 file system, the user sees a message
that the path ownership cannot be determined.  Fix a typo in the
message.

Signed-off-by: Daniël Haazen <danielhaazen@hotmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoThe first batch for 2.40
Junio C Hamano [Mon, 19 Dec 2022 02:04:40 +0000 (11:04 +0900)] 
The first batch for 2.40

Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 months agoMerge branch 'rj/branch-copy-and-rename'
Junio C Hamano [Mon, 19 Dec 2022 02:46:18 +0000 (11:46 +0900)] 
Merge branch 'rj/branch-copy-and-rename'

Fix a pair of bugs in 'git branch'.

* rj/branch-copy-and-rename:
  branch: force-copy a branch to itself via @{-1} is a no-op

21 months agoMerge branch 'rr/status-untracked-advice'
Junio C Hamano [Mon, 19 Dec 2022 02:46:18 +0000 (11:46 +0900)] 
Merge branch 'rr/status-untracked-advice'

The advice message given by "git status" when it takes long time to
enumerate untracked paths has been updated.

* rr/status-untracked-advice:
  status: modernize git-status "slow untracked files" advice

21 months agoMerge branch 'aw/complete-case-insensitive'
Junio C Hamano [Mon, 19 Dec 2022 02:46:18 +0000 (11:46 +0900)] 
Merge branch 'aw/complete-case-insensitive'

Introduce a case insensitive mode to the Bash completion helpers.

* aw/complete-case-insensitive:
  completion: add case-insensitive match of pseudorefs
  completion: add optional ignore-case when matching refs

21 months agoMerge branch 'sx/pthread-error-check-fix'
Junio C Hamano [Mon, 19 Dec 2022 02:46:17 +0000 (11:46 +0900)] 
Merge branch 'sx/pthread-error-check-fix'

Correct pthread API usage.

* sx/pthread-error-check-fix:
  maintenance: compare output of pthread functions for inequality with 0

21 months agoMerge branch 'rs/diff-parseopts'
Junio C Hamano [Mon, 19 Dec 2022 02:46:17 +0000 (11:46 +0900)] 
Merge branch 'rs/diff-parseopts'

The way the diff machinery prepares the options array for the
parse_options API has been refactored to avoid resource leaks.

* rs/diff-parseopts:
  diff: remove parseopts member from struct diff_options
  diff: use add_diff_options() in diff_opt_parse()
  diff: factor out add_diff_options()

21 months agoMerge branch 'jk/avoid-redef-system-functions'
Junio C Hamano [Mon, 19 Dec 2022 02:46:17 +0000 (11:46 +0900)] 
Merge branch 'jk/avoid-redef-system-functions'

The jk/avoid-redef-system-functions-2.30 topic pre-merged for more
recent codebase.

* jk/avoid-redef-system-functions:

21 months agoMerge branch 'jk/avoid-redef-system-functions-2.30'
Junio C Hamano [Mon, 19 Dec 2022 02:46:16 +0000 (11:46 +0900)] 
Merge branch 'jk/avoid-redef-system-functions-2.30'

Redefining system functions for a few functions did not follow our
usual "implement git_foo() and #define foo(args) git_foo(args)"
pattern, which has broken build for some folks.

* jk/avoid-redef-system-functions-2.30:
  git-compat-util: undefine system names before redeclaring them
  git-compat-util: avoid redefining system function names

21 months agoMerge branch 'rs/t3920-crlf-eating-grep-fix'
Junio C Hamano [Mon, 19 Dec 2022 02:46:14 +0000 (11:46 +0900)] 
Merge branch 'rs/t3920-crlf-eating-grep-fix'

Test fix.

* rs/t3920-crlf-eating-grep-fix:
  t3920: support CR-eating grep

21 months agoMerge branch 'js/t3920-shell-and-or-fix'
Junio C Hamano [Mon, 19 Dec 2022 02:46:14 +0000 (11:46 +0900)] 
Merge branch 'js/t3920-shell-and-or-fix'

Test fix.

* js/t3920-shell-and-or-fix:
  t3920: don't ignore errors of more than one command with `|| true`