]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
22 months agonotes: avoid empty line in template
Michael J Gruber [Wed, 16 Nov 2022 15:56:40 +0000 (16:56 +0100)] 
notes: avoid empty line in template

When `git notes` prepares the template it adds an empty newline between
the comment header and the content:

>
> #
> # Write/edit the notes for the following object:
>
> # commit 0f3c55d4c2b7864bffb2d92278eff08d0b2e083f
> # etc

This is wrong structurally because that newline is part of the comment,
too, and thus should be commented. Also, it throws off some positioning
strategies of editors and plugins, and it differs from how we do commit
templates.

Change this to follow the standard set by `git commit`:

>
> #
> # Write/edit the notes for the following object:
> #
> # commit 0f3c55d4c2b7864bffb2d92278eff08d0b2e083f
>

Tests pass unchanged after this code change.

Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoThe twelfth batch
Taylor Blau [Tue, 15 Nov 2022 00:56:07 +0000 (19:56 -0500)] 
The twelfth batch

Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoMerge branch 'vh/my-first-contribution-typo'
Taylor Blau [Tue, 15 Nov 2022 00:53:55 +0000 (19:53 -0500)] 
Merge branch 'vh/my-first-contribution-typo'

Documentation fix.

* vh/my-first-contribution-typo:
  Documentation: fix typo

22 months agoMerge branch 'ks/partialclone-casing'
Taylor Blau [Tue, 15 Nov 2022 00:53:43 +0000 (19:53 -0500)] 
Merge branch 'ks/partialclone-casing'

Documentation fix.

* ks/partialclone-casing:
  repository-version.txt: partialClone casing change

22 months agoMerge branch 'mh/password-can-be-pat'
Taylor Blau [Tue, 15 Nov 2022 00:53:41 +0000 (19:53 -0500)] 
Merge branch 'mh/password-can-be-pat'

Documentation update to git-credential(1).

* mh/password-can-be-pat:
  Documentation/gitcredentials.txt: mention password alternatives

22 months agoMerge branch 'js/ci-set-output'
Taylor Blau [Tue, 15 Nov 2022 00:53:38 +0000 (19:53 -0500)] 
Merge branch 'js/ci-set-output'

Update the actions/github-script dependency in CI to avoid a
deprecation warning.

* js/ci-set-output:
  ci: use a newer `github-script` version

22 months agoMerge branch 'ab/rev-info-init'
Taylor Blau [Tue, 15 Nov 2022 00:53:37 +0000 (19:53 -0500)] 
Merge branch 'ab/rev-info-init'

Progress on being able to initialize a rev_info struct with a macro.

* ab/rev-info-init:
  revisions API: extend the nascent REV_INFO_INIT macro

22 months agoMerge branch 'al/trace2-clearing-skip-worktree'
Taylor Blau [Tue, 15 Nov 2022 00:53:33 +0000 (19:53 -0500)] 
Merge branch 'al/trace2-clearing-skip-worktree'

Add trace2 counters to the region to clear skip worktree bits in a
sparse checkout.

* al/trace2-clearing-skip-worktree:
  index: raise a bug if the index is materialised more than once
  index: add trace2 region for clear skip worktree

22 months agoMerge branch 'do/modernize-t7001'
Taylor Blau [Tue, 15 Nov 2022 00:53:31 +0000 (19:53 -0500)] 
Merge branch 'do/modernize-t7001'

Modernize test script to avoid "test -f" and friends.

* do/modernize-t7001:
  t7001-mv.sh: modernizing test script using functions

22 months agoDocumentation: fix typo
Vlad-Stefan Harbuz [Sun, 13 Nov 2022 12:48:09 +0000 (12:48 +0000)] 
Documentation: fix typo

Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agorepository-version.txt: partialClone casing change
Kousik Sanagavarapu [Thu, 10 Nov 2022 16:05:56 +0000 (21:35 +0530)] 
repository-version.txt: partialClone casing change

Remotes are considered "promisor" if extensions.partialClone and some
other configuration variables are set. The casing for this in
Documentation/technical/repository-version.txt is not proper and may
cause confusion. This change corrects this casing.

Signed-off-by: Kousik Sanagavarapu <five231003@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoThe eleventh batch
Taylor Blau [Tue, 8 Nov 2022 22:18:48 +0000 (17:18 -0500)] 
The eleventh batch

Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoMerge branch 'rs/no-more-run-command-v'
Taylor Blau [Tue, 8 Nov 2022 22:15:12 +0000 (17:15 -0500)] 
Merge branch 'rs/no-more-run-command-v'

Simplify the run-command API.

* rs/no-more-run-command-v:
  replace and remove run_command_v_opt()
  replace and remove run_command_v_opt_cd_env_tr2()
  replace and remove run_command_v_opt_tr2()
  replace and remove run_command_v_opt_cd_env()
  use child_process members "args" and "env" directly
  use child_process member "args" instead of string array variable
  sequencer: simplify building argument list in do_exec()
  bisect--helper: factor out do_bisect_run()
  bisect: simplify building "checkout" argument list
  am: simplify building "show" argument list
  run-command: fix return value comment
  merge: remove always-the-same "verbose" arguments

22 months agoMerge branch 'rs/archive-filter-error-once'
Taylor Blau [Tue, 8 Nov 2022 22:15:09 +0000 (17:15 -0500)] 
Merge branch 'rs/archive-filter-error-once'

"git archive" mistakenly complained twice about a missing executable,
which has been corrected.

* rs/archive-filter-error-once:
  archive-tar: report filter start error only once

22 months agoMerge branch 'ma/drop-redundant-diagnostic'
Taylor Blau [Tue, 8 Nov 2022 22:15:05 +0000 (17:15 -0500)] 
Merge branch 'ma/drop-redundant-diagnostic'

A redundant diagnostic message is dropped from test_path_is_missing().

* ma/drop-redundant-diagnostic:
  test-lib-functions: drop redundant diagnostic print

22 months agoMerge branch 'vb/ls-files-docfix'
Taylor Blau [Tue, 8 Nov 2022 22:14:53 +0000 (17:14 -0500)] 
Merge branch 'vb/ls-files-docfix'

Docfix.

* vb/ls-files-docfix:
  ls-files: fix --ignored and --killed flags in synopsis

22 months agoMerge branch 'jk/ref-filter-parsing-bugs'
Taylor Blau [Tue, 8 Nov 2022 22:14:52 +0000 (17:14 -0500)] 
Merge branch 'jk/ref-filter-parsing-bugs'

Various tests exercising the transfer.credentialsInUrl configuration
are taught to avoid making requests which require resolving localhost
to reduce CI-flakiness.

* jk/ref-filter-parsing-bugs:
  ref-filter: fix parsing of signatures with CRLF and no body
  ref-filter: fix parsing of signatures without blank lines

22 months agoMerge branch 'po/glossary-around-traversal'
Taylor Blau [Tue, 8 Nov 2022 22:14:51 +0000 (17:14 -0500)] 
Merge branch 'po/glossary-around-traversal'

The glossary entries for "commit-graph file" and "reachability
bitmap" have been added.

