]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 years agoMerge branch 'rs/combine-diff-with-incompatible-options' into maint
Junio C Hamano [Wed, 27 Jul 2022 20:00:32 +0000 (13:00 -0700)] 
Merge branch 'rs/combine-diff-with-incompatible-options' into maint

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2 years agoshortlog: use a stable sort
Johannes Schindelin [Thu, 14 Jul 2022 15:43:49 +0000 (15:43 +0000)] 
shortlog: use a stable sort

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

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

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

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

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

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

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

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

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

This is a simple reproducer:

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

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

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

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

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

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

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodiff-files: move misplaced cleanup label
Jeff King [Tue, 12 Jul 2022 07:03:45 +0000 (03:03 -0400)] 
diff-files: move misplaced cleanup label

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

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

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

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

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

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

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

Reported-by: Matthew Klein <mklein994@gmail.com>
Signed-off-by: Fernando Ramos <greenfoo@u92.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomerge-ort: fix issue with dual rename and add/add conflict
Elijah Newren [Tue, 5 Jul 2022 01:33:43 +0000 (01:33 +0000)] 
merge-ort: fix issue with dual rename and add/add conflict

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

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

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

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

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

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

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

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

No functional changes, just some preparatory cleanups.

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

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

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

reversing the direction of the merge provides a different error:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoadd --interactive: allow `update` to stage deleted files
Johannes Schindelin [Tue, 28 Jun 2022 22:22:44 +0000 (22:22 +0000)] 
add --interactive: allow `update` to stage deleted files

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

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

Reported-by: Christoph Reiter <reiter.christoph@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoSync with Git 2.36.2
Junio C Hamano [Mon, 27 Jun 2022 19:36:11 +0000 (12:36 -0700)] 
Sync with Git 2.36.2

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

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

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

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

