]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
3 years agoMerge branch 'jc/clone-remote-name-leak-fix' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:53 +0000 (14:27 -0700)] 
Merge branch 'jc/clone-remote-name-leak-fix' into maint

"git clone --origin X" leaked piece of memory that held value read
from the clone.defaultRemoteName configuration variable, which has
been plugged.
source: <xmqqlevl4ysk.fsf@gitster.g>

* jc/clone-remote-name-leak-fix:
  clone: plug a miniscule leak

3 years agoMerge branch 'ds/midx-normalize-pathname-before-comparison' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:53 +0000 (14:27 -0700)] 
Merge branch 'ds/midx-normalize-pathname-before-comparison' into maint

The path taken by "git multi-pack-index" command from the end user
was compared with path internally prepared by the tool withut first
normalizing, which lead to duplicated paths not being noticed,
which has been corrected.
source: <pull.1221.v2.git.1650911234.gitgitgadget@gmail.com>

* ds/midx-normalize-pathname-before-comparison:
  cache: use const char * for get_object_directory()
  multi-pack-index: use --object-dir real path
  midx: use real paths in lookup_multi_pack_index()

3 years agoMerge branch 'ah/rebase-keep-base-fix' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:52 +0000 (14:27 -0700)] 
Merge branch 'ah/rebase-keep-base-fix' into maint

"git rebase --keep-base <upstream> <branch-to-rebase>" computed the
commit to rebase onto incorrectly, which has been corrected.
source: <20220421044233.894255-1-alexhenrie24@gmail.com>

* ah/rebase-keep-base-fix:
  rebase: use correct base for --keep-base when a branch is given

3 years agoMerge branch 'pw/test-malloc-with-sanitize-address' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:52 +0000 (14:27 -0700)] 
Merge branch 'pw/test-malloc-with-sanitize-address' into maint

Avoid problems from interaction between malloc_check and address
sanitizer.
source: <pull.1210.git.1649507317350.gitgitgadget@gmail.com>

* pw/test-malloc-with-sanitize-address:
  tests: make SANITIZE=address imply TEST_NO_MALLOC_CHECK

3 years agoMerge branch 'rs/commit-summary-wo-break-rewrite' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:52 +0000 (14:27 -0700)] 
Merge branch 'rs/commit-summary-wo-break-rewrite' into maint

The commit summary shown after making a commit is matched to what
is given in "git status" not to use the break-rewrite heuristics.
source: <c35bd0aa-2e46-e710-2b39-89f18bad0097@web.de>

* rs/commit-summary-wo-break-rewrite:
  commit, sequencer: turn off break_opt for commit summary

3 years agoMerge branch 'mg/detect-compiler-in-c-locale' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:52 +0000 (14:27 -0700)] 
Merge branch 'mg/detect-compiler-in-c-locale' into maint

Build procedure fixup.
source: <f306f43f375bc9b9c98e85260587442e5d9ef0ba.1652094958.git.git@grubix.eu>

* mg/detect-compiler-in-c-locale:
  detect-compiler: make detection independent of locale

3 years agoMerge branch 'cb/ci-make-p4-optional' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:51 +0000 (14:27 -0700)] 
Merge branch 'cb/ci-make-p4-optional' into maint

macOS CI jobs have been occasionally flaky due to tentative version
skew between perforce and the homebrew packager.  Instead of
failing the whole CI job, just let it skip the p4 tests when this
happens.
source: <20220512223940.238367-1-gitster@pobox.com>

* cb/ci-make-p4-optional:
  ci: use https, not http to download binaries from perforce.com
  ci: reintroduce prevention from perforce being quarantined in macOS
  ci: avoid brew for installing perforce
  ci: make failure to find perforce more user friendly

3 years agoMerge branch 'ab/valgrind-fixes' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:51 +0000 (14:27 -0700)] 
Merge branch 'ab/valgrind-fixes' into maint

A bit of test framework fixes with a few fixes to issues found by
valgrind.
source: <20220512223218.237544-1-gitster@pobox.com>

* ab/valgrind-fixes:
  commit-graph.c: don't assume that stat() succeeds
  object-file: fix a unpack_loose_header() regression in 3b6a8db3b03
  log test: skip a failing mkstemp() test under valgrind
  tests: using custom GIT_EXEC_PATH breaks --valgrind tests

3 years agoMerge branch 'jc/archive-add-file-normalize-mode' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:51 +0000 (14:27 -0700)] 
Merge branch 'jc/archive-add-file-normalize-mode' into maint

"git archive --add-file=<path>" picked up the raw permission bits
from the path and propagated to zip output in some cases, without
normalization, which has been corrected (tar output did not have
this issue).
source: <xmqqmtfme8v6.fsf@gitster.g>

* jc/archive-add-file-normalize-mode:
  archive: do not let on-disk mode leak to zip archives

3 years agoMerge branch 'jc/show-branch-g-current' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:51 +0000 (14:27 -0700)] 
Merge branch 'jc/show-branch-g-current' into maint

The "--current" option of "git show-branch" should have been made
incompatible with the "--reflog" mode, but this was not enforced,
which has been corrected.
source: <xmqqh76mf7s4.fsf_-_@gitster.g>

* jc/show-branch-g-current:
  show-branch: -g and --current are incompatible

3 years agoMerge branch 'jc/update-ozlabs-url' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:50 +0000 (14:27 -0700)] 
Merge branch 'jc/update-ozlabs-url' into maint

Update URL to the gitk repository.

* jc/update-ozlabs-url:
  SubmittingPatches: use more stable git.ozlabs.org URL

3 years agoMerge branch 'jc/http-clear-finished-pointer' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:50 +0000 (14:27 -0700)] 
Merge branch 'jc/http-clear-finished-pointer' into maint

Meant to go with js/ci-gcc-12-fixes.
source: <xmqq7d68ytj8.fsf_-_@gitster.g>

* jc/http-clear-finished-pointer:
  http.c: clear the 'finished' member once we are done with it

3 years agoMerge branch 'js/ci-gcc-12-fixes' into maint
Junio C Hamano [Wed, 8 Jun 2022 21:27:50 +0000 (14:27 -0700)] 
Merge branch 'js/ci-gcc-12-fixes' into maint

Fixes real problems noticed by gcc 12 and works around false
positives.
source: <pull.1238.git.1653351786.gitgitgadget@gmail.com>

* js/ci-gcc-12-fixes:
  dir.c: avoid "exceeds maximum object size" error with GCC v12.x
  nedmalloc: avoid new compile error
  compat/win32/syslog: fix use-after-realloc

3 years agohttp.c: clear the 'finished' member once we are done with it
Junio C Hamano [Thu, 26 May 2022 19:37:31 +0000 (12:37 -0700)] 
http.c: clear the 'finished' member once we are done with it

In http.c, the run_active_slot() function allows the given "slot" to
make progress by calling step_active_slots() in a loop repeatedly,
and the loop is not left until the request held in the slot
completes.

Ages ago, we used to use the slot->in_use member to get out of the
loop, which misbehaved when the request in "slot" completes (at
which time, the result of the request is copied away from the slot,
and the in_use member is cleared, making the slot ready to be
reused), and the "slot" gets reused to service a different request
(at which time, the "slot" becomes in_use again, even though it is
for a different request).  The loop terminating condition mistakenly
thought that the original request has yet to be completed.