* po/glossary-around-traversal:
  glossary: add reachability bitmap description
  glossary: add "commit graph" description
  doc: use 'object database' not ODB or abbreviation
  doc: use "commit-graph" hyphenation consistently

22 months agoMerge branch 'jc/set-gid-bit-less-aggressively'
Taylor Blau [Tue, 8 Nov 2022 22:14:49 +0000 (17:14 -0500)] 
Merge branch 'jc/set-gid-bit-less-aggressively'

The adjust_shared_perm() helper function learned to refrain from
setting the "g+s" bit on directories when it is not necessary.

* jc/set-gid-bit-less-aggressively:
  adjust_shared_perm(): leave g+s alone when the group does not matter

22 months agoMerge branch 'es/mark-gc-cruft-as-experimental'
Taylor Blau [Tue, 8 Nov 2022 22:14:48 +0000 (17:14 -0500)] 
Merge branch 'es/mark-gc-cruft-as-experimental'

Enable gc.cruftpacks by default for those who opt into
feature.experimental setting.

* es/mark-gc-cruft-as-experimental:
  config: let feature.experimental imply gc.cruftPacks=true
  gc: add tests for --cruft and friends

22 months agoMerge branch 'tb/howto-using-redo-script'
Taylor Blau [Tue, 8 Nov 2022 22:14:45 +0000 (17:14 -0500)] 
Merge branch 'tb/howto-using-redo-script'

Doc update.

* tb/howto-using-redo-script:
  Documentation/howto/maintain-git.txt: fix Meta/redo-jch.sh invocation

22 months agoDocumentation/gitcredentials.txt: mention password alternatives
M Hickford [Tue, 8 Nov 2022 13:01:27 +0000 (13:01 +0000)] 
Documentation/gitcredentials.txt: mention password alternatives

Git asks for a "password", but the user might use a
personal access token or OAuth access token instead.

Example:

    Password for 'https://AzureDiamond@github.com':

Signed-off-by: M Hickford <mirth.hickford@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agorevisions API: extend the nascent REV_INFO_INIT macro
Ævar Arnfjörð Bjarmason [Tue, 8 Nov 2022 14:02:57 +0000 (15:02 +0100)] 
revisions API: extend the nascent REV_INFO_INIT macro

Have the REV_INFO_INIT macro added in [1] declare more members of
"struct rev_info" that we can initialize statically, and have
repo_init_revisions() do so with the memcpy(..., &blank) idiom
introduced in [2].

As the comment for the "REV_INFO_INIT" macro notes this still isn't
sufficient to initialize a "struct rev_info" for use yet. But we are
getting closer to that eventual goal.

Even though we can't fully initialize a "struct rev_info" with
REV_INFO_INIT it's useful for readability to clearly separate those
things that we can statically initialize, and those that we can't.

This change could replace the:

list_objects_filter_init(&revs->filter);

In the repo_init_revisions() with this line, at the end of the
REV_INFO_INIT deceleration in revisions.h:

.filter = LIST_OBJECTS_FILTER_INIT, \

But doing so would produce a minor conflict with an outstanding
topic[3]. Let's skip that for now. I have follow-ups to initialize
more of this statically, e.g. changes to get rid of grep_init(). We
can initialize more members with the macro in a future series.

1. f196c1e908d (revisions API users: use release_revisions() needing
   REV_INFO_INIT, 2022-04-13)
2. 5726a6b4012 (*.c *_init(): define in terms of corresponding *_INIT
   macro, 2021-07-01)
3. https://lore.kernel.org/git/265b292ed5c2de19b7118dfe046d3d9d932e2e89.1667901510.git.ps@pks.im/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoci: use a newer `github-script` version
Johannes Schindelin [Tue, 8 Nov 2022 10:13:28 +0000 (10:13 +0000)] 
ci: use a newer `github-script` version

The old version we currently use runs in node.js v12.x, which is being
deprecated in GitHub Actions. The new version uses node.js v16.x.

Incidentally, this also avoids the warning about the deprecated
`::set-output::` workflow command because the newer version of the
`github-script` Action uses the recommended new way to specify outputs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agols-files: fix --ignored and --killed flags in synopsis
Vincent Bernat [Sun, 6 Nov 2022 07:37:27 +0000 (08:37 +0100)] 
ls-files: fix --ignored and --killed flags in synopsis

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoindex: raise a bug if the index is materialised more than once
Anh Le [Thu, 3 Nov 2022 23:05:01 +0000 (23:05 +0000)] 
index: raise a bug if the index is materialised more than once

If clear_skip_worktree_from_present_files() encounter a sparse directory,
it fully materialise the index which should expand any sparse directories
and start going through each entries again. If this happens more than once,
raise it with a BUG.

Signed-off-by: Anh Le <anh@canva.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoindex: add trace2 region for clear skip worktree
Anh Le [Thu, 3 Nov 2022 23:05:00 +0000 (23:05 +0000)] 
index: add trace2 region for clear skip worktree

When using sparse checkout, clear_skip_worktree_from_present_files() must
enumerate index entries to find ones with the SKIP_WORKTREE bit to
determine whether those index entries exist on disk (in which case their
SKIP_WORKTREE bit should be removed).

In a large repository, this may take considerable time depending on the
size of the index.

Add a trace2 region to surface this information, keeping a count of how
many paths have been checked. Separately, keep counts after a full index is
materialized.

Signed-off-by: Anh Le <anh@canva.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agot7001-mv.sh: modernizing test script using functions
Debra Obondo [Fri, 4 Nov 2022 15:05:52 +0000 (15:05 +0000)] 
t7001-mv.sh: modernizing test script using functions

Test script to verify the presence/absence of files, paths, directories,
symlinks and other features in 'git mv' command are using the command
format:

'test (-e|f|d|h|...)'

Replace them with helper functions of format:

'test_path_is_*'

Replacing idiomatic helper functions:

'! test_path_is_*'

with

'test_path_is_missing'

This uses values of 'test_path_bar' in place of '! test_path_foo' to
bring in the helpful factor of indicating the failure of tests after the
mv command has been used, that is, it echoes if the feature/test_path
exists.

Signed-off-by: Debra Obondo <debraobondo@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoThe tenth batch
Taylor Blau [Fri, 4 Nov 2022 00:41:55 +0000 (20:41 -0400)] 
The tenth batch

Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoMerge branch 'jk/avoid-localhost'
Taylor Blau [Fri, 4 Nov 2022 00:41:06 +0000 (20:41 -0400)] 
Merge branch 'jk/avoid-localhost'

Various tests exercising the transfer.credentialsInUrl configuration
are taught to avoid making requests which require resolving localhost
to reduce CI-flakiness.

* jk/avoid-localhost:
  t5516/t5601: be less strict about the number of credential warnings
  t5516: move plaintext-password tests from t5601 and t5516

22 months agoref-filter: fix parsing of signatures with CRLF and no body
Jeff King [Wed, 2 Nov 2022 07:44:00 +0000 (03:44 -0400)] 
ref-filter: fix parsing of signatures with CRLF and no body