l10n-2.37.0-rnd1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Thu, 23 Jun 2022 13:01:47 +0000 (21:01 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2 years agoGit 2.31.4 v2.31.4
Johannes Schindelin [Thu, 23 Jun 2022 10:35:25 +0000 (12:35 +0200)] 
Git 2.31.4

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

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

2 years agoGit 2.30.5 v2.30.5
Johannes Schindelin [Fri, 27 May 2022 21:38:36 +0000 (23:38 +0200)] 
Git 2.30.5

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agosetup: tighten ownership checks post CVE-2022-24765
Carlo Marcelo Arenas Belón [Tue, 10 May 2022 19:35:29 +0000 (12:35 -0700)] 
setup: tighten ownership checks post CVE-2022-24765

8959555cee7 (setup_git_directory(): add an owner check for the top-level
directory, 2022-03-02), adds a function to check for ownership of
repositories using a directory that is representative of it, and ways to
add exempt a specific repository from said check if needed, but that
check didn't account for owership of the gitdir, or (when used) the
gitfile that points to that gitdir.

An attacker could create a git repository in a directory that they can
write into but that is owned by the victim to work around the fix that
was introduced with CVE-2022-24765 to potentially run code as the
victim.

An example that could result in privilege escalation to root in *NIX would
be to set a repository in a shared tmp directory by doing (for example):

  $ git -C /tmp init

To avoid that, extend the ensure_valid_ownership function to be able to
check for all three paths.

This will have the side effect of tripling the number of stat() calls
when a repository is detected, but the effect is expected to be likely
minimal, as it is done only once during the directory walk in which Git
looks for a repository.

Additionally make sure to resolve the gitfile (if one was used) to find
the relevant gitdir for checking.

While at it change the message printed on failure so it is clear we are
referring to the repository by its worktree (or gitdir if it is bare) and
not to a specific directory.

Helped-by: Junio C Hamano <junio@pobox.com>
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
2 years agoMerge branch 'cb/path-owner-check-with-sudo'
Junio C Hamano [Thu, 26 May 2022 21:51:32 +0000 (14:51 -0700)] 
Merge branch 'cb/path-owner-check-with-sudo'

With a recent update to refuse access to repositories of other
people by default, "sudo make install" and "sudo git describe"
stopped working.  This series intends to loosen it while keeping
the safety.

* cb/path-owner-check-with-sudo:
  t0034: add negative tests and allow git init to mostly work under sudo
  git-compat-util: avoid failing dir ownership checks if running privileged
  t: regression git needs safe.directory when using sudo

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2 years agol10n: po-id for 2.37 (first batch)
Bagas Sanjaya [Wed, 15 Jun 2022 07:33:28 +0000 (14:33 +0700)] 
l10n: po-id for 2.37 (first batch)

Update following components:

  - apply.c
  - builtin/bisect--helper.c
  - builtin/fetch.c
  - builtin/fsck.c
  - builtin/log.c
  - builtin/notes.c
  - builtin/push.c
  - builtin/submodule--helper.c
  - builtin/worktree.c
  - index-pack.c
  - init-db.c
  - remote.c

Translate following new components:

  - attr.c
  - builtin/name-rev.c
  - builtin/pack-objects.c
  - builtin/pack-refs.c
  - builtin/prune.c
  - builtin/update-server-info.c
  - object-file.c
  - object-name.c
  - object.c
  - pack-bitmap.c
  - pack-mtimes.c
  - pack-revindex.c
  - pack-write.c
  - packfile.c

Besides above, fix minor grammatical issues.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2 years agol10n: tr: v2.37.0 round #1
Emir SARI [Wed, 15 Jun 2022 14:48:40 +0000 (17:48 +0300)] 
l10n: tr: v2.37.0 round #1

Signed-off-by: Emir SARI <emir_sari@icloud.com>
2 years agoMerge branch 'master' of github.com:ruester/git-po-de
Jiang Xin [Thu, 23 Jun 2022 02:45:03 +0000 (10:45 +0800)] 
Merge branch 'master' of github.com:ruester/git-po-de

* 'master' of github.com:ruester/git-po-de:
  l10n: TEAMS: Change German translation team leader
  l10n: de.po: Update German translation

2 years agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Thu, 23 Jun 2022 02:44:43 +0000 (10:44 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

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

2 years agoMerge branch 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po
Jiang Xin [Thu, 23 Jun 2022 02:44:30 +0000 (10:44 +0800)] 
Merge branch 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po

* 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po:
  l10n: zh_CN: v2.37.0 round 1

2 years agol10n: README: fix typo
Arthur Milchior [Wed, 22 Jun 2022 19:50:44 +0000 (19:50 +0000)] 
l10n: README: fix typo

This 10-year old typo was introduced at 75b182ae (Update l10n guide:
change the repository URL, etc, 2012-03-02). The word "l10" should be
"l10n".

Signed-off-by: Arthur Milchior <arthur@milchior.fr>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2 years agol10n: TEAMS: Change German translation team leader
Matthias Rüster [Tue, 21 Jun 2022 18:24:14 +0000 (20:24 +0200)] 
l10n: TEAMS: Change German translation team leader

Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2 years agol10n: de.po: Update German translation
Matthias Rüster [Sun, 19 Jun 2022 18:55:59 +0000 (20:55 +0200)] 
l10n: de.po: Update German translation

Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
2 years agoGit 2.37-rc2 v2.37.0-rc2
Junio C Hamano [Wed, 22 Jun 2022 16:07:56 +0000 (09:07 -0700)] 
Git 2.37-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'tb/cruft-packs'
Junio C Hamano [Wed, 22 Jun 2022 16:06:37 +0000 (09:06 -0700)] 
Merge branch 'tb/cruft-packs'

Docfix.

* tb/cruft-packs:
  gc: simplify --cruft description

2 years agol10n: bg.po: Updated Bulgarian translation (5367t)
Alexander Shopov [Sun, 12 Jun 2022 08:56:04 +0000 (10:56 +0200)] 
l10n: bg.po: Updated Bulgarian translation (5367t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2 years agol10n: zh_CN: v2.37.0 round 1
Fangyi Zhou [Wed, 22 Jun 2022 09:28:36 +0000 (10:28 +0100)] 
l10n: zh_CN: v2.37.0 round 1

Reviewed-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Fangyi Zhou <me@fangyi.io>
2 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Wed, 22 Jun 2022 07:46:22 +0000 (15:46 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git:
  name-rev: prefix annotate-stdin with '--' in message
  git-prompt: fix expansion of branch colour codes
  git-prompt: make colourization consistent

2 years agodir: minor refactoring / clean-up
Goss Geppert [Thu, 16 Jun 2022 23:44:33 +0000 (23:44 +0000)] 
dir: minor refactoring / clean-up

Narrow the scope of the `nested_repo` variable and conditional return
statement to the block where the variable is set.

Signed-off-by: Goss Geppert <ggossdev@gmail.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agodir: traverse into repository
Goss Geppert [Thu, 16 Jun 2022 23:19:55 +0000 (23:19 +0000)] 
dir: traverse into repository

Since 8d92fb2927 (dir: replace exponential algorithm with a linear one,
2020-04-01) traversing into a repository's directory tree when the
traversal began outside the repository's standard location has failed
because the encountered repository was identified as a nested foreign
repository.

Prior to this commit, the failure to traverse into a repository's
default worktree location was observable from a user's perspective under
either of the following conditions (there may be others):

    1) Set the `core.worktree` location to a parent directory of the
       default worktree; or
    2) Use the `--git_dir` option while the working directory is outside
       the repository's default worktree location

Under either of these conditions, symptoms of the failure to traverse
into the repository's default worktree location include the inability to
add files to the index or get a list of untracked files via ls-files.

This commit adds a check to determine whether a nested repository that
is encountered in recursing a path is actually `the_repository`.  If so,
we simply treat the directory as if it doesn't contain a nested
repository.

The commit includes test-cases to reduce the likelihood of future
regressions.

Signed-off-by: Goss Geppert <ggossdev@gmail.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agomktree: do not check type of remote objects
Richard Oliver [Tue, 21 Jun 2022 13:59:39 +0000 (14:59 +0100)] 
mktree: do not check type of remote objects

With 31c8221a (mktree: validate entry type in input, 2009-05-14), we
called the sha1_object_info() API to obtain the type information, but
allowed the call to silently fail when the object was missing locally,
so that we can sanity-check the types opportunistically when the
object did exist.

The implementation is understandable because back then there was no
lazy/on-demand downloading of individual objects from the promisor
remotes that causes a long delay and materializes the object, hence
defeating the point of using "--missing".  The design is hurting us
now.

We could bypass the opportunistic type/mode consistency check
altogether when "--missing" is given, but instead, use the
oid_object_info_extended() API and tell it that we are only interested
in objects that locally exist and are immediately available by passing
OBJECT_INFO_SKIP_FETCH_OBJECT bit to it.  That way, we will still
retain the cheap and opportunistic sanity check for local objects.

Signed-off-by: Richard Oliver <roliver@roku.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'jp/prompt-clear-before-upstream-mark'
Junio C Hamano [Tue, 21 Jun 2022 17:07:50 +0000 (10:07 -0700)] 
Merge branch 'jp/prompt-clear-before-upstream-mark'

Bash command line prompt (in contrib/) update.

* jp/prompt-clear-before-upstream-mark:
  git-prompt: fix expansion of branch colour codes
  git-prompt: make colourization consistent

2 years agoi18n: mark message helpers prefix for translation
Dimitriy Ryazantcev [Tue, 21 Jun 2022 13:57:57 +0000 (13:57 +0000)] 
i18n: mark message helpers prefix for translation

Some messages prefixes like 'usage:'/'fatal:'/'warning:'/'error:'
were not translated.

Signed-off-by: Dimiytriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocombine-diff: abort if --output is given
René Scharfe [Sat, 18 Jun 2022 11:12:34 +0000 (13:12 +0200)] 
combine-diff: abort if --output is given

The code for combined diffs currently only writes to stdout.  Abort and
report that fact instead of silently ignoring the --output option.  The
(empty) output file has already been created at that point, though.

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agocombine-diff: abort if --ignore-matching-lines is given
René Scharfe [Sat, 18 Jun 2022 11:12:28 +0000 (13:12 +0200)] 
combine-diff: abort if --ignore-matching-lines is given

The code for combined diffs doesn't currently support ignoring changes
that match a regex.  Abort and report that fact instead of running into
a segfault.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agogc: simplify --cruft description
René Scharfe [Sun, 19 Jun 2022 05:38:50 +0000 (07:38 +0200)] 
gc: simplify --cruft description

Remove duplicate "loose objects".

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoname-rev: prefix annotate-stdin with '--' in message
Alexander Shopov [Mon, 20 Jun 2022 16:44:34 +0000 (18:44 +0200)] 
name-rev: prefix annotate-stdin with '--' in message

This is an option rather than command.  Make the message convey this
similar to the other messages in the file.

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Sat, 18 Jun 2022 06:02:07 +0000 (14:02 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git: (22 commits)
  Git 2.37-rc1
  git-compat-util: allow root to access both SUDO_UID and root owned
  i18n: fix mismatched camelCase config variables
  Another batch of fixes before -rc1
  bug_fl(): correctly initialize trace2 va_list
  relative_url(): fix incorrect condition
  pack-mtimes: avoid closing a bogus file descriptor
  read_index_from(): avoid memory leak
  submodule--helper: avoid memory leak when fetching submodules
  submodule-config: avoid memory leak
  fsmonitor: avoid memory leak in `fsm_settings__get_incompatible_msg()`
  cache-tree: remove cache_tree_find_path()
  pack-write: drop always-NULL parameter
  t5329: test 'git gc --cruft' without '--prune=now'
  t2107: test 'git update-index --verbose'
  perf-lib: fix missing test titles in output
  transfer doc: move fetch.credentialsInUrl to "transfer" config namespace
  fetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate
  ci(github): also mark up compile errors
  ci(github): use grouping also in the `win-build` job
  ...

2 years agoGit 2.37-rc1 v2.37.0-rc1
Junio C Hamano [Sat, 18 Jun 2022 00:15:13 +0000 (17:15 -0700)] 
Git 2.37-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'cb/path-owner-check-with-sudo-plus'
Junio C Hamano [Sat, 18 Jun 2022 00:12:31 +0000 (17:12 -0700)] 
Merge branch 'cb/path-owner-check-with-sudo-plus'

"sudo git foo" used to consider a repository owned by the original
user a safe one to access; it now also considers a repository owned
by root a safe one, too (after all, if an attacker can craft a
malicious repository owned by root, the box is 0wned already).

* cb/path-owner-check-with-sudo-plus:
  git-compat-util: allow root to access both SUDO_UID and root owned

2 years agogit-compat-util: allow root to access both SUDO_UID and root owned
Carlo Marcelo Arenas Belón [Fri, 17 Jun 2022 20:23:38 +0000 (13:23 -0700)] 
git-compat-util: allow root to access both SUDO_UID and root owned

Previous changes introduced a regression which will prevent root for
accessing repositories owned by thyself if using sudo because SUDO_UID
takes precedence.

Loosen that restriction by allowing root to access repositories owned
by both uid by default and without having to add a safe.directory
exception.

A previous workaround that was documented in the tests is no longer
needed so it has been removed together with its specially crafted
prerequisite.

Helped-by: Johanness Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoi18n: fix mismatched camelCase config variables
Jiang Xin [Fri, 17 Jun 2022 10:03:09 +0000 (18:03 +0800)] 
i18n: fix mismatched camelCase config variables

Some config variables are combinations of multiple words, and we
typically write them in camelCase forms in manpage and translatable
strings. It's not easy to find mismatches for these camelCase config
variables during code reviews, but occasionally they are identified
during localization translations.

To check for mismatched config variables, I introduced a new feature
in the helper program for localization[^1]. The following mismatched
config variables have been identified by running the helper program,
such as "git-po-helper check-pot".

Lowercase in manpage should use camelCase:

 * Documentation/config/http.txt: http.pinnedpubkey

Lowercase in translable strings should use camelCase:

 * builtin/fast-import.c:  pack.indexversion
 * builtin/gc.c:           gc.logexpiry
 * builtin/index-pack.c:   pack.indexversion
 * builtin/pack-objects.c: pack.indexversion
 * builtin/repack.c:       pack.writebitmaps
 * commit.c:               i18n.commitencoding
 * gpg-interface.c:        user.signingkey
 * http.c:                 http.postbuffer
 * submodule-config.c:     submodule.fetchjobs

Mismatched camelCases, choose the former:

 * Documentation/config/transfer.txt: transfer.credentialsInUrl
   remote.c:                          transfer.credentialsInURL

[^1]: https://github.com/git-l10n/git-po-helper

Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoAnother batch of fixes before -rc1
Junio C Hamano [Fri, 17 Jun 2022 17:33:42 +0000 (10:33 -0700)] 
Another batch of fixes before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agoMerge branch 'jk/bug-fl-va-list-fix'
Junio C Hamano [Fri, 17 Jun 2022 17:33:32 +0000 (10:33 -0700)] 
Merge branch 'jk/bug-fl-va-list-fix'

Fix buggy va_list usage in recent code.

* jk/bug-fl-va-list-fix:
  bug_fl(): correctly initialize trace2 va_list

2 years agoMerge branch 'ab/credentials-in-url-more'
Junio C Hamano [Fri, 17 Jun 2022 17:33:32 +0000 (10:33 -0700)] 
Merge branch 'ab/credentials-in-url-more'

Rename fetch.credentialsInUrl to transfer.credentialsInUrl as the
single configuration variable should work both in pushing and
fetching.

* ab/credentials-in-url-more:
  transfer doc: move fetch.credentialsInUrl to "transfer" config namespace
  fetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate

2 years agoMerge branch 'js/ci-github-workflow-markup'
Junio C Hamano [Fri, 17 Jun 2022 17:33:32 +0000 (10:33 -0700)] 
Merge branch 'js/ci-github-workflow-markup'

Recent CI update hides certain failures in test jobs, which has
been corrected.

* js/ci-github-workflow-markup:
  ci(github): also mark up compile errors
  ci(github): use grouping also in the `win-build` job
  ci(github): bring back the 'print test failures' step

2 years agoMerge branch 'js/misc-fixes'
Junio C Hamano [Fri, 17 Jun 2022 17:33:31 +0000 (10:33 -0700)] 
Merge branch 'js/misc-fixes'

Assorted fixes to problems found by Coverity.

* js/misc-fixes:
  relative_url(): fix incorrect condition
  pack-mtimes: avoid closing a bogus file descriptor
  read_index_from(): avoid memory leak
  submodule--helper: avoid memory leak when fetching submodules
  submodule-config: avoid memory leak
  fsmonitor: avoid memory leak in `fsm_settings__get_incompatible_msg()`

2 years agoMerge branch 'jc/cocci-cleanup'
Junio C Hamano [Fri, 17 Jun 2022 17:33:31 +0000 (10:33 -0700)] 
Merge branch 'jc/cocci-cleanup'

Remove a coccinelle rule that is no longer relevant.

* jc/cocci-cleanup:
  cocci: retire is_null_sha1() rule

2 years agoMerge branch 'ds/more-test-coverage'
Junio C Hamano [Fri, 17 Jun 2022 17:33:31 +0000 (10:33 -0700)] 
Merge branch 'ds/more-test-coverage'

Improve test coverage with a handful of tests.

* ds/more-test-coverage:
  cache-tree: remove cache_tree_find_path()
  pack-write: drop always-NULL parameter
  t5329: test 'git gc --cruft' without '--prune=now'
  t2107: test 'git update-index --verbose'

2 years agoMerge branch 'jk/perf-lib-test-titles'
Junio C Hamano [Fri, 17 Jun 2022 17:33:31 +0000 (10:33 -0700)] 
Merge branch 'jk/perf-lib-test-titles'

Show test titles to the performance test output again.

* jk/perf-lib-test-titles:
  perf-lib: fix missing test titles in output

2 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Fri, 17 Jun 2022 00:57:35 +0000 (08:57 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git:
  builtin/rebase: remove a redundant space in l10n string

2 years agobug_fl(): correctly initialize trace2 va_list
Jeff King [Thu, 16 Jun 2022 20:04:25 +0000 (16:04 -0400)] 
bug_fl(): correctly initialize trace2 va_list

The code added 0cc05b044f (usage.c: add a non-fatal bug() function to go
with BUG(), 2022-06-02) sets up two va_list variables: one to output to
stderr, and one to trace2. But the order of initialization is wrong:

  va_list ap, cp;
  va_copy(cp, ap);
  va_start(ap, fmt);

We copy the contents of "ap" into "cp" before it is initialized, meaning
it is full of garbage. The two should be swapped.

However, there's another bug, noticed by Johannes Schindelin: we forget
to call va_end() for the copy. So instead of just fixing the copy's
initialization, let's do two separate start/end pairs. This is allowed
by the standard, and we don't need to use copy here since we have access
to the original varargs. Matching the pairs with the calls makes it more
obvious that everything is being done correctly.

Note that we do call bug_fl() in the tests, but it didn't trigger this
problem because our format string doesn't have any placeholders. So even
though we were passing a garbage va_list through the stack, nobody ever
needed to look at it. We can easily adjust one of the trace2 tests to
trigger this, both for bug() and for BUG(). The latter isn't broken, but
it's nice to exercise both a bit more. Without the fix in this patch
(but with the test change), the bug() case causes a segfault.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agorelative_url(): fix incorrect condition
Johannes Schindelin [Wed, 15 Jun 2022 23:35:44 +0000 (23:35 +0000)] 
relative_url(): fix incorrect condition

In 63e95beb085c (submodule: port resolve_relative_url from shell to C,
2016-04-15), we added a loop over `url` where we are looking for `../`
or `./` components.

The loop condition we used is the pointer `url` itself, which is clearly
not what we wanted.

Pointed out by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 years agopack-mtimes: avoid closing a bogus file descriptor
Johannes Schindelin [Wed, 15 Jun 2022 23:35:43 +0000 (23:35 +0000)] 
pack-mtimes: avoid closing a bogus file descriptor

In 94cd775a6c52 (pack-mtimes: support reading .mtimes files,
2022-05-20), code was added to close the file descriptor corresponding
to the mtimes file.

However, it is possible that opening that file failed, in which case we
are closing a file descriptor with the value `-1`. Let's guard that
`close()` call.

Reported by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>