Today's code, after baa7b67d (HTTP slot reuse fixes, 2006-03-10)
fixed this issue, uses a separate "slot->finished" member that is
set in run_active_slot() to point to an on-stack variable, and the
code that completes the request in finish_active_slot() clears the
on-stack variable via the pointer to signal that the particular
request held by the slot has completed.  It also clears the in_use
member (as before that fix), so that the slot itself can safely be
reused for an unrelated request.

One thing that is not quite clean in this arrangement is that,
unless the slot gets reused, at which point the finished member is
reset to NULL, the member keeps the value of &finished, which
becomes a dangling pointer into the stack when run_active_slot()
returns.  Clear the finished member before the control leaves the
function, which has a side effect of unconfusing compilers like
recent GCC 12 that is over-eager to warn against such an assignment.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodir.c: avoid "exceeds maximum object size" error with GCC v12.x
Johannes Schindelin [Tue, 24 May 2022 00:23:06 +0000 (00:23 +0000)] 
dir.c: avoid "exceeds maximum object size" error with GCC v12.x

Technically, the pointer difference `end - start` _could_ be negative,
and when cast to an (unsigned) `size_t` that would cause problems. In
this instance, the symptom is:

dir.c: In function 'git_url_basename':
dir.c:3087:13: error: 'memchr' specified bound [9223372036854775808, 0]
       exceeds maximum object size 9223372036854775807
       [-Werror=stringop-overread]
    CC ewah/bitmap.o
 3087 |         if (memchr(start, '/', end - start) == NULL
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

While it is a bit far-fetched to think that `end` (which is defined as
`repo + strlen(repo)`) and `start` (which starts at `repo` and never
steps beyond the NUL terminator) could result in such a negative
difference, GCC has no way of knowing that.

See also https://gcc.gnu.org/bugzilla//show_bug.cgi?id=85783.

Let's just add a safety check, primarily for GCC's benefit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agonedmalloc: avoid new compile error
Johannes Schindelin [Tue, 24 May 2022 00:23:04 +0000 (00:23 +0000)] 
nedmalloc: avoid new compile error

GCC v12.x complains thusly:

compat/nedmalloc/nedmalloc.c: In function 'DestroyCaches':
compat/nedmalloc/nedmalloc.c:326:12: error: the comparison will always
                              evaluate as 'true' for the address of 'caches'
                              will never be NULL [-Werror=address]
  326 |         if(p->caches)
      |            ^
compat/nedmalloc/nedmalloc.c:196:22: note: 'caches' declared here
  196 |         threadcache *caches[THREADCACHEMAXCACHES];
      |                      ^~~~~~

... and it is correct, of course.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocompat/win32/syslog: fix use-after-realloc
Johannes Schindelin [Tue, 24 May 2022 00:23:03 +0000 (00:23 +0000)] 
compat/win32/syslog: fix use-after-realloc

Git for Windows' SDK recently upgraded to GCC v12.x which points out
that the `pos` variable might be used even after the corresponding
memory was `realloc()`ed and therefore potentially no longer valid.

Since a subset of this SDK is used in Git's CI/PR builds, we need to fix
this to continue to be able to benefit from the CI/PR runs.

Note: This bug has been with us since 2a6b149c64f6 (mingw: avoid using
strbuf in syslog, 2011-10-06), and while it looks tempting to replace
the hand-rolled string manipulation with a `strbuf`-based one, that
commit's message explains why we cannot do that: The `syslog()` function
is called as part of the function in `daemon.c` which is set as the
`die()` routine, and since `strbuf_grow()` can call that function if it
runs out of memory, this would cause a nasty infinite loop that we do
not want to re-introduce.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoci: use https, not http to download binaries from perforce.com
Ævar Arnfjörð Bjarmason [Thu, 12 May 2022 22:39:40 +0000 (15:39 -0700)] 
ci: use https, not http to download binaries from perforce.com

Since 522354d70f4 (Add Travis CI support, 2015-11-27) the CI has used
http://filehost.perforce.com/perforce/ to download binaries from
filehost.perforce.com, they were then moved to this script in
657343a602e (travis-ci: move Travis CI code into dedicated scripts,
2017-09-10).

Let's use https instead for good measure. I don't think we need to
worry about the DNS or network between the GitHub CI and perforce.com
being MitM'd, but using https gives us extra validation of the payload
at least, and is one less thing to worry about when checking where
else we rely on non-TLS'd http connections.

Also, use the same download site at perforce.com for Linux and macOS
tarballs for consistency.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoci: reintroduce prevention from perforce being quarantined in macOS
Carlo Marcelo Arenas Belón [Thu, 12 May 2022 22:39:39 +0000 (15:39 -0700)] 
ci: reintroduce prevention from perforce being quarantined in macOS

5ed9fc3fc86 (ci: prevent `perforce` from being quarantined, 2020-02-27)
introduces this prevention for brew, but brew has been removed in a
previous commit, so reintroduce an equivalent option to avoid a possible
regression.

This doesn't affect github actions (as configure now) and is therefore
done silently to avoid any possible scary irrelevant messages.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoci: avoid brew for installing perforce
Carlo Marcelo Arenas Belón [Thu, 12 May 2022 22:39:38 +0000 (15:39 -0700)] 
ci: avoid brew for installing perforce

Perfoce's cask in brew is meant[1] to be used only by humans, so replace
its use from the CI with a scripted binary download which is less likely
to fail, as it is done in Linux.

Kept the logic together so it will be less likely to break when moved
around as on the fly code changes in this area are settled, at which
point it will also feasable to ammend it to avoid some of the hardcoded
values by using similar variables to the ones Linux does.

In that same line, a POSIX sh syntax is used instead of the similar one
used in Linux in preparation for an unrelated future change that might
change the shell currently configured for it.

This change reintroduces the risk that the installed binaries might not
work because of being quarantined that was fixed with 5ed9fc3fc86 (ci:
prevent `perforce` from being quarantined, 2020-02-27) but fixing that
now was also punted for simplicity and since the affected cloud provider
is scheduled to be retired with an on the fly change, but should be
addressed if that other change is not integrated further.

The discussion on the need to keep 2 radically different versions of
the binaries to be tested with Linux vs macOS or how to upgrade to
newer versions now that brew won't do that automatically for us has
been punted for now as well.  On that line the now obsolete comment
about it in lib.sh was originally being updated by this change but
created conflicts as it is moved around by other on the fly changes,
so will be addressed independently as well.

[1] https://github.com/Homebrew/homebrew-cask/pull/122347#discussion_r856026584

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoci: make failure to find perforce more user friendly
Carlo Marcelo Arenas Belón [Thu, 12 May 2022 22:39:37 +0000 (15:39 -0700)] 
ci: make failure to find perforce more user friendly

In preparation for a future change that will make perforce installation
optional in macOS, make sure that the check for it is done without
triggering scary looking errors and add a user friendly message instead.

All other existing uses of 'type <cmd>' in our shell scripts that
check the availability of a command <cmd> send both standard output
and error stream to /dev/null to squelch "<cmd> not found" diagnostic
output, but this script left the standard error stream shown.

Redirect it just like everybody else to squelch this error message that
we fully expect to see.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocommit-graph.c: don't assume that stat() succeeds
Ævar Arnfjörð Bjarmason [Thu, 12 May 2022 22:32:17 +0000 (15:32 -0700)] 
commit-graph.c: don't assume that stat() succeeds

Fix code added in 8d84097f965 (commit-graph: expire commit-graph
files, 2019-06-18) to check the return value of the stat() system
call. Not doing so caused us to use uninitialized memory in the "Bloom
generation is limited by --max-new-filters" test in
t4216-log-bloom.sh:

+ rm -f trace.event
+ pwd
+ GIT_TRACE2_EVENT=[...]/t/trash directory.t4216-log-bloom/limits/trace.event git commit-graph write --reachable --split=replace --changed-paths --max-new-filters=2
==24835== Syscall param utimensat(times[0].tv_sec) points to uninitialised byte(s)
==24835==    at 0x499E65A: __utimensat64_helper (utimensat.c:34)
==24835==    by 0x4999142: utime (utime.c:36)
==24835==    by 0x552BE0: mark_commit_graphs (commit-graph.c:2213)
==24835==    by 0x550822: write_commit_graph (commit-graph.c:2424)
==24835==    by 0x54E3A0: write_commit_graph_reachable (commit-graph.c:1681)
==24835==    by 0x4374BB: graph_write (commit-graph.c:269)
==24835==    by 0x436F7D: cmd_commit_graph (commit-graph.c:326)
==24835==    by 0x407B9A: run_builtin (git.c:465)
==24835==    by 0x406651: handle_builtin (git.c:719)
==24835==    by 0x407575: run_argv (git.c:786)
==24835==    by 0x406410: cmd_main (git.c:917)
==24835==    by 0x511F09: main (common-main.c:56)
==24835==  Address 0x1ffeffde70 is on thread 1's stack
==24835==  in frame #1, created by utime (utime.c:25)
==24835==  Uninitialised value was created by a stack allocation
==24835==    at 0x552B50: mark_commit_graphs (commit-graph.c:2201)
==24835==
[...]
error: last command exited with $?=126
not ok 137 - Bloom generation is limited by --max-new-filters

This would happen as we stat'd the non-existing
".git/objects/info/commit-graph" file. Let's fix mark_commit_graphs()
to check the stat()'s return value, and while we're at it fix another
case added in the same commit to do the same.

The caller in expire_commit_graphs() would have been less likely to
run into this, as it's operating on files it just got from readdir(),
but it could still happen due to a race with e.g. a concurrent "rm
-rf" of the commit-graph files.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoobject-file: fix a unpack_loose_header() regression in 3b6a8db3b03
Ævar Arnfjörð Bjarmason [Thu, 12 May 2022 22:32:18 +0000 (15:32 -0700)] 
object-file: fix a unpack_loose_header() regression in 3b6a8db3b03

Fix a regression in my 3b6a8db3b03 (object-file.c: use "enum" return
type for unpack_loose_header(), 2021-10-01) revealed both by running
the test suite with --valgrind, and with the amended "git fsck" test.

In practice this regression in v2.34.0 caused us to claim that we
couldn't parse the header, as opposed to not being able to unpack
it. Before the change in the C code the test_cmp added here would emit:

-error: unable to unpack header of ./objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
+error: unable to parse header of ./objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391

I.e. we'd proceed to call parse_loose_header() on the uninitialized
"hdr" value, and it would have been very unlikely for that
uninitialized memory to be a valid git object.

The other callers of unpack_loose_header() were already checking the
enum values exhaustively. See 3b6a8db3b03 and
5848fb11acd (object-file.c: return ULHR_TOO_LONG on "header too long",
2021-10-01).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agolog test: skip a failing mkstemp() test under valgrind
Ævar Arnfjörð Bjarmason [Thu, 12 May 2022 22:32:16 +0000 (15:32 -0700)] 
log test: skip a failing mkstemp() test under valgrind

Skip a test added in f1e3df31699 (t: increase test coverage of
signature verification output, 2020-03-04) when running under
valgrind. Due to valgrind's interception of mkstemp() this test will
fail with:

+ pwd
+ TMPDIR=[...]/t/trash directory.t4202-log/bogus git log --show-signature -n1 plain-fail
==7696== VG_(mkstemp): failed to create temp file: [...]/t/trash directory.t4202-log/bogus/valgrind_proc_7696_cmdline_d545ddcf
[... 10 more similar lines omitted ..]
valgrind: Startup or configuration error:
valgrind:    Can't create client cmdline file in [...]/t/trash directory.t4202-log/bogus/valgrind_proc_7696_cmdline_6e542d1d
valgrind: Unable to start up properly.  Giving up.
error: last command exited with $?=1

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agotests: using custom GIT_EXEC_PATH breaks --valgrind tests
Ævar Arnfjörð Bjarmason [Thu, 12 May 2022 22:32:15 +0000 (15:32 -0700)] 
tests: using custom GIT_EXEC_PATH breaks --valgrind tests

Fix a regression in b7d11a0f5d2 (tests: exercise the RUNTIME_PREFIX
feature, 2021-07-24) where tests that want to set up and test a "git"
wrapper in $PATH conflicted with the t/bin/valgrind wrapper(s) doing
the same.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoarchive: do not let on-disk mode leak to zip archives
Junio C Hamano [Thu, 12 May 2022 21:31:09 +0000 (14:31 -0700)] 
archive: do not let on-disk mode leak to zip archives

When the "--add-file" option is used to add the contents from an
untracked file to the archive, the permission mode bits for these
files are sent to the archive-backend specific "write_entry()"
method as-is.  We normalize the mode bits for tracked files way
before we pass them to the write_entry() method; we should do the
same here.

This is not strictly needed for "tar" archive-backend, as it has its
own code to further clean them up, but "zip" archive-backend is not
so well prepared.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoSubmittingPatches: use more stable git.ozlabs.org URL
Junio C Hamano [Wed, 11 May 2022 15:10:12 +0000 (08:10 -0700)] 
SubmittingPatches: use more stable git.ozlabs.org URL

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agodetect-compiler: make detection independent of locale
Michael J Gruber [Mon, 9 May 2022 11:22:02 +0000 (13:22 +0200)] 
detect-compiler: make detection independent of locale

`detect-compiler` has accumulated a few compiler dependent workarounds
lately for the more and more ubiquitious gcc12. This is intended to make
CI set-ups work across tool-chain updates, but also help those
developers who build with `DEVELOPER=1`.

Alas, `detect-compiler` uses the locale dependent output of `$(CC) -v`
to parse for the version string, which fails unless it literally
contains ` version`.

Use `LANG=C $(CC) -v` instead to grep for stable output.

Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.36.1 v2.36.1
Junio C Hamano [Thu, 5 May 2022 21:36:37 +0000 (14:36 -0700)] 
Git 2.36.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'ab/cc-package-fixes' into maint
Junio C Hamano [Thu, 5 May 2022 21:36:25 +0000 (14:36 -0700)] 
Merge branch 'ab/cc-package-fixes' into maint

Correct choices of C compilers used in various CI jobs.
source: <patch-v3-1.1-8b3444ecc87-20220422T092015Z-avarab@gmail.com>

* ab/cc-package-fixes:
  CI: select CC based on CC_PACKAGE (again)

3 years agoMerge branch 'jc/cocci-xstrdup-or-null-fix' into maint
Junio C Hamano [Thu, 5 May 2022 21:36:25 +0000 (14:36 -0700)] 
Merge branch 'jc/cocci-xstrdup-or-null-fix' into maint

Get rid of a bogus and over-eager coccinelle rule.
source: <xmqq1qxd6e4x.fsf@gitster.g>

* jc/cocci-xstrdup-or-null-fix:
  cocci: drop bogus xstrdup_or_null() rule

3 years agoMerge branch 'rs/format-patch-pathspec-fix' into maint
Junio C Hamano [Thu, 5 May 2022 21:36:25 +0000 (14:36 -0700)] 
Merge branch 'rs/format-patch-pathspec-fix' into maint

"git format-patch <args> -- <pathspec>" lost the pathspec when
showing the second and subsequent commits, which has been
corrected.
source: <c36896a1-6247-123b-4fa3-b7eb24af1897@web.de>

* rs/format-patch-pathspec-fix:
  2.36 format-patch regression fix

3 years agoMerge branch 'rs/fast-export-pathspec-fix' into maint
Junio C Hamano [Thu, 5 May 2022 21:36:25 +0000 (14:36 -0700)] 
Merge branch 'rs/fast-export-pathspec-fix' into maint

"git fast-export -- <pathspec>" lost the pathspec when showing the
second and subsequent commits, which has been corrected.
source: <2c988c7b-0efe-4222-4a43-8124fe1a9da6@web.de>

* rs/fast-export-pathspec-fix:
  2.36 fast-export regression fix

3 years agoMerge branch 'jc/show-pathspec-fix' into maint
Junio C Hamano [Thu, 5 May 2022 21:36:24 +0000 (14:36 -0700)] 
Merge branch 'jc/show-pathspec-fix' into maint

"git show <commit1> <commit2>... -- <pathspec>" lost the pathspec
when showing the second and subsequent commits, which has been
corrected.
source: <xmqqo80j87g0.fsf_-_@gitster.g>

* jc/show-pathspec-fix:
  2.36 show regression fix

3 years agoMerge branch 'rs/name-rev-fix-free-after-use' into maint
Junio C Hamano [Thu, 5 May 2022 21:36:24 +0000 (14:36 -0700)] 
Merge branch 'rs/name-rev-fix-free-after-use' into maint

Regression fix for 2.36 where "git name-rev" started to sometimes
reference strings after they are freed.

This fixes a regression in 2.36 and is slate to go to 2.36.1
source: <340c8810-d912-7b18-d46e-a9d43f20216a@web.de>

* rs/name-rev-fix-free-after-use:
  Revert "name-rev: release unused name strings"

3 years agoMerge branch 'jc/diff-tree-stdin-fix' into maint
Junio C Hamano [Thu, 5 May 2022 21:36:24 +0000 (14:36 -0700)] 
Merge branch 'jc/diff-tree-stdin-fix' into maint

"diff-tree --stdin" has been broken for about a year, but 2.36
release broke it even worse by breaking running the command with
<pathspec>, which in turn broke "gitk" and got noticed.  This has
been corrected by aligning its behaviour to that of "log".

This fixes a regression in 2.36 and is slate to go to 2.36.1
source: <xmqq7d7bsu2n.fsf@gitster.g>

* jc/diff-tree-stdin-fix:
  2.36 gitk/diff-tree --stdin regression fix

3 years agoMerge branch 'gc/submodule-update-part2' into maint
Junio C Hamano [Thu, 5 May 2022 21:36:24 +0000 (14:36 -0700)] 
Merge branch 'gc/submodule-update-part2' into maint

"git submodule update" without pathspec should silently skip an
uninitialized submodule, but it started to become noisy by mistake.

This fixes a regression in 2.36 and is slate to go to 2.36.1
source: <pull.1258.v2.git.git.1650890741430.gitgitgadget@gmail.com>

* gc/submodule-update-part2:
  submodule--helper: fix initialization of warn_if_uninitialized

3 years agococci: drop bogus xstrdup_or_null() rule
Junio C Hamano [Sun, 1 May 2022 05:00:30 +0000 (22:00 -0700)] 
cocci: drop bogus xstrdup_or_null() rule

13092a91 (cocci: refactor common patterns to use xstrdup_or_null(),
2016-10-12) introduced a rule to rewrite this conditional call to
xstrdup(E) and an assignment to variable V:

    - if (E)
    -    V = xstrdup(E);

into an unconditional call to xstrdup_or_null(E) and an assignment
to variable V:

    + V = xstrdup_or_null(E);

which is utterly bogus.  The original code may already have an
acceptable value in V and the conditional assignment may be to
improve the value already in V with a copy of a better value E when
(and only when) E is not NULL.

The rewritten construct unconditionally discards the existing value
of V and replaces it with a copy of E, even when E is NULL, which
changes the meaning of the program.

By the way, if it were

-if (E && !V)
- V = xstrdup(E);
+V = xstrdup_or_null(E);

it would probably have been correct.  But there is no existing code
that would have been improved by such a rule, so let's just remove
the bogus one without replacing with the more specific one.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoclone: plug a miniscule leak
Junio C Hamano [Sun, 1 May 2022 05:17:15 +0000 (22:17 -0700)] 
clone: plug a miniscule leak

The remote_name variable is first assigned a copy of the value of
the "clone.defaultremotename" configuration variable and then by the
value of the "--origin" command line option.  The former is prepared
to see multiple instances of the configuration variable by freeing
the current value of the variable before a copy of the newly
discovered value gets assigned to it.  The latter however blindly
assigned a copy of the new value to the variable, thereby leaking
the value read from the configuration variable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years ago2.36 fast-export regression fix
René Scharfe [Sat, 30 Apr 2022 14:31:43 +0000 (16:31 +0200)] 
2.36 fast-export regression fix

e900d494dc (diff: add an API for deferred freeing, 2021-02-11) added a
way to allow reusing diffopts: the no_free bit.  244c27242f (diff.[ch]:
have diff_free() call clear_pathspec(opts.pathspec), 2022-02-16) made
that mechanism mandatory.

git fast-export doesn't set no_free, so path limiting stopped working
after the first commit.  Set the flag and add a basic test to make sure
only changes to the specified files are exported.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years ago2.36 format-patch regression fix
René Scharfe [Sat, 30 Apr 2022 10:32:44 +0000 (12:32 +0200)] 
2.36 format-patch regression fix

e900d494dc (diff: add an API for deferred freeing, 2021-02-11) added a
way to allow reusing diffopts: the no_free bit.  244c27242f (diff.[ch]:
have diff_free() call clear_pathspec(opts.pathspec), 2022-02-16) made
that mechanism mandatory.

git format-patch only sets no_free when --output is given, causing it to
forget pathspecs after the first commit.  Set no_free unconditionally
instead.

The existing test was unable to detect this breakage because it checks
stderr for the absence of a certain string, but format-patch writes to
stdout.  Also the test was not checking the case of one commit modifying
multiple files and a pathspec limiting the diff.  Replace it with a more
thorough one.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years ago2.36 show regression fix
Junio C Hamano [Sat, 30 Apr 2022 05:29:51 +0000 (22:29 -0700)] 
2.36 show regression fix

This only surfaced as a regression after 2.36 release, but the
breakage was already there with us for at least a year.

e900d494 (diff: add an API for deferred freeing, 2021-02-11)
introduced a mechanism to delay freeing resources held in
diff_options struct that need to be kept as long as the struct will
be reused to compute diff.  "git log -p" was taught to utilize the
mechanism but it was done with an incorrect assumption that the
underlying helper function, cmd_log_walk(), is called only once,
and it is OK to do the freeing at the end of it.

Alas, for "git show A B", the function is called once for each
commit given, so it is not OK to free the resources until we finish
calling it for all the commits given from the command line.

During 2.36 release cycle, we started clearing the <pathspec> as
part of this freeing, which made the bug a lot more visible.

Fix this breakage by tweaking how cmd_log_walk() frees the resources
at the end and using a variant of it that does not immediately free
the resources to show each commit object from the command line in
"git show".

Protect the fix with a few new tests.

Reported-by: Daniel Li <dan@danielyli.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosubmodule--helper: fix initialization of warn_if_uninitialized
Orgad Shaneh [Mon, 25 Apr 2022 12:45:41 +0000 (12:45 +0000)] 
submodule--helper: fix initialization of warn_if_uninitialized

The .warn_if_uninitialized member was introduced by 48308681
(git submodule update: have a dedicated helper for cloning,
2016-02-29) to submodule_update_clone struct and initialized to
false.  When c9911c93 (submodule--helper: teach update_data more
options, 2022-03-15) moved it to update_data struct, it started
to initialize it to true but this change was not explained in
its log message.

The member is set to true only when pathspec was given, and is
used when a submodule that matched the pathspec is found
uninitialized to give diagnostic message.  "submodule update"
without pathspec is supposed to iterate over all submodules
(i.e. without pathspec limitation) and update only the
initialized submodules, and finding uninitialized submodules
during the iteration is a totally expected and normal thing that
should not be warned.

[jc: added tests]

Signed-off-by: Orgad Shaneh <orgads@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years ago2.36 gitk/diff-tree --stdin regression fix
Junio C Hamano [Tue, 26 Apr 2022 16:11:44 +0000 (09:11 -0700)] 
2.36 gitk/diff-tree --stdin regression fix

This only surfaced as a regression after 2.36 release, but the
breakage was already there with us for at least a year.

The diff_free() call is to be used after we completely finished with
a diffopt structure.  After "git diff A B" finishes producing
output, calling it before process exit is fine.  But there are
commands that prepares diff_options struct once, compares two sets
of paths, releases resources that were used to do the comparison,
then reuses the same diff_option struct to go on to compare the next
two sets of paths, like "git log -p".

After "git log -p" finishes showing a single commit, calling it
before it goes on to the next commit is NOT fine.  There is a
mechanism, the .no_free member in diff_options struct, to help "git
log" to avoid calling diff_free() after showing each commit and
instead call it just one.  When the mechanism was introduced in
e900d494 (diff: add an API for deferred freeing, 2021-02-11),
however, we forgot to do the same to "diff-tree --stdin", which *is*
a moral equivalent to "git log".

During 2.36 release cycle, we started clearing the pathspec in
diff_free(), so programs like gitk that runs

    git diff-tree --stdin -- <pathspec>

downstream of a pipe, processing one commit after another, started
showing irrelevant comparison outside the given <pathspec> from the
second commit.  The same commit, by forgetting to teach the .no_free
mechanism, broke "diff-tree --stdin -I<regexp>" and nobody noticed
it for over a year, presumably because it is so seldom used an
option.

But <pathspec> is a different story.  The breakage was very
prominently visible and was reported immediately after 2.36 was
released.

Fix this breakage by mimicking how "git log" utilizes the .no_free
member so that "diff-tree --stdin" behaves more similarly to "log".

Protect the fix with a few new tests.

Reported-by: Matthias Aßhauer <mha1993@live.de>
Helped-by: René Scharfe <l.s.r@web.de>
Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agocache: use const char * for get_object_directory()
Derrick Stolee [Mon, 25 Apr 2022 18:27:14 +0000 (18:27 +0000)] 
cache: use const char * for get_object_directory()

The get_object_directory() method returns the exact string stored at
the_repository->objects->odb->path. The return type of "char *" implies
that the caller must keep track of the buffer and free() it when
complete. This causes significant problems later when the ODB is
accessed.

Use "const char *" as the return type to avoid this confusion. There are
no current callers that care about the non-const definition.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agomulti-pack-index: use --object-dir real path
Derrick Stolee [Mon, 25 Apr 2022 18:27:13 +0000 (18:27 +0000)] 
multi-pack-index: use --object-dir real path

The --object-dir argument to 'git multi-pack-index' allows a user to
specify an alternate to use instead of the local $GITDIR. This is used
by third-party tools like VFS for Git to maintain the pack-files in a
"shared object cache" used by multiple clones.

On Windows, the user can specify a path using a Windows-style file path
with backslashes such as "C:\Path\To\ObjectDir". This same path style is
used in the .git/objects/info/alternates file, so it already matches the
path of that alternate. However, find_odb() converts these paths to
real-paths for the comparison, which use forward slashes. As of the
previous change, lookup_multi_pack_index() uses real-paths, so it
correctly finds the target multi-pack-index when given these paths.

Some commands such as 'git multi-pack-index repack' call child processes
using the object_dir value, so it can be helpful to convert the path to
the real-path before sending it to those locations.

Add a callback to convert the real path immediately upon parsing the
argument. We need to be careful that we don't store the exact value out
of get_object_directory() and free it, or we could corrupt a later use
of the_repository->objects->odb->path.

We don't use get_object_directory() for the initial instantiation in
cmd_multi_pack_index() because we need 'git multi-pack-index -h' to work
without a Git repository.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agomidx: use real paths in lookup_multi_pack_index()
Derrick Stolee [Mon, 25 Apr 2022 18:27:12 +0000 (18:27 +0000)] 
midx: use real paths in lookup_multi_pack_index()

This helper looks for a parsed multi-pack-index whose object directory
matches the given object_dir. Before going into the loop over the parsed
multi-pack-indexes, it calls find_odb() to ensure that the given
object_dir is actually a known object directory.

However, find_odb() uses real-path manipulations to compare the input to
the alternate directories. This same real-path comparison is not used in
the loop, leading to potential issues with the strcmp().

Update the method to use the real-path values instead.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoRevert "name-rev: release unused name strings"
René Scharfe [Fri, 22 Apr 2022 18:44:40 +0000 (20:44 +0200)] 
Revert "name-rev: release unused name strings"

This reverts commit 2d53975488df195e1431c3f90bfb5b60018d5bf6.

3656f84278 (name-rev: prefer shorter names over following merges,
2021-12-04) broke the assumption of 2d53975488 (name-rev: release unused
name strings, 2020-02-04) that a better name for a child is a better
name for all of its ancestors as well, because it added a penalty for
generation > 0.  This leads to strings being free(3)'d that are still
needed.

079f970971 (name-rev: sort tip names before applying, 2020-02-05)
already reduced the number of free(3) calls for the use case that
motivated the original patch (name-rev --all in the Chromium repository)
from ca. 44000 to 5, and 3656f84278 eliminated even those few.  So this
revert won't affect name-rev's performance on that particular repo.

Reported-by: Thomas Hurst <tom@hur.st>
Helped-by: Elijah Newren <newren@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoCI: select CC based on CC_PACKAGE (again)
Ævar Arnfjörð Bjarmason [Fri, 22 Apr 2022 09:20:53 +0000 (11:20 +0200)] 
CI: select CC based on CC_PACKAGE (again)

Fix a regression in 707d2f2fe86 (CI: use "$runs_on_pool", not
"$jobname" to select packages & config, 2021-11-23).

In that commit I changed CC=gcc from CC=gcc-9, but on OSX the "gcc" in
$PATH points to clang, we need to use gcc-9 instead. Likewise for the
linux-gcc job CC=gcc-8 was changed to the implicit CC=gcc, which would
select GCC 9.4.0 instead of GCC 8.4.0.

Furthermore in 25715419bf4 (CI: don't run "make test" twice in one
job, 2021-11-23) when the "linux-TEST-vars" job was split off from
"linux-gcc" the "cc_package: gcc-8" line was copied along with
it, so its "cc_package" line wasn't working as intended either.

As a table, this is what's changed by this commit, i.e. it only
affects the linux-gcc, linux-TEST-vars and osx-gcc jobs:

|-------------------+-----------+-------------------+-------+-------|
| jobname           | vector.cc | vector.cc_package | old   | new   |
|-------------------+-----------+-------------------+-------+-------|
| linux-clang       | clang     | -                 | clang | clang |
| linux-sha256      | clang     | -                 | clang | clang |
| linux-gcc         | gcc       | gcc-8             | gcc   | gcc-8 |
| osx-clang         | clang     | -                 | clang | clang |
| osx-gcc           | gcc       | gcc-9             | clang | gcc-9 |
| linux-gcc-default | gcc       | -                 | gcc   | gcc   |
| linux-TEST-vars   | gcc       | gcc-8             | gcc   | gcc-8 |
|-------------------+-----------+-------------------+-------+-------|

Reported-by: Carlo Arenas <carenas@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoshow-branch: -g and --current are incompatible
Junio C Hamano [Thu, 21 Apr 2022 21:25:47 +0000 (14:25 -0700)] 
show-branch: -g and --current are incompatible

When "--current" is given to "git show-branch" running in the
"--reflog" mode, the code tries to reference a "reflog" message
that does not even exist.  This is because the --current is not
prepared to work in that mode.

The reason "--current" exists is to support this request:

    I list branches on the command line.  These are the branchesI
    care about and I use as anchoring points. I may or may not be on
    one of these main branches.  Please make sure I can view the
    commits on the current branch with respect to what is in these
    other branches.

And to serve that request, the code checks if the current branch is
among the ones listed on the command line, and adds it only if it is
not to the end of one array, which essentially lists the objects.
The reflog mode additionally uses another array to list reflog
messages, which the "--current" code does not add to.  This leaves
one uninitialized slot at the end of the array of reflog messages,
and causes the program to show garbage or segfault.

Catch the unsupported (and meaningless) combination and exit with a
usage error.

There are other combinations of options that are incompatible but
have not been tested.  Add test to cover them while adding coverage
for this new combination.

Reported-by: Gregory David <gregory.david@p1sec.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agorebase: use correct base for --keep-base when a branch is given
Alex Henrie [Thu, 21 Apr 2022 04:42:33 +0000 (22:42 -0600)] 
rebase: use correct base for --keep-base when a branch is given

--keep-base rebases onto the merge base of the given upstream and the
current HEAD regardless of whether a branch is given. This is contrary
to the documentation and to the option's intended purpose. Instead,
rebase onto the merge base of the given upstream and the given branch.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.36 v2.36.0
Junio C Hamano [Mon, 18 Apr 2022 05:21:51 +0000 (22:21 -0700)] 
Git 2.36

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge tag 'l10n-2.36.0-rnd2.1' of https://github.com/git-l10n/git-po
Junio C Hamano [Mon, 18 Apr 2022 05:20:49 +0000 (22:20 -0700)] 
Merge tag 'l10n-2.36.0-rnd2.1' of https://github.com/git-l10n/git-po

l10n-2.36.0-rnd2.1

* tag 'l10n-2.36.0-rnd2.1' of https://github.com/git-l10n/git-po:
  l10n: sv.po: Update Swedish translation (5282t0f0u)
  l10n: Update Catalan translation
  l10n: po-id for 2.36 (round 2)
  l10n: de.po: Update German translation
  l10n: zh_CN v2.36.0 round 2
  l10n: pt_PT: update Portuguese translation
  l10n: vi(5285t): v2.36.0 round 2
  l10n: zh_TW: v2.36.0 round 2
  l10n: fr: v2.36 round 2
  l10n: tr: v2.36.0 round 2
  l10n: git.pot: v2.36.0 round 2 (4 new, 3 removed)
  l10n: fr: v2.36 round 1
  l10n: zh_CN v2.36.0 round 1
  l10n: Update zh_CN repo link
  l10n: po-id for 2.36 (round 1)
  l10n: tr: v2.36.0 round 1
  l10n: git.pot: v2.36.0 round 1 (192 new, 106 removed)
  l10n: pt_PT: update TEAMS file
  l10n: pt_PT: update Portuguese translation

3 years agoMerge branch 'cb/buggy-gcc-12-workaround'
Junio C Hamano [Sun, 17 Apr 2022 23:32:05 +0000 (16:32 -0700)] 
Merge branch 'cb/buggy-gcc-12-workaround'

A couple of work around for CI breaking warnings from gcc 12.

* cb/buggy-gcc-12-workaround:
  config.mak.dev: alternative workaround to gcc 12 warning in http.c
  config.mak.dev: workaround gcc 12 bug affecting "pedantic" CI job

3 years agol10n: sv.po: Update Swedish translation (5282t0f0u)
Peter Krefting [Sun, 17 Apr 2022 17:13:34 +0000 (18:13 +0100)] 
l10n: sv.po: Update Swedish translation (5282t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
3 years agoMerge branch 'master' of github.com:Softcatala/git-po
Jiang Xin [Sun, 17 Apr 2022 01:07:28 +0000 (09:07 +0800)] 
Merge branch 'master' of github.com:Softcatala/git-po

* 'master' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation

3 years agol10n: Update Catalan translation
Jordi Mas [Sat, 16 Apr 2022 18:17:17 +0000 (20:17 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
3 years agol10n: po-id for 2.36 (round 2)
Bagas Sanjaya [Thu, 14 Apr 2022 06:40:35 +0000 (13:40 +0700)] 
l10n: po-id for 2.36 (round 2)

Translate following new components:
  * setup.c
  * split-index.c
  * strbuf.c
  * trailer.c

Also delete obsolete strings.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agoconfig.mak.dev: alternative workaround to gcc 12 warning in http.c
Carlo Marcelo Arenas Belón [Fri, 15 Apr 2022 23:13:42 +0000 (16:13 -0700)] 
config.mak.dev: alternative workaround to gcc 12 warning in http.c

This provides a "no code change needed" option to the "fix" currently
queued as part of ab/http-gcc-12-workaround and therefore should be
reverted once that gets merged.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoconfig.mak.dev: workaround gcc 12 bug affecting "pedantic" CI job
Carlo Marcelo Arenas Belón [Fri, 15 Apr 2022 23:13:41 +0000 (16:13 -0700)] 
config.mak.dev: workaround gcc 12 bug affecting "pedantic" CI job

Originally noticed by Peff[1], but yet to be corrected[2] and planned to
be released with Fedora 36 (scheduled for Apr 19).

  dir.c: In function ‘git_url_basename’:
  dir.c:3085:13: error: ‘memchr’ specified bound [9223372036854775808, 0] exceeds maximum object size 9223372036854775807 [-Werror=stringop-overread]
   3085 |         if (memchr(start, '/', end - start) == NULL
        |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fedora is used as part of the CI, and therefore that release will trigger
failures, unless the version of the image used is locked to an older
release, as an alternative.

Restricting the flag to the affected source file, as well as implementing
an independent facility to track these workarounds was specifically punted
to minimize the risk of introducing problems so close to a release.

This change should be reverted once the underlying gcc bug is solved and
which should be visible by NOT triggering a warning, otherwise.

[1] https://lore.kernel.org/git/YZQhLh2BU5Hquhpo@coredump.intra.peff.net/
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2075786

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'master' of github.com:ruester/git-po-de
Jiang Xin [Fri, 15 Apr 2022 00:26:53 +0000 (08:26 +0800)] 
Merge branch 'master' of github.com:ruester/git-po-de

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

3 years agoMerge branch 'fz/po-2.36.0-round2' of github.com:fangyi-zhou/git-po
Jiang Xin [Fri, 15 Apr 2022 00:26:06 +0000 (08:26 +0800)] 
Merge branch 'fz/po-2.36.0-round2' of github.com:fangyi-zhou/git-po

* 'fz/po-2.36.0-round2' of github.com:fangyi-zhou/git-po:
  l10n: zh_CN v2.36.0 round 2

3 years agoMerge branch 'jc/revert-ref-transaction-hook-changes'
Junio C Hamano [Thu, 14 Apr 2022 21:17:12 +0000 (14:17 -0700)] 
Merge branch 'jc/revert-ref-transaction-hook-changes'

Revert the "deletion of a ref should not trigger transaction events
for loose and packed ref backends separately" that regresses the
behaviour when a ref is not modified since it was packed.

* jc/revert-ref-transaction-hook-changes:
  RelNotes: revert the description on the reverted topics
  Revert "fetch: increase test coverage of fetches"
  Revert "Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'"

3 years agoMerge branch 'jc/relnotes-updates'
Junio C Hamano [Thu, 14 Apr 2022 21:17:12 +0000 (14:17 -0700)] 
Merge branch 'jc/relnotes-updates'

Wording updates for 2.36 release notes.

* jc/relnotes-updates:
  RelNotes: mention safe.directory
  RelNotes: clarify "bisect run unexecutable" tweak

3 years agol10n: de.po: Update German translation
Matthias Rüster [Sat, 9 Apr 2022 15:57:47 +0000 (17:57 +0200)] 
l10n: de.po: Update German translation

Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Reviewed-by: Phillip Szelat <phillip.szelat@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
3 years agol10n: zh_CN v2.36.0 round 2
Fangyi Zhou [Thu, 14 Apr 2022 14:46:21 +0000 (15:46 +0100)] 
l10n: zh_CN v2.36.0 round 2

Signed-off-by: Fangyi Zhou <me@fangyi.io>
3 years agol10n: pt_PT: update Portuguese translation
Daniel Santos [Wed, 23 Feb 2022 19:39:47 +0000 (19:39 +0000)] 
l10n: pt_PT: update Portuguese translation

 * update the following words translations: commit, untracked, stage,
   cache, stash, work..., index, reset, label, check..., tags, graft,
   alternate object, amend, ancestor, cherry-pick, bisect, blame, chain,
   cache, bug, chunk, branch, bundle, clean, clone, commit-graph, commit
   object, commit-ish, committer, cover letter, conflict, dangling,
   detach, dir, dumb, fast-forward, file system, fixup, fork, fetch, Git
   archive, gitdir, graft, replace ref
 * correct some mispellings
 * git-po-helper update
 * remove some obsolete lines
 * unfuzzy entries
 * random translation updates
 * update contact in pt_PT.po
 * add the following words to the translation table: override, recurse,
   print, offset, unbundle, mirror repository, multi-pack, bad,
   whitespace, batch
 * remove the following words of the translation table: core Git
 * change the following words on the translation table: dry-run, apply,
   patch, replay, blame, chain, gitdir, file system, fork, unset, handle
 * some translation to the first person
 * update copyright text
 * word 'utilização:' to 'uso:'
 * word 'pai' to 'parente'

Signed-off-by: Daniel Santos <dacs.git@brilhante.top>
3 years agol10n: vi(5285t): v2.36.0 round 2
Tran Ngoc Quan [Thu, 14 Apr 2022 06:58:46 +0000 (13:58 +0700)] 
l10n: vi(5285t): v2.36.0 round 2

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
3 years agoMerge branch 'loc/tw/0407' of github.com:l10n-tw/git-po
Jiang Xin [Thu, 14 Apr 2022 05:13:38 +0000 (13:13 +0800)] 
Merge branch 'loc/tw/0407' of github.com:l10n-tw/git-po

* 'loc/tw/0407' of github.com:l10n-tw/git-po:
  l10n: zh_TW: v2.36.0 round 2

3 years agol10n: zh_TW: v2.36.0 round 2
Yi-Jyun Pan [Thu, 7 Apr 2022 06:30:49 +0000 (14:30 +0800)] 
l10n: zh_TW: v2.36.0 round 2

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
3 years agoRelNotes: revert the description on the reverted topics
Junio C Hamano [Wed, 13 Apr 2022 23:55:36 +0000 (16:55 -0700)] 
RelNotes: revert the description on the reverted topics

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoRelNotes: mention safe.directory
Junio C Hamano [Wed, 13 Apr 2022 23:51:41 +0000 (16:51 -0700)] 
RelNotes: mention safe.directory

Helped-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoRelNotes: clarify "bisect run unexecutable" tweak
Junio C Hamano [Wed, 13 Apr 2022 23:42:33 +0000 (16:42 -0700)] 
RelNotes: clarify "bisect run unexecutable" tweak

We do not have to guess how common the mistake the change targets is
when describing it.  Such an argument may be good while proposing a
change, but does not quite belong in the record of what has already
happened, i.e. a release note.

Helped-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoRevert "fetch: increase test coverage of fetches"
Junio C Hamano [Wed, 13 Apr 2022 22:58:04 +0000 (15:58 -0700)] 
Revert "fetch: increase test coverage of fetches"

This reverts commit 2a0cafd464709cfa22fe7249290c644a2a26c520,
as it expects a working "a ref deletion must produce a single
transaction, not one for loose and another for packed" topic,
which we do not have.

3 years agoRevert "Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'"
Junio C Hamano [Wed, 13 Apr 2022 22:51:33 +0000 (15:51 -0700)] 
Revert "Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs'"

This reverts commit 991b4d47f0accd3955d05927d5ce434e03ffbdb6, reversing
changes made to bcd020f88e1e22f38422ac3f73ab06b34ec4bef1.

3 years agoSync with Git 2.35.3
Junio C Hamano [Wed, 13 Apr 2022 22:26:32 +0000 (15:26 -0700)] 
Sync with Git 2.35.3

3 years agoGit 2.35.3 v2.35.3
Junio C Hamano [Wed, 13 Apr 2022 22:21:34 +0000 (15:21 -0700)] 
Git 2.35.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.34.3 v2.34.3
Junio C Hamano [Wed, 13 Apr 2022 22:21:31 +0000 (15:21 -0700)] 
Git 2.34.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.33.3 v2.33.3
Junio C Hamano [Wed, 13 Apr 2022 22:21:28 +0000 (15:21 -0700)] 
Git 2.33.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.32.2 v2.32.2
Junio C Hamano [Wed, 13 Apr 2022 22:21:26 +0000 (15:21 -0700)] 
Git 2.32.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.31.3 v2.31.3
Junio C Hamano [Wed, 13 Apr 2022 22:21:08 +0000 (15:21 -0700)] 
Git 2.31.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.30.4 v2.30.4
Junio C Hamano [Wed, 13 Apr 2022 20:31:29 +0000 (13:31 -0700)] 
Git 2.30.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosetup: opt-out of check with safe.directory=*
Derrick Stolee [Wed, 13 Apr 2022 15:32:31 +0000 (15:32 +0000)] 
setup: opt-out of check with safe.directory=*

With the addition of the safe.directory in 8959555ce
(setup_git_directory(): add an owner check for the top-level directory,
2022-03-02) released in v2.35.2, we are receiving feedback from a
variety of users about the feature.

Some users have a very large list of shared repositories and find it
cumbersome to add this config for every one of them.

In a more difficult case, certain workflows involve running Git commands
within containers. The container boundary prevents any global or system
config from communicating `safe.directory` values from the host into the
container. Further, the container almost always runs as a different user
than the owner of the directory in the host.

To simplify the reactions necessary for these users, extend the
definition of the safe.directory config value to include a possible '*'
value. This value implies that all directories are safe, providing a
single setting to opt-out of this protection.

Note that an empty assignment of safe.directory clears all previous
values, and this is already the case with the "if (!value || !*value)"
condition.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agosetup: fix safe.directory key not being checked
Matheus Valadares [Wed, 13 Apr 2022 15:32:30 +0000 (15:32 +0000)] 
setup: fix safe.directory key not being checked

It seems that nothing is ever checking to make sure the safe directories
in the configs actually have the key safe.directory, so some unrelated
config that has a value with a certain directory would also make it a
safe directory.

Signed-off-by: Matheus Valadares <me@m28.io>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agot0033: add tests for safe.directory
Derrick Stolee [Wed, 13 Apr 2022 15:32:29 +0000 (15:32 +0000)] 
t0033: add tests for safe.directory

It is difficult to change the ownership on a directory in our test
suite, so insert a new GIT_TEST_ASSUME_DIFFERENT_OWNER environment
variable to trick Git into thinking we are in a differently-owned
directory. This allows us to test that the config is parsed correctly.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: fr: v2.36 round 2
Jean-Noël Avila [Wed, 13 Apr 2022 19:21:48 +0000 (21:21 +0200)] 
l10n: fr: v2.36 round 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
3 years agol10n: tr: v2.36.0 round 2
Emir SARI [Wed, 13 Apr 2022 10:28:58 +0000 (13:28 +0300)] 
l10n: tr: v2.36.0 round 2

Signed-off-by: Emir SARI <emir_sari@icloud.com>
3 years agol10n: git.pot: v2.36.0 round 2 (4 new, 3 removed)
Jiang Xin [Wed, 13 Apr 2022 06:55:25 +0000 (14:55 +0800)] 
l10n: git.pot: v2.36.0 round 2 (4 new, 3 removed)

Generate po/git.pot from v2.36.0-rc2 for git v2.36.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Wed, 13 Apr 2022 06:51:53 +0000 (14:51 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git: (25 commits)
  Git 2.36-rc2
  i18n: fix some badly formatted i18n strings
  Git 2.36-rc1
  t9902: split test to run on appropriate systems
  ls-tree doc: document interaction with submodules
  Documentation: add --batch-command to cat-file synopsis
  git-ls-tree.txt: fix the name of "%(objectsize:padded)"
  submodule-helper: fix usage string
  doc: replace "--" with {litdd} in credential-cache/fsmonitor
  contrib/scalar: fix 'all' target in Makefile
  Documentation/Makefile: fix "make info" regression in dad9cd7d518
  configure.ac: fix HAVE_SYNC_FILE_RANGE definition
  git-compat-util: really support openssl as a source of entropy
  ls-tree: `-l` should not imply recursive listing
  Git 2.35.2
  Git 2.34.2
  Git 2.33.2
  Git 2.32.1
  Git 2.31.2
  Git 2.30.3
  ...

3 years agoGit 2.36-rc2 v2.36.0-rc2
Junio C Hamano [Tue, 12 Apr 2022 04:27:02 +0000 (21:27 -0700)] 
Git 2.36-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'ja/i18n-fix-for-2.36'
Junio C Hamano [Mon, 11 Apr 2022 23:45:17 +0000 (16:45 -0700)] 
Merge branch 'ja/i18n-fix-for-2.36'

Fixes to some localizable strings.

* ja/i18n-fix-for-2.36:
  i18n: fix some badly formatted i18n strings

3 years agoMerge tag 'v2.35.2'
Junio C Hamano [Mon, 11 Apr 2022 23:44:45 +0000 (16:44 -0700)] 
Merge tag 'v2.35.2'

3 years agoi18n: fix some badly formatted i18n strings
Jean-Noël Avila [Mon, 11 Apr 2022 19:23:30 +0000 (19:23 +0000)] 
i18n: fix some badly formatted i18n strings

String in submodule--helper is not correctly formatting
placeholders. The string in git-send-email is partial.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agotests: make SANITIZE=address imply TEST_NO_MALLOC_CHECK
Phillip Wood [Sat, 9 Apr 2022 12:28:37 +0000 (12:28 +0000)] 
tests: make SANITIZE=address imply TEST_NO_MALLOC_CHECK

As the address sanitizer checks for a superset of the issues detected
by setting MALLOC_CHECK_ (which tries to detect things like double
frees and off-by-one errors) there is no need to set the latter when
compiling with -fsanitize=address.

This fixes a regression introduced by 131b94a10a ("test-lib.sh: Use
GLIBC_TUNABLES instead of MALLOC_CHECK_ on glibc >= 2.34", 2022-03-04)
which causes all the tests to fail with the message

    ASan runtime does not come first in initial library list;
    you should either link runtime to your application or
    manually preload it with LD_PRELOAD.

when git is compiled with SANITIZE=address on systems with glibc >=
2.34. I have tested SANITIZE=leak and SANITIZE=undefined and they do
not suffer from this regression so the fix in this patch should be
sufficient.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'fr_2.36_rnd1' of github.com:jnavila/git
Jiang Xin [Mon, 11 Apr 2022 00:48:13 +0000 (08:48 +0800)] 
Merge branch 'fr_2.36_rnd1' of github.com:jnavila/git

* 'fr_2.36_rnd1' of github.com:jnavila/git:
  l10n: fr: v2.36 round 1

3 years agoMerge branch 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po
Jiang Xin [Mon, 11 Apr 2022 00:47:13 +0000 (08:47 +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.36.0 round 1
  l10n: Update zh_CN repo link

3 years agol10n: fr: v2.36 round 1
Jean-Noël Avila [Sat, 9 Apr 2022 16:53:27 +0000 (18:53 +0200)] 
l10n: fr: v2.36 round 1

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
3 years agoGit 2.36-rc1 v2.36.0-rc1
Junio C Hamano [Fri, 8 Apr 2022 20:54:49 +0000 (13:54 -0700)] 
Git 2.36-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'ld/sparse-index-bash-completion'
Junio C Hamano [Fri, 8 Apr 2022 20:53:48 +0000 (13:53 -0700)] 
Merge branch 'ld/sparse-index-bash-completion'

Test regression fix.

* ld/sparse-index-bash-completion:
  t9902: split test to run on appropriate systems

3 years agoMerge branch 'tl/ls-tree-oid-only'
Junio C Hamano [Fri, 8 Apr 2022 20:53:48 +0000 (13:53 -0700)] 
Merge branch 'tl/ls-tree-oid-only'

Docfix.

* tl/ls-tree-oid-only:
  ls-tree doc: document interaction with submodules