This commit fixes a bug when parsing tags that have CRLF line endings, a
signature, and no body, like this (the "^M" are marking the CRs):

  this is the subject^M
  -----BEGIN PGP SIGNATURE-----^M
  ^M
  ...some stuff...^M
  -----END PGP SIGNATURE-----^M

When trying to find the start of the body, we look for a blank line
separating the subject and body. In this case, there isn't one. But we
search for it using strstr(), which will find the blank line in the
signature.

In the non-CRLF code path, we check whether the line we found is past
the start of the signature, and if so, put the body pointer at the start
of the signature (effectively making the body empty). But the CRLF code
path doesn't catch the same case, and we end up with the body pointer in
the middle of the signature field. This has two visible problems:

  - printing %(contents:subject) will show part of the signature, too,
    since the subject length is computed as (body - subject)

  - the length of the body is (sig - body), which makes it negative.
    Asking for %(contents:body) causes us to cast this to a very large
    size_t when we feed it to xmemdupz(), which then complains about
    trying to allocate too much memory.

These are essentially the same bugs fixed in the previous commit, except
that they happen when there is a CRLF blank line in the signature,
rather than no blank line at all. Both are caused by the refactoring in
9f75ce3d8f (ref-filter: handle CRLF at end-of-line more gracefully,
2020-10-29).

We can fix this by doing the same "sigstart" check that we do in the
non-CRLF case. And rather than repeat ourselves, we can just use
short-circuiting OR to collapse both cases into a single conditional.
I.e., rather than:

  if (strstr("\n\n"))
    ...found blank, check if it's in signature...
  else if (strstr("\r\n\r\n"))
    ...found blank, check if it's in signature...
  else
    ...no blank line found...

we can collapse this to:

  if (strstr("\n\n")) ||
      strstr("\r\n\r\n")))
    ...found blank, check if it's in signature...
  else
    ...no blank line found...

The tests show the problem and the fix. Though it wasn't broken, I
included contents:signature here to make sure it still behaves as
expected, but note the shell hackery needed to make it work. A
less-clever option would be to skip using test_atom and just "append_cr
>expected" ourselves.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoref-filter: fix parsing of signatures without blank lines
Jeff King [Wed, 2 Nov 2022 07:42:07 +0000 (03:42 -0400)] 
ref-filter: fix parsing of signatures without blank lines

When ref-filter is asked to show %(content:subject), etc, we end up in
find_subpos() to parse out the three major parts: the subject, the body,
and the signature (if any).

When searching for the blank line between the subject and body, if we
don't find anything, we try to treat the whole message as the subject,
with no body. But our idea of "the whole message" needs to take into
account the signature, too. Since 9f75ce3d8f (ref-filter: handle CRLF at
end-of-line more gracefully, 2020-10-29), the code instead goes all the
way to the end of the buffer, which produces confusing output.

Here's an example. If we have a tag message like this:

  this is the subject
  -----BEGIN SSH SIGNATURE-----
  ...some stuff...
  -----END SSH SIGNATURE-----

then the current parser will put the start of the body at the end of the
whole buffer. This produces two buggy outcomes:

  - since the subject length is computed as (body - subject), showing
    %(contents:subject) will print both the subject and the signature,
    rather than just the single line

  - since the body length is computed as (sig - body), and the body now
    starts _after_ the signature, we end up with a negative length!
    Fortunately we never access out-of-bounds memory, because the
    negative length is fed to xmemdupz(), which casts it to a size_t,
    and xmalloc() bails trying to allocate an absurdly large value.

    In theory it would be possible for somebody making a malicious tag
    to wrap it around to a more reasonable value, but it would require a
    tag on the order of 2^63 bytes. And even if they did, all they get
    is an out of bounds string read. So the security implications are
    probably not interesting.

We can fix both by correctly putting the start of the body at the same
index as the start of the signature (effectively making the body empty).

Note that this is a real issue with signatures generated with gpg.format
set to "ssh", which would look like the example above. In the new tests
here I use a hard-coded tag message, for a few reasons:

  - regardless of what the ssh-signing code produces now or in the
    future, we should be testing this particular case

  - skipping the actual signature makes the tests simpler to write (and
    allows them to run on more systems)

  - t6300 has helpers for working with gpg signatures; for the purposes
    of this bug, "BEGIN PGP" is just as good a demonstration, and this
    simplifies the tests

Curiously, the same issue doesn't happen with real gpg signatures (and
there are even existing tests in t6300 with cover this). Those have a
blank line between the header and the content, like:

  this is the subject
  -----BEGIN PGP SIGNATURE-----

  ...some stuff...
  -----END PGP SIGNATURE-----

Because we search for the subject/body separator line with a strstr(),
we find the blank line in the signature, even though it's outside of
what we'd consider the body. But that puts us unto a separate code path,
which realizes that we're now in the signature and adjusts the line back
to "sigstart". So this patch is basically just making the "no line found
at all" case match that. And note that "sigstart" is always defined (if
there is no signature, it points to the end of the buffer as you'd
expect).

Reported-by: Martin Englund <martin@englund.nu>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agot5516/t5601: be less strict about the number of credential warnings
Johannes Schindelin [Tue, 1 Nov 2022 02:26:48 +0000 (22:26 -0400)] 
t5516/t5601: be less strict about the number of credential warnings

It is unclear as to _why_, but under certain circumstances the warning
about credentials being passed as part of the URL seems to be swallowed
by the `git remote-https` helper in the Windows jobs of Git's CI builds.

Since it is not actually important how many times Git prints the
warning/error message, as long as it prints it at least once, let's just
make the test a bit more lenient and test for the latter instead of the
former, which works around these CI issues.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agot5516: move plaintext-password tests from t5601 and t5516
Jeff King [Tue, 1 Nov 2022 02:26:42 +0000 (22:26 -0400)] 
t5516: move plaintext-password tests from t5601 and t5516

Commit 6dcbdc0d66 (remote: create fetch.credentialsInUrl config,
2022-06-06) added tests for our handling of passwords in URLs. Since the
obvious URL to be affected is git-over-http, the tests use http. However
they don't set up a test server; they just try to access
https://localhost, assuming it will fail (because the nothing is
listening there).

This causes some possible problems:

  - There might be a web server running on localhost, and we do not
    actually want to connect to that.

  - The DNS resolver, or the local firewall, might take a substantial
    amount of time (or forever, whichever comes first) to fail to
    connect, slowing down the tests cases unnecessarily.

  - Since there's no server, our tests for "allow" and "warn" still
    expect the clone/fetch/push operations to fail, even though in the
    real world we'd expect these to succeed. We scrape stderr to see
    what happened, but it's not as robust as a more realistic test.

Let's instead move these to t5551, which is all about testing http and
where we have a real server. That eliminates any issues with contacting
a strange URL, and lets the "allow" and "warn" tests confirm that the
operation actually succeeds.

It's not quite a verbatim move for a few reasons:

  - we can drop the LIBCURL dependency; it's already part of
    lib-httpd.sh

  - we'll use HTTPD_URL_USER_PASS, etc, instead of our fake URL. To
    avoid repetition, we'll add a few extra variables.

  - the "https://username:@localhost" test uses a funny URL that
    lib-httpd.sh doesn't provide. We'll similarly construct it in a
    variable. Note that we're hard-coding the lib-httpd username here,
    but t5551 already does that everywhere.

  - for the "domain:port" test, the URL provided by lib-httpd is fine,
    since our test server will always be on an exotic port. But we'll
    confirm in the test that this is so.

  - since our message-matching is done via grep, I simplified it to use
    a regex, rather than trying to massage lib-httpd's variables.
    Arguably this makes it more readable, too, while retaining the bits
    we care about: the fatal/warning distinction, the "uses plaintext"
    message, and the fact that the password was redacted.

  - we'll use the /auth/ path for the repo, which shows that we are
    indeed making use of the auth information when needed.

  - we'll also use /smart/; most of these tests could be done via /dumb/
    in t5550, but setting up pushes there requires extra effort and
    dependencies. The smart protocol is what most everyone is using
    these days anyway.

This patch is my own, but I stole the analysis and a few bits of the
commit message from a patch by Johannes Schindelin.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agotest-lib-functions: drop redundant diagnostic print
Martin Ågren [Mon, 31 Oct 2022 18:00:48 +0000 (19:00 +0100)] 
test-lib-functions: drop redundant diagnostic print

`test_path_is_missing` was introduced back in 2caf20c52b ("test-lib:
user-friendly alternatives to test [-d|-f|-e]", 2010-08-10). It took the
path that was supposed to be missing, as well as an optional "diagnosis"
that would be echoed if the path was found to be alive.

Commit 45a2686441 ("test-lib-functions: remove bug-inducing
"diagnostics" helper param", 2021-02-12) dropped this diagnostic
functionality from several `test_path_is_foo` helpers, but note how it
tweaked the README entry on `test_path_is_missing` without actually
adjusting its implementation.

Commit e7884b353b ("test-lib-functions: assert correct parameter count",
2021-02-12) then followed up by asserting that we get just a single
argument.

This history leaves us in a state where we assert that we have exactly
one argument, then go on to anyway check for arguments, echoing them
all. It's clear that we can simplify this code. We should also note that
we run `ls -ld "$1"`, so printing the filename a second time doesn't
really buy us anything. Thus, we can drop the whole `if` block as
redundant.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoThe ninth batch
Taylor Blau [Mon, 31 Oct 2022 01:14:28 +0000 (21:14 -0400)] 
The ninth batch

Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoMerge branch 'jt/skipping-negotiator-wo-recursion'
Taylor Blau [Mon, 31 Oct 2022 01:04:44 +0000 (21:04 -0400)] 
Merge branch 'jt/skipping-negotiator-wo-recursion'

Rewrite a deep recursion in the skipping negotiator to use a loop
with on-heap prio queue to avoid stack wastage.

* jt/skipping-negotiator-wo-recursion:
  negotiator/skipping: avoid stack overflow

22 months agoMerge branch 'jc/doc-fsck-msgids'
Taylor Blau [Mon, 31 Oct 2022 01:04:44 +0000 (21:04 -0400)] 
Merge branch 'jc/doc-fsck-msgids'

Add documentation for message IDs in fsck error messages.

* jc/doc-fsck-msgids:
  Documentation: add lint-fsck-msgids
  fsck: document msg-id
  fsck: remove the unused MISSING_TREE_OBJECT
  fsck: remove the unused BAD_TAG_OBJECT

22 months agoMerge branch 'en/merge-tree-sequence'
Taylor Blau [Mon, 31 Oct 2022 01:04:44 +0000 (21:04 -0400)] 
Merge branch 'en/merge-tree-sequence'

"git merge-tree --stdin" is a new way to request a series of merges
and report the merge results.

* en/merge-tree-sequence:
  merge-tree: support multiple batched merges with --stdin
  merge-tree: update documentation for differences in -z output

22 months agoMerge branch 'ds/bundle-uri-3'
Taylor Blau [Mon, 31 Oct 2022 01:04:43 +0000 (21:04 -0400)] 
Merge branch 'ds/bundle-uri-3'

Define the logical elements of a "bundle list", data structure to
store them in-core, format to transfer them, and code to parse
them.

* ds/bundle-uri-3:
  bundle-uri: suppress stderr from remote-https
  bundle-uri: quiet failed unbundlings
  bundle: add flags to verify_bundle()
  bundle-uri: fetch a list of bundles
  bundle: properly clear all revision flags
  bundle-uri: limit recursion depth for bundle lists
  bundle-uri: parse bundle list in config format
  bundle-uri: unit test "key=value" parsing
  bundle-uri: create "key=value" line parsing
  bundle-uri: create base key-value pair parsing
  bundle-uri: create bundle_list struct and helpers
  bundle-uri: use plain string in find_temp_filename()

22 months agoMerge branch 'rj/branch-do-not-exit-with-minus-one-status'
Taylor Blau [Mon, 31 Oct 2022 01:04:43 +0000 (21:04 -0400)] 
Merge branch 'rj/branch-do-not-exit-with-minus-one-status'

"git branch --edit-description" can exit with status -1 which is
not a good practice; it learned to use 1 as everybody else instead.

* rj/branch-do-not-exit-with-minus-one-status:
  branch: error code with --edit-description

22 months agoMerge branch 'rj/branch-copy-rename-error-codepath-cleanup'
Taylor Blau [Mon, 31 Oct 2022 01:04:43 +0000 (21:04 -0400)] 
Merge branch 'rj/branch-copy-rename-error-codepath-cleanup'

Code simplification.

* rj/branch-copy-rename-error-codepath-cleanup:
  branch: error copying or renaming a detached HEAD

22 months agoMerge branch 'tb/cap-patch-at-1gb'
Taylor Blau [Mon, 31 Oct 2022 01:04:43 +0000 (21:04 -0400)] 
Merge branch 'tb/cap-patch-at-1gb'

"git apply" limits its input to a bit less than 1 GiB.

* tb/cap-patch-at-1gb:
  apply: reject patches larger than ~1 GiB

22 months agoMerge branch 'jr/embargoed-releases-doc'
Taylor Blau [Mon, 31 Oct 2022 01:04:43 +0000 (21:04 -0400)] 
Merge branch 'jr/embargoed-releases-doc'

The role the security mailing list plays in an embargoed release
has been documented.

* jr/embargoed-releases-doc:
  embargoed releases: also describe the git-security list and the process

22 months agoMerge branch 'en/ort-dir-rename-and-symlink-fix'
Taylor Blau [Mon, 31 Oct 2022 01:04:43 +0000 (21:04 -0400)] 
Merge branch 'en/ort-dir-rename-and-symlink-fix'

Merging a branch with directory renames into a branch that changes
the directory to a symlink was mishandled by the ort merge
strategy, which has been corrected.

* en/ort-dir-rename-and-symlink-fix:
  merge-ort: fix bug with dir rename vs change dir to symlink

22 months agoMerge branch 'pb/subtree-split-and-merge-after-squashing-tag-fix'
Taylor Blau [Mon, 31 Oct 2022 01:04:43 +0000 (21:04 -0400)] 
Merge branch 'pb/subtree-split-and-merge-after-squashing-tag-fix'

A bugfix to "git subtree" in its split and merge features.

* pb/subtree-split-and-merge-after-squashing-tag-fix:
  subtree: fix split after annotated tag was squashed merged
  subtree: fix squash merging after annotated tag was squashed merged
  subtree: process 'git-subtree-split' trailer in separate function
  subtree: use named variables instead of "$@" in cmd_pull
  subtree: define a variable before its first use in 'find_latest_squash'
  subtree: prefix die messages with 'fatal'
  subtree: add 'die_incompatible_opt' function to reduce duplication
  subtree: use 'git rev-parse --verify [--quiet]' for better error messages
  test-lib-functions: mark 'test_commit' variables as 'local'

22 months agoMerge branch 'pw/rebase-reflog-fixes'
Taylor Blau [Mon, 31 Oct 2022 01:04:42 +0000 (21:04 -0400)] 
Merge branch 'pw/rebase-reflog-fixes'

Fix some bugs in the reflog messages when rebasing and changes the
reflog messages of "rebase --apply" to match "rebase --merge" with
the aim of making the reflog easier to parse.

* pw/rebase-reflog-fixes:
  rebase: cleanup action handling
  rebase --abort: improve reflog message
  rebase --apply: make reflog messages match rebase --merge
  rebase --apply: respect GIT_REFLOG_ACTION
  rebase --merge: fix reflog message after skipping
  rebase --merge: fix reflog when continuing
  t3406: rework rebase reflog tests
  rebase --apply: remove duplicated code

22 months agoMerge branch 'pw/rebase-keep-base-fixes'
Taylor Blau [Mon, 31 Oct 2022 01:04:42 +0000 (21:04 -0400)] 
Merge branch 'pw/rebase-keep-base-fixes'

"git rebase --keep-base" used to discard the commits that are
already cherry-picked to the upstream, even when "keep-base" meant
that the base, on top of which the history is being rebuilt, does
not yet include these cherry-picked commits.  The --keep-base
option now implies --reapply-cherry-picks and --no-fork-point
options.

* pw/rebase-keep-base-fixes:
  rebase --keep-base: imply --no-fork-point
  rebase --keep-base: imply --reapply-cherry-picks
  rebase: factor out branch_base calculation
  rebase: rename merge_base to branch_base
  rebase: store orig_head as a commit
  rebase: be stricter when reading state files containing oids
  t3416: set $EDITOR in subshell
  t3416: tighten two tests

22 months agoMerge branch 'jh/trace2-timers-and-counters'
Taylor Blau [Mon, 31 Oct 2022 01:04:42 +0000 (21:04 -0400)] 
Merge branch 'jh/trace2-timers-and-counters'

Two new facilities, "timer" and "counter", are introduced to the
trace2 API.

* jh/trace2-timers-and-counters:
  trace2: add global counter mechanism
  trace2: add stopwatch timers
  trace2: convert ctx.thread_name from strbuf to pointer
  trace2: improve thread-name documentation in the thread-context
  trace2: rename the thread_name argument to trace2_thread_start
  api-trace2.txt: elminate section describing the public trace2 API
  tr2tls: clarify TLS terminology
  trace2: use size_t alloc,nr_open_regions in tr2tls_thread_ctx

22 months agoMerge branch 'tb/shortlog-group'
Taylor Blau [Mon, 31 Oct 2022 01:04:42 +0000 (21:04 -0400)] 
Merge branch 'tb/shortlog-group'

"git shortlog" learned to group by the "format" string.

* tb/shortlog-group:
  shortlog: implement `--group=committer` in terms of `--group=<format>`
  shortlog: implement `--group=author` in terms of `--group=<format>`
  shortlog: extract `shortlog_finish_setup()`
  shortlog: support arbitrary commit format `--group`s
  shortlog: extract `--group` fragment for translation
  shortlog: make trailer insertion a noop when appropriate
  shortlog: accept `--date`-related options

22 months agoMerge branch 'rs/absorb-git-dir-simplify'
Taylor Blau [Mon, 31 Oct 2022 01:04:42 +0000 (21:04 -0400)] 
Merge branch 'rs/absorb-git-dir-simplify'

Code simplification by using strvec_pushf() instead of building an
argument in a separate strbuf.

* rs/absorb-git-dir-simplify:
  submodule: use strvec_pushf() for --super-prefix

22 months agoMerge branch 'jk/repack-tempfile-cleanup'
Taylor Blau [Mon, 31 Oct 2022 01:04:42 +0000 (21:04 -0400)] 
Merge branch 'jk/repack-tempfile-cleanup'

The way "git repack" creared temporary files when it received a
signal was prone to deadlocking, which has been corrected.

* jk/repack-tempfile-cleanup:
  t7700: annotate cruft-pack failure with ok=sigpipe
  repack: drop remove_temporary_files()
  repack: use tempfiles for signal cleanup
  repack: expand error message for missing pack files
  repack: populate extension bits incrementally
  repack: convert "names" util bitfield to array

22 months agoMerge branch 'sg/stable-docdep'
Taylor Blau [Mon, 31 Oct 2022 01:04:42 +0000 (21:04 -0400)] 
Merge branch 'sg/stable-docdep'

Make sure generated dependency file is stably sorted to help
developers debugging their build issues.

* sg/stable-docdep:
  Documentation/build-docdep.perl: generate sorted output

22 months agoMerge branch 'sd/doc-smtp-encryption'
Taylor Blau [Mon, 31 Oct 2022 01:04:42 +0000 (21:04 -0400)] 
Merge branch 'sd/doc-smtp-encryption'

* sd/doc-smtp-encryption:
  docs: git-send-email: difference between ssl and tls smtp-encryption

22 months agoMerge branch 'jz/patch-id'
Taylor Blau [Mon, 31 Oct 2022 01:04:41 +0000 (21:04 -0400)] 
Merge branch 'jz/patch-id'

A new "--include-whitespace" option is added to "git patch-id", and
existing bugs in the internal patch-id logic that did not match
what "git patch-id" produces have been corrected.

* jz/patch-id:
  builtin: patch-id: remove unused diff-tree prefix
  builtin: patch-id: add --verbatim as a command mode
  patch-id: fix patch-id for mode changes
  builtin: patch-id: fix patch-id with binary diffs
  patch-id: use stable patch-id for rebases
  patch-id: fix stable patch id for binary / header-only

22 months agoglossary: add reachability bitmap description
Philip Oakley [Sat, 29 Oct 2022 16:41:11 +0000 (17:41 +0100)] 
glossary: add reachability bitmap description

Describe the purpose of the reachability bitmap.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoglossary: add "commit graph" description
Philip Oakley [Sat, 29 Oct 2022 16:41:10 +0000 (17:41 +0100)] 
glossary: add "commit graph" description

Git has an additional "commit graph" capability that supplements the
normal commit object's directed acyclic graph (DAG). The supplemental
commit graph file is designed for speed of access.

Describe the commit graph both from the normative DAG view point and
from the commit graph file perspective.

Also, clarify the link between the branch ref and branch tip
by linking to the `ref` glossary entry, matching this commit graph
entry.

The commit-graph file is also distinguished by its hyphenation.

Subsequent commit catches the few cases where the hyphenation of
commit-graph was missing.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agodoc: use 'object database' not ODB or abbreviation
Philip Oakley [Sat, 29 Oct 2022 16:41:09 +0000 (17:41 +0100)] 
doc: use 'object database' not ODB or abbreviation

The abbreviation 'ODB' is used in the technical documentation
sections for commit-graph and parallel-checkout, along with an
'odb' option in `git-pack-redundant`, without expansion.

Use 'object database' in full, in those entries. The text has not
been reflowed to keep the changes minimal.

While in the glossary for `object` terms, add the common`oid`
abbreviation to its entry.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agodoc: use "commit-graph" hyphenation consistently
Philip Oakley [Sat, 29 Oct 2022 16:41:12 +0000 (17:41 +0100)] 
doc: use "commit-graph" hyphenation consistently

Note, historical release notes have not been updated.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoarchive-tar: report filter start error only once
René Scharfe [Sat, 29 Oct 2022 10:06:06 +0000 (12:06 +0200)] 
archive-tar: report filter start error only once

A missing tar filter is reported by start_command() using error(), but
also by its caller, write_tar_filter_archive(), using die():

   $ git -c tar.invalid.command=foo archive --format=invalid HEAD
   error: cannot run foo: No such file or directory
   fatal: unable to start 'foo' filter: No such file or directory

The second message contains all relevant information and even says that
the failed command was intended to be used as a filter.  Silence the
first one because it's redundant.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoreplace and remove run_command_v_opt()
René Scharfe [Sun, 30 Oct 2022 11:55:06 +0000 (12:55 +0100)] 
replace and remove run_command_v_opt()

Replace the remaining calls of run_command_v_opt() with run_command()
calls and explict struct child_process variables.  This is more verbose,
but not by much overall.  The code becomes more flexible, e.g. it's easy
to extend to conditionally add a new argument.

Then remove the now unused function and its own flag names, simplifying
the run-command API.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoreplace and remove run_command_v_opt_cd_env_tr2()
René Scharfe [Sun, 30 Oct 2022 11:53:40 +0000 (12:53 +0100)] 
replace and remove run_command_v_opt_cd_env_tr2()

The convenience function run_command_v_opt_cd_env_tr2() has no external
callers left.  Inline it and remove it from the API.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoreplace and remove run_command_v_opt_tr2()
René Scharfe [Sun, 30 Oct 2022 11:52:40 +0000 (12:52 +0100)] 
replace and remove run_command_v_opt_tr2()

The convenience function run_command_v_opt_tr2() is only used by a
single caller.  Use struct child_process and run_command() directly
instead and remove the underused function.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoreplace and remove run_command_v_opt_cd_env()
René Scharfe [Sun, 30 Oct 2022 11:51:55 +0000 (12:51 +0100)] 
replace and remove run_command_v_opt_cd_env()

run_command_v_opt_cd_env() is only used in an example in a comment.  Use
the struct child_process member "env" and run_command() directly instead
and then remove the unused convenience function.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agouse child_process members "args" and "env" directly
René Scharfe [Sun, 30 Oct 2022 11:51:14 +0000 (12:51 +0100)] 
use child_process members "args" and "env" directly

Build argument list and environment of child processes by using
struct child_process and populating its members "args" and "env"
directly instead of maintaining separate strvecs and letting
run_command_v_opt() and friends populate these members.  This is
simpler, shorter and slightly more efficient.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agouse child_process member "args" instead of string array variable
René Scharfe [Sun, 30 Oct 2022 11:50:27 +0000 (12:50 +0100)] 
use child_process member "args" instead of string array variable

Use run_command() with a struct child_process variable and populate its
"args" member directly instead of building a string array and passing it
to run_command_v_opt().  This avoids the use of magic index numbers and
makes simplifies the possible addition of more arguments in the future.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agosequencer: simplify building argument list in do_exec()
René Scharfe [Sun, 30 Oct 2022 11:49:37 +0000 (12:49 +0100)] 
sequencer: simplify building argument list in do_exec()

Build child_argv during initialization, taking advantage of the C99
support for initialization expressions that are not compile time
constants.  This avoids the use of a magic index constant and is shorter
and simpler.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agobisect--helper: factor out do_bisect_run()
René Scharfe [Sun, 30 Oct 2022 11:48:16 +0000 (12:48 +0100)] 
bisect--helper: factor out do_bisect_run()

Deduplicate the code for reporting and starting the bisect run command
by moving it to a short helper function.  Use a string array instead of
a strvec to prepare the arguments, for simplicity.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agobisect: simplify building "checkout" argument list
René Scharfe [Sun, 30 Oct 2022 11:47:02 +0000 (12:47 +0100)] 
bisect: simplify building "checkout" argument list

Reduce the scope of argv_checkout, which allows to fully build it during
initialization.  Use oid_to_hex() instead of oid_to_hex_r(), because
that's simpler and using the static buffer of the former is just as safe
as the old static argv_checkout.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoam: simplify building "show" argument list
René Scharfe [Sun, 30 Oct 2022 11:46:11 +0000 (12:46 +0100)] 
am: simplify building "show" argument list

Build the string array av during initialization, without any magic
numbers or heap allocations.  Not duplicating the result of oid_to_hex()
is safe because run_command_v_opt() duplicates all arguments already.
(It would even be safe if it didn't, but that's a different story.)

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agorun-command: fix return value comment
René Scharfe [Sun, 30 Oct 2022 11:45:13 +0000 (12:45 +0100)] 
run-command: fix return value comment

483bbd4e4c (run-command: introduce child_process_init(), 2014-08-19) and
2d71608ec0 (run-command: factor out child_process_clear(), 2015-10-24)
added help texts about child_process_init() and child_process_clear()
without updating the immediately following documentation of return codes
that only applied to the preexisting functions.

4c4066d95d (run-command: move doc to run-command.h, 2019-11-17) started
to list the functions explicitly that this paragraph applies to, but
still wrongly included child_process_init() and child_process_clear().
Remove their names from that list.

Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agomerge: remove always-the-same "verbose" arguments
Ævar Arnfjörð Bjarmason [Sun, 30 Oct 2022 11:42:59 +0000 (12:42 +0100)] 
merge: remove always-the-same "verbose" arguments

Simplify the code that builds the arguments for the "read-tree"
invocation in reset_hard() and read_empty() to remove the "verbose"
parameter.

Before 172b6428d06 (do not overwrite untracked during merge from
unborn branch, 2010-11-14) there was a "reset_hard()" function that
would be called in two places, one of those passed a "verbose=1", the
other a "verbose=0".

After 172b6428d06 when read_empty() was split off from reset_hard()
both of these functions only had one caller. The "verbose" in
read_empty() would always be false, and the one in reset_hard() would
always be true.

There was never a good reason for the code to act this way, it
happened because the read_empty() function was a copy/pasted and
adjusted version of reset_hard().

Since we're no longer conditionally adding the "-v" parameter
here (and we'd only add it for "reset_hard()" we'll be able to move to
a simpler and safer run-command API in the subsequent commit.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
22 months agoadjust_shared_perm(): leave g+s alone when the group does not matter
Junio C Hamano [Fri, 28 Oct 2022 21:16:09 +0000 (14:16 -0700)] 
adjust_shared_perm(): leave g+s alone when the group does not matter

Julien Moutinho reports that in an environment where directory does
not have BSD group semantics and requires the g+s to be set (aka
FORCE_DIR_SET_GID), but the system forbids chmod() to touch the g+s
bit, adjust_shared_perm() fails even when the repository is for
private use with perm = 0600, because we unconditionally try to set
the g+s bit.

When we grant extra access based on group membership (i.e. the
directory has either g+r or g+w bit set), which group the directory
and its contents are owned by matters.  But otherwise (e.g. perm is
set to 0600, in Julien's case), flipping g+s bit is not necessary.

Reported-by: Julien Moutinho <julm+git@sourcephile.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoThe eighth batch
Junio C Hamano [Fri, 28 Oct 2022 18:27:01 +0000 (11:27 -0700)] 
The eighth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge branch 'tb/diffstat-with-utf8-strwidth'
Junio C Hamano [Fri, 28 Oct 2022 18:26:55 +0000 (11:26 -0700)] 
Merge branch 'tb/diffstat-with-utf8-strwidth'

"git diff --stat" etc. were invented back when everything was ASCII
and strlen() was a way to measure the display width of a string;
adjust them to compute the display width assuming UTF-8 pathnames.

* tb/diffstat-with-utf8-strwidth:
  diff: leave NEEDWORK notes in show_stats() function
  diff.c: use utf8_strwidth() to count display width

22 months agoMerge branch 'mm/git-pm-try-catch-syntax-fix'
Junio C Hamano [Fri, 28 Oct 2022 18:26:54 +0000 (11:26 -0700)] 
Merge branch 'mm/git-pm-try-catch-syntax-fix'

Fix a longstanding syntax error in Git.pm error codepath.

* mm/git-pm-try-catch-syntax-fix:
  Git.pm: trust rev-parse to find bare repositories
  Git.pm: add semicolon after catch statement

22 months agoMerge branch 'tb/remove-unused-pack-bitmap'
Junio C Hamano [Fri, 28 Oct 2022 18:26:54 +0000 (11:26 -0700)] 
Merge branch 'tb/remove-unused-pack-bitmap'

When creating a multi-pack bitmap, remove per-pack bitmap files
unconditionally as they will never be consulted.

* tb/remove-unused-pack-bitmap:
  builtin/repack.c: remove redundant pack-based bitmaps

22 months agoMerge branch 'ab/doc-synopsis-and-cmd-usage'
Junio C Hamano [Fri, 28 Oct 2022 18:26:54 +0000 (11:26 -0700)] 
Merge branch 'ab/doc-synopsis-and-cmd-usage'

The short-help text shown by "git cmd -h" and the synopsis text
shown at the beginning of "git help cmd" have been made more
consistent.

* ab/doc-synopsis-and-cmd-usage: (34 commits)
  tests: assert consistent whitespace in -h output
  tests: start asserting that *.txt SYNOPSIS matches -h output
  doc txt & -h consistency: make "worktree" consistent
  worktree: define subcommand -h in terms of command -h
  reflog doc: list real subcommands up-front
  doc txt & -h consistency: make "commit" consistent
  doc txt & -h consistency: make "diff-tree" consistent
  doc txt & -h consistency: use "[<label>...]" for "zero or more"
  doc txt & -h consistency: make "annotate" consistent
  doc txt & -h consistency: make "stash" consistent
  doc txt & -h consistency: add missing options
  doc txt & -h consistency: use "git foo" form, not "git-foo"
  doc txt & -h consistency: make "bundle" consistent
  doc txt & -h consistency: make "read-tree" consistent
  doc txt & -h consistency: make "rerere" consistent
  doc txt & -h consistency: add missing options and labels
  doc txt & -h consistency: make output order consistent
  doc txt & -h consistency: add or fix optional "--" syntax
  doc txt & -h consistency: fix mismatching labels
  doc SYNOPSIS & -h: use "-" to separate words in labels, not "_"
  ...

22 months agoThe seventh batch
Junio C Hamano [Thu, 27 Oct 2022 22:25:55 +0000 (15:25 -0700)] 
The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoSync with 'maint'
Junio C Hamano [Thu, 27 Oct 2022 22:25:24 +0000 (15:25 -0700)] 
Sync with 'maint'

22 months agoDownmerge a bit more for 2.38.2
Junio C Hamano [Thu, 27 Oct 2022 22:24:23 +0000 (15:24 -0700)] 
Downmerge a bit more for 2.38.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge branch 'rs/archive-dedup-printf' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:14 +0000 (15:24 -0700)] 
Merge branch 'rs/archive-dedup-printf' into maint-2.38

Code simplification.

* rs/archive-dedup-printf:
  archive: deduplicate verbose printing

22 months agoMerge branch 'jh/struct-zero-init-with-older-clang' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:13 +0000 (15:24 -0700)] 
Merge branch 'jh/struct-zero-init-with-older-clang' into maint-2.38

Work around older clang that warns against C99 zero initialization
syntax for struct.

* jh/struct-zero-init-with-older-clang:
  config.mak.dev: disable suggest braces error on old clang versions

22 months agoMerge branch 'rs/use-fspathncmp' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:13 +0000 (15:24 -0700)] 
Merge branch 'rs/use-fspathncmp' into maint-2.38

Code clean-up.

* rs/use-fspathncmp:
  dir: use fspathncmp() in pl_hashmap_cmp()

22 months agoMerge branch 'rj/branch-edit-desc-unborn' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:13 +0000 (15:24 -0700)] 
Merge branch 'rj/branch-edit-desc-unborn' into maint-2.38

"git branch --edit-description" on an unborh branch misleadingly
said that no such branch exists, which has been corrected.

* rj/branch-edit-desc-unborn:
  branch: description for non-existent branch errors

22 months agoMerge branch 'pw/remove-rebase-p-test' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:13 +0000 (15:24 -0700)] 
Merge branch 'pw/remove-rebase-p-test' into maint-2.38

Remove outdated test.

* pw/remove-rebase-p-test:
  t3435: remove redundant test case

22 months agoMerge branch 'jc/use-of-uc-in-log-messages' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:13 +0000 (15:24 -0700)] 
Merge branch 'jc/use-of-uc-in-log-messages' into maint-2.38

Clarify that "the sentence after <area>: prefix does not begin with
a capital letter" rule applies only to the commit title.

* jc/use-of-uc-in-log-messages:
  SubmittingPatches: use usual capitalization in the log message body

22 months agoMerge branch 'jc/tmp-objdir' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:12 +0000 (15:24 -0700)] 
Merge branch 'jc/tmp-objdir' into maint-2.38

The code to clean temporary object directories (used for
quarantine) tried to remove them inside its signal handler, which
was a no-no.

* jc/tmp-objdir:
  tmp-objdir: skip clean up when handling a signal

22 months agoMerge branch 'dd/document-runtime-prefix-better' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:12 +0000 (15:24 -0700)] 
Merge branch 'dd/document-runtime-prefix-better' into maint-2.38

Update comment in the Makefile about the RUNTIME_PREFIX config knob.

* dd/document-runtime-prefix-better:
  Makefile: clarify runtime relative gitexecdir

22 months agoMerge branch 'ab/unused-annotation' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:12 +0000 (15:24 -0700)] 
Merge branch 'ab/unused-annotation' into maint-2.38

Compilation fix for ancient compilers.

* ab/unused-annotation:
  git-compat-util.h: GCC deprecated message arg only in GCC 4.5+

22 months agoMerge branch 'tb/midx-repack-ignore-cruft-packs' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:11 +0000 (15:24 -0700)] 
Merge branch 'tb/midx-repack-ignore-cruft-packs' into maint-2.38

"git multi-pack-index repack/expire" used to repack unreachable
cruft into a new pack, which have been corrected.
cf. <63a1c3d4-eff3-af10-4263-058c88e74594@github.com>

* tb/midx-repack-ignore-cruft-packs:
  midx.c: avoid cruft packs with non-zero `repack --batch-size`
  midx.c: remove unnecessary loop condition
  midx.c: replace `xcalloc()` with `CALLOC_ARRAY()`
  midx.c: avoid cruft packs with `repack --batch-size=0`
  midx.c: prevent `expire` from removing the cruft pack
  Documentation/git-multi-pack-index.txt: clarify expire behavior
  Documentation/git-multi-pack-index.txt: fix typo

22 months agoMerge branch 'so/diff-merges-cleanup' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:11 +0000 (15:24 -0700)] 
Merge branch 'so/diff-merges-cleanup' into maint-2.38

Code clean-up.

* so/diff-merges-cleanup:
  diff-merges: clarify log.diffMerges documentation
  diff-merges: cleanup set_diff_merges()
  diff-merges: cleanup func_by_opt()

22 months agoMerge branch 'rj/ref-filter-get-head-description-leakfix' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:11 +0000 (15:24 -0700)] 
Merge branch 'rj/ref-filter-get-head-description-leakfix' into maint-2.38

Leakfix.

* rj/ref-filter-get-head-description-leakfix:
  ref-filter.c: fix a leak in get_head_description

22 months agoMerge branch 'jc/environ-docs' into maint-2.38
Junio C Hamano [Thu, 27 Oct 2022 22:24:09 +0000 (15:24 -0700)] 
Merge branch 'jc/environ-docs' into maint-2.38

Documentation on various Boolean GIT_* environment variables have
been clarified.

* jc/environ-docs:
  environ: GIT_INDEX_VERSION affects not just a new repository
  environ: simplify description of GIT_INDEX_FILE
  environ: GIT_FLUSH should be made a usual Boolean
  environ: explain Boolean environment variables
  environ: document GIT_SSL_NO_VERIFY

22 months agoMakefile: force -O0 when compiling with SANITIZE=leak
Jeff King [Tue, 18 Oct 2022 20:15:33 +0000 (16:15 -0400)] 
Makefile: force -O0 when compiling with SANITIZE=leak

Cherry pick commit d3775de0 (Makefile: force -O0 when compiling with
SANITIZE=leak, 2022-10-18), as otherwise the leak checker at GitHub
Actions CI seems to fail with a false positive.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 months agoMerge branch 'js/cmake-updates'
Junio C Hamano [Thu, 27 Oct 2022 21:51:53 +0000 (14:51 -0700)] 
Merge branch 'js/cmake-updates'

Update to build procedure with VS using CMake/CTest.

* js/cmake-updates:
  cmake: increase time-out for a long-running test
  cmake: avoid editing t/test-lib.sh
  add -p: avoid ambiguous signed/unsigned comparison
  cmake: copy the merge tools for testing
  cmake: make it easier to diagnose regressions in CTest runs

22 months agoMerge branch 'nw/t1002-cleanup'
Junio C Hamano [Thu, 27 Oct 2022 21:51:53 +0000 (14:51 -0700)] 
Merge branch 'nw/t1002-cleanup'

Code clean-up in test.

* nw/t1002-cleanup:
  t1002: modernize outdated conditional

22 months agoMerge branch 'ab/run-hook-api-cleanup'
Junio C Hamano [Thu, 27 Oct 2022 21:51:53 +0000 (14:51 -0700)] 
Merge branch 'ab/run-hook-api-cleanup'

Move a global variable added as a hack during regression fixes to
its proper place in the API.

* ab/run-hook-api-cleanup:
  run-command.c: remove "max_processes", add "const" to signal() handler
  run-command.c: pass "opts" further down, and use "opts->processes"
  run-command.c: use "opts->processes", not "pp->max_processes"
  run-command.c: don't copy "data" to "struct parallel_processes"
  run-command.c: don't copy "ungroup" to "struct parallel_processes"
  run-command.c: don't copy *_fn to "struct parallel_processes"
  run-command.c: make "struct parallel_processes" const if possible
  run-command API: move *_tr2() users to "run_processes_parallel()"
  run-command API: have run_process_parallel() take an "opts" struct
  run-command.c: use designated init for pp_init(), add "const"
  run-command API: don't fall back on online_cpus()
  run-command API: make "n" parameter a "size_t"
  run-command tests: use "return", not "exit"
  run-command API: have "run_processes_parallel{,_tr2}()" return void
  run-command test helper: use "else if" pattern

22 months agoMerge branch 'tb/save-keep-pack-during-geometric-repack'
Junio C Hamano [Thu, 27 Oct 2022 21:51:53 +0000 (14:51 -0700)] 
Merge branch 'tb/save-keep-pack-during-geometric-repack'

When geometric repacking feature is in use together with the
--pack-kept-objects option, we lost packs marked with .keep files.

* tb/save-keep-pack-during-geometric-repack:
  repack: don't remove .keep packs with `--pack-kept-objects`

22 months agoMerge branch 'jk/unused-anno-more'
Junio C Hamano [Thu, 27 Oct 2022 21:51:52 +0000 (14:51 -0700)] 
Merge branch 'jk/unused-anno-more'

More UNUSED annotation to help using -Wunused option with the
compiler.

* jk/unused-anno-more:
  ll-merge: mark unused parameters in callbacks
  diffcore-pickaxe: mark unused parameters in pickaxe functions
  convert: mark unused parameter in null stream filter
  apply: mark unused parameters in noop error/warning routine
  apply: mark unused parameters in handlers
  date: mark unused parameters in handler functions
  string-list: mark unused callback parameters
  object-file: mark unused parameters in hash_unknown functions
  mark unused parameters in trivial compat functions
  update-index: drop unused argc from do_reupdate()
  submodule--helper: drop unused argc from module_list_compute()
  diffstat_consume(): assert non-zero length