]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
9 months agomatch-trees: fix leaking prefixes in `shift_tree()`
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:36 +0000 (12:09 +0200)] 
match-trees: fix leaking prefixes in `shift_tree()`

In `shift_tree()` we allocate two empty strings that we end up
passing to `match_trees()`. If that function finds a better match it
will update these pointers to point to a newly allocated strings,
freeing the old strings. We never free the final results though, neither
the ones we have allocated ourselves, nor the one that `match_trees()`
might've returned to us.

Fix the resulting memory leaks by creating a common exit path where we
free them.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agobuiltin/fmt-merge-msg: fix leaking buffers
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:34 +0000 (12:09 +0200)] 
builtin/fmt-merge-msg: fix leaking buffers

Fix leaking input and output buffers in git-fmt-merge-msg(1).

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agobuiltin/grep: fix leaking object context
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:31 +0000 (12:09 +0200)] 
builtin/grep: fix leaking object context

Even when `get_oid_with_context()` fails it may have allocated some data
in the object context. But we do not release it in git-grep(1) when the
call fails, leading to a memory leak. Plug it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agobuiltin/pack-objects: plug leaking list of keep-packs
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:26 +0000 (12:09 +0200)] 
builtin/pack-objects: plug leaking list of keep-packs

The `--keep-pack` option of git-pack-objects(1) populates the arguments
into a string list. And while the list is marked as `NODUP` and thus
won't duplicate the strings, the list entries themselves still need to
be free'd. We don't though, causing a leak.

Plug it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agobuiltin/repack: fix leaking line buffer when packing promisors
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:23 +0000 (12:09 +0200)] 
builtin/repack: fix leaking line buffer when packing promisors

In `repack_promisor_objects()` we read output from git-pack-objects(1)
line by line, using `strbuf_getline_lf()`. We never free the line
buffer, causing a memory leak. Plug it.

This leak is being hit in t5616, but plugging it alone is not
sufficient to make the whole test suite leak free.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agonegotiator/skipping: fix leaking commit entries
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:20 +0000 (12:09 +0200)] 
negotiator/skipping: fix leaking commit entries

When releasing the skipping negotiator we free its priority queue, but
not the contained entries. Fix this to plug a memory leak.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agoshallow: fix leaking members of `struct shallow_info`
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:17 +0000 (12:09 +0200)] 
shallow: fix leaking members of `struct shallow_info`

We do not free several struct members in `clear_shallow_info()`. Fix
this to plug the resulting leaks.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agoshallow: free grafts when unregistering them
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:15 +0000 (12:09 +0200)] 
shallow: free grafts when unregistering them

When removing a graft via `unregister_shallow()` we remove it from the
grafts array, but do not free the structure. Fix this to plug the leak.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agoobject: clear grafts when clearing parsed object pool
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:12 +0000 (12:09 +0200)] 
object: clear grafts when clearing parsed object pool

We do not clear grafts part of the parsed object pool when clearing the
pool itself, which can lead to memory leaks when a repository is being
cleared.

Fix this by moving `reset_commit_grafts()` into "object.c" and making it
part of the `struct parsed_object_pool` interface such that we can call
it from `parsed_object_pool_clear()`. Adapt `parsed_object_pool_new()`
to take and store a reference to its owning repository, which is needed
by `unparse_commit()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agogpg-interface: fix misdesigned signing key interfaces
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:07 +0000 (12:09 +0200)] 
gpg-interface: fix misdesigned signing key interfaces

The interfaces to retrieve signing keys and their IDs are misdesigned as
they return string constants even though they indeed allocate memory,
which leads to memory leaks. Refactor the code to instead always return
allocated strings and let the callers free them accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agosend-pack: fix leaking push cert nonce
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:04 +0000 (12:09 +0200)] 
send-pack: fix leaking push cert nonce

When retrieving the push cert nonce from the server, we first store the
constant returned by `server_feature_value()` and then, if the nonce is
valid, we duplicate the nonce memory to a NUL-terminated string, so that
we can pass it to `generate_push_cert()`. We never free the latter and
thus cause a memory leak.

Fix this by storing the limited-lifetime nonce into a scope-local
variable such that the long-lived, allocated nonce can be easily freed
without having to cast away its constness.

This leak was exposed by t5534, but fixing it is not sufficient to make
the whole test suite leak free.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agoremote: fix leak in reachability check of a remote-tracking ref
Patrick Steinhardt [Thu, 5 Sep 2024 10:09:01 +0000 (12:09 +0200)] 
remote: fix leak in reachability check of a remote-tracking ref

In `check_if_includes_upstream()` we retrieve the local ref
corresponding to a remote-tracking ref we want to check reachability
for. We never free that local ref and thus cause a memory leak. Fix
this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agoremote: fix leaking tracking refs
Patrick Steinhardt [Thu, 5 Sep 2024 10:08:59 +0000 (12:08 +0200)] 
remote: fix leaking tracking refs

When computing the remote tracking ref we cause two memory leaks:

  - We leak when `remote_tracking()` fails.

  - We leak when the call to `remote_tracking()` succeeds and sets
    `ref->tracking_ref()`.

Fix both of these leaks.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agobuiltin/submodule--helper: fix leaking refs on push-check
Patrick Steinhardt [Thu, 5 Sep 2024 10:08:56 +0000 (12:08 +0200)] 
builtin/submodule--helper: fix leaking refs on push-check

In the push-check subcommand of the submodule helper we acquire a list
of local refs, but never free that list. Fix this memory leak.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agosubmodule: fix leaking fetch task data
Patrick Steinhardt [Thu, 5 Sep 2024 10:08:53 +0000 (12:08 +0200)] 
submodule: fix leaking fetch task data

The `submodule_parallel_fetch` structure contains various data
structures that we use to set up parallel fetches of submodules. We do
not free some of its data though, causing memory leaks. Plug those.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agoupload-pack: fix leaking child process data on reachability checks
Patrick Steinhardt [Thu, 5 Sep 2024 10:08:48 +0000 (12:08 +0200)] 
upload-pack: fix leaking child process data on reachability checks

We spawn a git-rev-list(1) command to perform reachability checks in
"upload-pack.c". We do not release memory associated with the process
in error cases though, thus leaking memory.

Fix these by calling `child_process_clear()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agobuiltin/push: fix leaking refspec query result
Patrick Steinhardt [Thu, 5 Sep 2024 10:08:46 +0000 (12:08 +0200)] 
builtin/push: fix leaking refspec query result

When appending a refspec via `refspec_append_mapped()` we leak the
result of `query_refspecs()`. The overall logic around refspec queries
is quite weird, as callers are expected to either set the `src` or `dst`
pointers, and then the (allocated) result will be in the respective
other struct member.

As we have the `src` member set, plugging the memory leak is thus as
easy as just freeing the `dst` member. While at it, use designated
initializers to initialize the structure.

This leak was exposed by t5516, but fixing it is not sufficient to make
the whole test suite leak free.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agosend-pack: fix leaking common object IDs
Patrick Steinhardt [Thu, 5 Sep 2024 10:08:43 +0000 (12:08 +0200)] 
send-pack: fix leaking common object IDs

We're leaking the array of common object IDs in `send_pack()`. Fix this
by creating a common exit path where we free the leaking data. While at
it, unify some other cleanups now that we have a central place to put
them.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agofetch-pack: fix memory leaks on fetch negotiation
Patrick Steinhardt [Thu, 5 Sep 2024 10:08:40 +0000 (12:08 +0200)] 
fetch-pack: fix memory leaks on fetch negotiation

We leak both the `nt_object_array` and `negotiator` structures in
`negotiate_using_fetch()`. Plug both of these leaks.

These leaks were exposed by t5516, but fixing them is not sufficient to
make the whole test suite leak free.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 months agot/test-lib: allow skipping leak checks for passing tests
Patrick Steinhardt [Thu, 5 Sep 2024 10:08:38 +0000 (12:08 +0200)] 
t/test-lib: allow skipping leak checks for passing tests

With `GIT_TEST_PASSING_SANITIZE_LEAK=check`, one can double check
whether a memory leak fix caused some test suites to become leak free.
This is done by running all tests with the leak checker enabled. If a
test suite does not declare `TEST_PASSES_SANITIZE_LEAK=true` but still
finishes successfully with the leak checker enabled, then this indicates
that the test is leak free and thus missing the annotation.

It is somewhat slow to execute though because it runs all of our test
suites with the leak sanitizer enabled. It is also pointless in most
cases, because the only test suites that need to be checked are those
which _aren't_ yet marked with `TEST_PASSES_SANITIZE_LEAK=true`.

Introduce a new value "check-failing". When set, we behave the same as
if "check" was passed, except that we only check those tests which do
not have `TEST_PASSES_SANITIZE_LEAK=true` set. This is significantly
faster than running all test suites but still fulfills the usecase of
finding newly-leak-free test suites.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoThe eighth batch
Junio C Hamano [Fri, 23 Aug 2024 15:57:03 +0000 (08:57 -0700)] 
The eighth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'ps/stash-keep-untrack-empty-fix'
Junio C Hamano [Fri, 23 Aug 2024 16:02:36 +0000 (09:02 -0700)] 
Merge branch 'ps/stash-keep-untrack-empty-fix'

A corner case bug in "git stash" was fixed.

* ps/stash-keep-untrack-empty-fix:
  builtin/stash: fix `--keep-index --include-untracked` with empty HEAD

10 months agoMerge branch 'ps/hash-and-ref-format-from-config'
Junio C Hamano [Fri, 23 Aug 2024 16:02:35 +0000 (09:02 -0700)] 
Merge branch 'ps/hash-and-ref-format-from-config'

The default object hash and ref backend format used to be settable
only with explicit command line option to "git init" and
environment variables, but now they can be configured in the user's
global and system wide configuration.

* ps/hash-and-ref-format-from-config:
  setup: make ref storage format configurable via config
  setup: make object format configurable via config
  setup: merge configuration of repository formats
  t0001: delete repositories when object format tests finish
  t0001: exercise initialization with ref formats more thoroughly

10 months agoMerge branch 'cp/unit-test-reftable-readwrite'
Junio C Hamano [Fri, 23 Aug 2024 16:02:35 +0000 (09:02 -0700)] 
Merge branch 'cp/unit-test-reftable-readwrite'

* cp/unit-test-reftable-readwrite:
  t-reftable-readwrite: add test for known error
  t-reftable-readwrite: use 'for' in place of infinite 'while' loops
  t-reftable-readwrite: use free_names() instead of a for loop
  t: move reftable/readwrite_test.c to the unit testing framework

10 months agoMerge branch 'ps/config-wo-the-repository'
Junio C Hamano [Fri, 23 Aug 2024 16:02:34 +0000 (09:02 -0700)] 
Merge branch 'ps/config-wo-the-repository'

Use of API functions that implicitly depend on the_repository
object in the config subsystem has been rewritten to pass a
repository object through the callchain.

* ps/config-wo-the-repository:
  config: hide functions using `the_repository` by default
  global: prepare for hiding away repo-less config functions
  config: don't depend on `the_repository` with branch conditions
  config: don't have setters depend on `the_repository`
  config: pass repo to functions that rename or copy sections
  config: pass repo to `git_die_config()`
  config: pass repo to `git_config_get_expiry_in_days()`
  config: pass repo to `git_config_get_expiry()`
  config: pass repo to `git_config_get_max_percent_split_change()`
  config: pass repo to `git_config_get_split_index()`
  config: pass repo to `git_config_get_index_threads()`
  config: expose `repo_config_clear()`
  config: introduce missing setters that take repo as parameter
  path: hide functions using `the_repository` by default
  path: stop relying on `the_repository` in `worktree_git_path()`
  path: stop relying on `the_repository` when reporting garbage
  hooks: remove implicit dependency on `the_repository`
  editor: do not rely on `the_repository` for interactive edits
  path: expose `do_git_common_path()` as `repo_common_pathv()`
  path: expose `do_git_path()` as `repo_git_pathv()`

10 months agoMerge branch 'ps/leakfixes-part-4'
Junio C Hamano [Fri, 23 Aug 2024 16:02:33 +0000 (09:02 -0700)] 
Merge branch 'ps/leakfixes-part-4'

More leak fixes.

* ps/leakfixes-part-4: (22 commits)
  builtin/diff: free symmetric diff members
  diff: free state populated via options
  builtin/log: fix leak when showing converted blob contents
  userdiff: fix leaking memory for configured diff drivers
  builtin/format-patch: fix various trivial memory leaks
  diff: fix leak when parsing invalid ignore regex option
  unpack-trees: clear index when not propagating it
  sequencer: release todo list on error paths
  merge-ort: unconditionally release attributes index
  builtin/fast-export: plug leaking tag names
  builtin/fast-export: fix leaking diff options
  builtin/fast-import: plug trivial memory leaks
  builtin/notes: fix leaking `struct notes_tree` when merging notes
  builtin/rebase: fix leaking `commit.gpgsign` value
  config: fix leaking comment character config
  submodule-config: fix leaking name entry when traversing submodules
  read-cache: fix leaking hashfile when writing index fails
  bulk-checkin: fix leaking state TODO
  object-name: fix leaking symlink paths in object context
  object-file: fix memory leak when reading corrupted headers
  ...

10 months agoThe seventh batch
Junio C Hamano [Wed, 21 Aug 2024 18:41:52 +0000 (11:41 -0700)] 
The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'jc/how-to-maintain-updates'
Junio C Hamano [Wed, 21 Aug 2024 19:02:25 +0000 (12:02 -0700)] 
Merge branch 'jc/how-to-maintain-updates'

Doc updates.

* jc/how-to-maintain-updates:
  howto-maintain: mention preformatted docs

10 months agoMerge branch 'jk/apply-patch-mode-check-fix'
Junio C Hamano [Wed, 21 Aug 2024 19:02:25 +0000 (12:02 -0700)] 
Merge branch 'jk/apply-patch-mode-check-fix'

Test fix.

* jk/apply-patch-mode-check-fix:
  t4129: fix racy index when calling chmod after git-add

10 months agoMerge branch 'ps/bundle-outside-repo-fix'
Junio C Hamano [Wed, 21 Aug 2024 19:02:24 +0000 (12:02 -0700)] 
Merge branch 'ps/bundle-outside-repo-fix'

"git bundle unbundle" outside a repository triggered a BUG()
unnecessarily, which has been corrected.

* ps/bundle-outside-repo-fix:
  bundle: default to SHA1 when reading bundle headers
  builtin/bundle: have unbundle check for repo before opening its bundle

10 months agoMerge branch 'jc/grammo-fixes'
Junio C Hamano [Wed, 21 Aug 2024 19:02:23 +0000 (12:02 -0700)] 
Merge branch 'jc/grammo-fixes'

Doc updates.

* jc/grammo-fixes:
  doc: grammofix in git-diff-tree
  tutorial: grammofix

10 months agoMerge branch 'ag/git-svn-global-ignores'
Junio C Hamano [Wed, 21 Aug 2024 19:02:23 +0000 (12:02 -0700)] 
Merge branch 'ag/git-svn-global-ignores'

"git svn" has been taught about svn:global-ignores property
recent versions of Subversion has.

* ag/git-svn-global-ignores:
  git-svn: mention `svn:global-ignores` in help+docs
  git-svn: use `svn:global-ignores` to create .gitignore
  git-svn: add public property `svn:global-ignores`

10 months agoSync with 'maint' for Windows+VS build jobs used at CI
Junio C Hamano [Tue, 20 Aug 2024 21:24:05 +0000 (14:24 -0700)] 
Sync with 'maint' for Windows+VS build jobs used at CI

10 months agoMerge branch 'jk/midx-unused-fix'
Junio C Hamano [Tue, 20 Aug 2024 21:23:46 +0000 (14:23 -0700)] 
Merge branch 'jk/midx-unused-fix'

Code clean-up in the base topic.

* jk/midx-unused-fix:
  midx: drop unused parameters from add_midx_to_chain()

10 months agoMerge branch 'js/ci-win-vs-build' into maint-2.46
Junio C Hamano [Tue, 20 Aug 2024 21:23:12 +0000 (14:23 -0700)] 
Merge branch 'js/ci-win-vs-build' into maint-2.46

Sync with Windows+VS build jobs used at CI.

* js/ci-win-vs-build:
  ci(win+VS): download the vcpkg artifacts using a dedicated GitHub Action
  ci: bump microsoft/setup-msbuild from v1 to v2

10 months agoci(win+VS): download the vcpkg artifacts using a dedicated GitHub Action
Johannes Schindelin [Tue, 20 Aug 2024 14:31:10 +0000 (14:31 +0000)] 
ci(win+VS): download the vcpkg artifacts using a dedicated GitHub Action

The Git for Windows project provides a GitHub Action to download and
cache Azure Pipelines artifacts (such as the `vcpkg` artifacts), hiding
gnarly internals, and also providing some robustness against network
glitches. Let's use it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoci: bump microsoft/setup-msbuild from v1 to v2
Johannes Schindelin [Tue, 20 Aug 2024 14:31:09 +0000 (14:31 +0000)] 
ci: bump microsoft/setup-msbuild from v1 to v2

The main benefit: The new version uses a node.js version that is not yet
deprecated.

Links:
- [Release notes](https://github.com/microsoft/setup-msbuild/releases)
- [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md)
- [Commits](https://github.com/microsoft/setup-msbuild/compare/v1...v2)

This patch was originally by GitHub's Dependabot, but I cannot attribute
that bot properly because it has no dedicated email address. Probably
because it hasn't reached legal age yet, or something.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoThe sixth batch
Junio C Hamano [Mon, 19 Aug 2024 17:44:04 +0000 (10:44 -0700)] 
The sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'ps/transport-leakfix-test-updates'
Junio C Hamano [Mon, 19 Aug 2024 18:07:38 +0000 (11:07 -0700)] 
Merge branch 'ps/transport-leakfix-test-updates'

Test updates.

* ps/transport-leakfix-test-updates:
  transport: mark more tests leak-free

10 months agoMerge branch 'tb/incremental-midx-part-1'
Junio C Hamano [Mon, 19 Aug 2024 18:07:37 +0000 (11:07 -0700)] 
Merge branch 'tb/incremental-midx-part-1'

Incremental updates of multi-pack index files.

* tb/incremental-midx-part-1:
  midx: implement support for writing incremental MIDX chains
  t/t5313-pack-bounds-checks.sh: prepare for sub-directories
  t: retire 'GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP'
  midx: implement verification support for incremental MIDXs
  midx: support reading incremental MIDX chains
  midx: teach `midx_fanout_add_midx_fanout()` about incremental MIDXs
  midx: teach `midx_preferred_pack()` about incremental MIDXs
  midx: teach `midx_contains_pack()` about incremental MIDXs
  midx: remove unused `midx_locate_pack()`
  midx: teach `fill_midx_entry()` about incremental MIDXs
  midx: teach `nth_midxed_offset()` about incremental MIDXs
  midx: teach `bsearch_midx()` about incremental MIDXs
  midx: introduce `bsearch_one_midx()`
  midx: teach `nth_bitmapped_pack()` about incremental MIDXs
  midx: teach `nth_midxed_object_oid()` about incremental MIDXs
  midx: teach `prepare_midx_pack()` about incremental MIDXs
  midx: teach `nth_midxed_pack_int_id()` about incremental MIDXs
  midx: add new fields for incremental MIDX chains
  Documentation: describe incremental MIDX format

10 months agoMerge branch 'jc/tests-no-useless-tee'
Junio C Hamano [Mon, 19 Aug 2024 18:07:37 +0000 (11:07 -0700)] 
Merge branch 'jc/tests-no-useless-tee'

Test fixes.

* jc/tests-no-useless-tee:
  tests: drop use of 'tee' that hides exit status

10 months agoMerge branch 'rs/unit-tests-test-run'
Junio C Hamano [Mon, 19 Aug 2024 18:07:36 +0000 (11:07 -0700)] 
Merge branch 'rs/unit-tests-test-run'

Unit-test framework has learned a simple control structure to allow
embedding test statements in-line instead of having to create a new
function to contain them.

* rs/unit-tests-test-run:
  t-strvec: use if_test
  t-reftable-basics: use if_test
  t-ctype: use if_test
  unit-tests: add if_test
  unit-tests: show location of checks outside of tests
  t0080: use here-doc test body

10 months agoSync with 'maint'
Junio C Hamano [Fri, 16 Aug 2024 19:53:18 +0000 (12:53 -0700)] 
Sync with 'maint'

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoPrepare for 2.46.1
Junio C Hamano [Wed, 14 Aug 2024 22:02:29 +0000 (15:02 -0700)] 
Prepare for 2.46.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'sj/ref-fsck'
Junio C Hamano [Fri, 16 Aug 2024 19:51:51 +0000 (12:51 -0700)] 
Merge branch 'sj/ref-fsck'

"git fsck" infrastructure has been taught to also check the sanity
of the ref database, in addition to the object database.

* sj/ref-fsck:
  fsck: add ref name check for files backend
  files-backend: add unified interface for refs scanning
  builtin/refs: add verify subcommand
  refs: set up ref consistency check infrastructure
  fsck: add refs report function
  fsck: add a unified interface for reporting fsck messages
  fsck: make "fsck_error" callback generic
  fsck: rename objects-related fsck error functions
  fsck: rename "skiplist" to "skip_oids"

10 months agoMerge branch 'ps/p4-tests-updates' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:56 +0000 (12:50 -0700)] 
Merge branch 'ps/p4-tests-updates' into maint-2.46

Perforce tests have been updated.
cf. <na5mwletzpnacietbc7pzqcgb622mvrwgrkjgjosysz3gvjcso@gzxxi7d7icr7>

* ps/p4-tests-updates:
  t98xx: mark Perforce tests as memory-leak free
  ci: update Perforce version to r23.2
  t98xx: fix Perforce tests with p4d r23 and newer

10 months agoMerge branch 'ks/unit-test-comment-typofix' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:56 +0000 (12:50 -0700)] 
Merge branch 'ks/unit-test-comment-typofix' into maint-2.46

Typofix.

* ks/unit-test-comment-typofix:
  unit-tests/test-lib: fix typo in check_pointer_eq() description

10 months agoMerge branch 'dh/encoding-trace-optim' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:55 +0000 (12:50 -0700)] 
Merge branch 'dh/encoding-trace-optim' into maint-2.46

An expensive operation to prepare tracing was done in re-encoding
code path even when the tracing was not requested, which has been
corrected.

* dh/encoding-trace-optim:
  convert: return early when not tracing

10 months agoMerge branch 'dd/notes-empty-no-edit-by-default' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:55 +0000 (12:50 -0700)] 
Merge branch 'dd/notes-empty-no-edit-by-default' into maint-2.46

"git notes add -m '' --allow-empty" and friends that take prepared
data to create notes should not invoke an editor, but it started
doing so since Git 2.42, which has been corrected.

* dd/notes-empty-no-edit-by-default:
  notes: do not trigger editor when adding an empty note

10 months agoMerge branch 'jc/doc-rebase-fuzz-vs-offset-fix' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:54 +0000 (12:50 -0700)] 
Merge branch 'jc/doc-rebase-fuzz-vs-offset-fix' into maint-2.46

"git rebase --help" referred to "offset" (the difference between
the location a change was taken from and the change gets replaced)
incorrectly and called it "fuzz", which has been corrected.

* jc/doc-rebase-fuzz-vs-offset-fix:
  doc: difference in location to apply is "offset", not "fuzz"

10 months agoMerge branch 'tn/doc-commit-fix' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:54 +0000 (12:50 -0700)] 
Merge branch 'tn/doc-commit-fix' into maint-2.46

Docfix.

* tn/doc-commit-fix:
  doc: remove dangling closing parenthesis

10 months agoMerge branch 'pw/add-patch-with-suppress-blank-empty' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:53 +0000 (12:50 -0700)] 
Merge branch 'pw/add-patch-with-suppress-blank-empty' into maint-2.46

"git add -p" by users with diff.suppressBlankEmpty set to true
failed to parse the patch that represents an unmodified empty line
with an empty line (not a line with a single space on it), which
has been corrected.

* pw/add-patch-with-suppress-blank-empty:
  add-patch: use normalize_marker() when recounting edited hunk
  add-patch: handle splitting hunks with diff.suppressBlankEmpty

10 months agoMerge branch 'jt/doc-post-receive-hook-update' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:53 +0000 (12:50 -0700)] 
Merge branch 'jt/doc-post-receive-hook-update' into maint-2.46

Doc update.

* jt/doc-post-receive-hook-update:
  doc: clarify post-receive hook behavior

10 months agoMerge branch 'jc/how-to-maintain-updates' (early part) into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:52 +0000 (12:50 -0700)] 
Merge branch 'jc/how-to-maintain-updates' (early part) into maint-2.46

* 'jc/how-to-maintain-updates' (early part):
  howto-maintain: update daily tasks
  howto-maintain: cover a whole development cycle

10 months agoMerge branch 'jc/doc-one-shot-export-with-shell-func' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:51 +0000 (12:50 -0700)] 
Merge branch 'jc/doc-one-shot-export-with-shell-func' into maint-2.46

It has been documented that we avoid "VAR=VAL shell_func" and why.

* jc/doc-one-shot-export-with-shell-func:
  CodingGuidelines: document a shell that "fails" "VAR=VAL shell_func"

10 months agoMerge branch 'jc/checkout-no-op-switch-errors' into maint-2.46
Junio C Hamano [Fri, 16 Aug 2024 19:50:51 +0000 (12:50 -0700)] 
Merge branch 'jc/checkout-no-op-switch-errors' into maint-2.46

"git checkout --ours" (no other arguments) complained that the
option is incompatible with branch switching, which is technically
correct, but found confusing by some users.  It now says that the
user needs to give pathspec to specify what paths to checkout.

* jc/checkout-no-op-switch-errors:
  checkout: special case error messages during noop switching

10 months agosetup: make ref storage format configurable via config
Patrick Steinhardt [Fri, 16 Aug 2024 08:57:12 +0000 (10:57 +0200)] 
setup: make ref storage format configurable via config

Similar to the preceding commit, introduce a new "init.defaultRefFormat"
config that allows the user to globally set the ref storage format used
by newly created repositories.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agosetup: make object format configurable via config
Patrick Steinhardt [Fri, 16 Aug 2024 08:57:03 +0000 (10:57 +0200)] 
setup: make object format configurable via config

The object format for repositories can either be configured explicitly
by passing the `--object-format=` option to git-init(1) or git-clone(1),
or globally by setting the `GIT_DEFAULT_HASH` environment variable.
While the former makes sense, setting random environment variables is
not really a good user experience in case someone decides to only use
SHA256 repositories.

It is only natural to expect for a user that things like this can also
be configured via their config. As such, introduce a new config
"init.defaultObjectFormat", similar to "init.defaultBranch", that allows
the user to configure the default object format when creating new repos.

The precedence order now is the following, where the first one wins:

  1. The `--object-format=` switch.

  2. The `GIT_DEFAULT_HASH` environment variable.

  3. The `init.defaultObjectFormat` config variable.

This matches the typical precedence order we use in Git. We typically
let the environment override the config such that the latter can easily
be overridden on an ephemeral basis, for example by scripts.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agosetup: merge configuration of repository formats
Patrick Steinhardt [Fri, 16 Aug 2024 08:56:58 +0000 (10:56 +0200)] 
setup: merge configuration of repository formats

The configuration of repository formats is split up across two functions
`validate_hash_algorithm()` and `validate_ref_storage_format()`. This is
fine as-is, but we are about to extend the logic to also read default
values from the config. With the logic split across two functions, we
would either have to pass in additional parameters read from the config,
or read the config multiple times. Both of these options feel a bit
unwieldy.

Merge the code into a new function `repository_format_configure()` that
is responsible for configuring the whole repository's format. Like this,
we can easily read the config in a single place, only.

Furthermore, move the calls to `repo_set_ref_storage_format()` and
`repo_set_hash_algo()` into this new function as well, such that all the
logic to configure the repository format is self-contained here.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot0001: delete repositories when object format tests finish
Patrick Steinhardt [Fri, 16 Aug 2024 08:56:55 +0000 (10:56 +0200)] 
t0001: delete repositories when object format tests finish

The object format tests create one-shot repositories that are only used
by the respective test, but never delete them. This makes it hard to
pick a proper repository name in subsequent tests, as more and more
names are taken already.

Delete these repositories via `test_when_finished`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot0001: exercise initialization with ref formats more thoroughly
Patrick Steinhardt [Fri, 16 Aug 2024 08:56:53 +0000 (10:56 +0200)] 
t0001: exercise initialization with ref formats more thoroughly

While our object format tests for git-init(1) exercise tests with all
known formats in t0001, the tests for the ref format don't. This leads
to some missing test coverage for interesting cases, like whether or not
a non-default ref storage format causes us to bump the repository format
version. We also don't test for the precedence of the `--ref-format=`
and the `GIT_DEFAULT_REF_FORMAT=` environment variable.

Extend the test suite to cover more scenarios related to the ref format.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agobuiltin/stash: fix `--keep-index --include-untracked` with empty HEAD
Patrick Steinhardt [Fri, 16 Aug 2024 10:42:25 +0000 (12:42 +0200)] 
builtin/stash: fix `--keep-index --include-untracked` with empty HEAD

It was reported that creating a stash with `--keep-index
--include-untracked` causes an error when HEAD points to a commit whose
tree is empty:

    $ git stash push --keep-index --include-untracked
    error: pathspec ':/' did not match any file(s) known to git

This error comes from `git checkout --no-overlay $i_tree -- :/`, which
we execute to reset the working tree to the state in our index. As the
tree generated from the index is empty in our case, ':/' does not match
any files and thus causes git-checkout(1) to error out.

Fix the issue by skipping the checkout when the index tree is empty. As
explained in the in-code comment, this should be the correct thing to do
as there is nothing that we'd have to reset in the first place.

Reported-by: Piotr Siupa <piotrsiupa@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoThe fifth batch
Junio C Hamano [Thu, 15 Aug 2024 20:21:43 +0000 (13:21 -0700)] 
The fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'xx/diff-tree-remerge-diff-fix'
Junio C Hamano [Thu, 15 Aug 2024 20:22:16 +0000 (13:22 -0700)] 
Merge branch 'xx/diff-tree-remerge-diff-fix'

"git rev-list ... | git diff-tree -p --remerge-diff --stdin" should
behave more or less like "git log -p --remerge-diff" but instead it
crashed, forgetting to prepare a temporary object store needed.

* xx/diff-tree-remerge-diff-fix:
  diff-tree: fix crash when used with --remerge-diff

10 months agoMerge branch 'jc/refs-symref-referent'
Junio C Hamano [Thu, 15 Aug 2024 20:22:15 +0000 (13:22 -0700)] 
Merge branch 'jc/refs-symref-referent'

The refs API has been taught to give symref target information to
the users of ref iterators, allowing for-each-ref and friends to
avoid an extra ref_resolve_* API call per a symbolic ref.

* jc/refs-symref-referent:
  ref-filter: populate symref from iterator
  refs: add referent to each_ref_fn
  refs: keep track of unresolved reference value in iterators

10 months agoMerge branch 'ps/submodule-ref-format'
Junio C Hamano [Thu, 15 Aug 2024 20:22:14 +0000 (13:22 -0700)] 
Merge branch 'ps/submodule-ref-format'

Support to specify ref backend for submodules has been enhanced.

* ps/submodule-ref-format:
  object: fix leaking packfiles when closing object store
  submodule: fix leaking seen submodule names
  submodule: fix leaking fetch tasks
  builtin/submodule: allow "add" to use different ref storage format
  refs: fix ref storage format for submodule ref stores
  builtin/clone: propagate ref storage format to submodules
  builtin/submodule: allow cloning with different ref storage format
  git-submodule.sh: break overly long command lines

10 months agoMerge branch 'ag/t7004-modernize'
Junio C Hamano [Thu, 15 Aug 2024 20:22:13 +0000 (13:22 -0700)] 
Merge branch 'ag/t7004-modernize'

Coding style fixes to a test script.

* ag/t7004-modernize:
  t7004: make use of write_script
  t7004: use single quotes instead of double quotes
  t7004: begin the test body on the same line as test_expect_success
  t7004: description on the same line as test_expect_success
  t7004: do not prepare things outside test_expect_success
  t7004: use indented here-doc
  t7004: one command per line
  t7004: remove space after redirect operators

10 months agoMerge branch 'ps/reftable-stack-compaction'
Junio C Hamano [Thu, 15 Aug 2024 20:22:13 +0000 (13:22 -0700)] 
Merge branch 'ps/reftable-stack-compaction'

The code paths to compact multiple reftable files have been updated
to correctly deal with multiple compaction triggering at the same
time.

* ps/reftable-stack-compaction:
  reftable/stack: handle locked tables during auto-compaction
  reftable/stack: fix corruption on concurrent compaction
  reftable/stack: use lock_file when adding table to "tables.list"
  reftable/stack: do not die when fsyncing lock file files
  reftable/stack: simplify tracking of table locks
  reftable/stack: update stats on failed full compaction
  reftable/stack: test compaction with already-locked tables
  reftable/stack: extract function to setup stack with N tables
  reftable/stack: refactor function to gather table sizes

10 months agoMerge branch 'es/doc-platform-support-policy'
Junio C Hamano [Thu, 15 Aug 2024 20:22:12 +0000 (13:22 -0700)] 
Merge branch 'es/doc-platform-support-policy'

A policy document that describes platform support levels and
expectation on platform stakeholders has been introduced.

* es/doc-platform-support-policy:
  Documentation: add platform support policy

10 months agoMerge branch 'gt/unit-test-hashmap'
Junio C Hamano [Thu, 15 Aug 2024 20:22:12 +0000 (13:22 -0700)] 
Merge branch 'gt/unit-test-hashmap'

An existing test of hashmap API has been rewritten with the
unit-test framework.

* gt/unit-test-hashmap:
  t: port helper/test-hashmap.c to unit-tests/t-hashmap.c

10 months agoMerge branch 'jc/t3206-test-when-finished-fix'
Junio C Hamano [Thu, 15 Aug 2024 20:22:11 +0000 (13:22 -0700)] 
Merge branch 'jc/t3206-test-when-finished-fix'

Test clean-up.

* jc/t3206-test-when-finished-fix:
  t3206: test_when_finished before dirtying operations, not after

10 months agoMerge branch 'rs/t-example-simplify'
Junio C Hamano [Thu, 15 Aug 2024 20:22:11 +0000 (13:22 -0700)] 
Merge branch 'rs/t-example-simplify'

Unit test simplification.

* rs/t-example-simplify:
  t-example-decorate: remove test messages

10 months agoMerge branch 'jc/safe-directory'
Junio C Hamano [Thu, 15 Aug 2024 20:22:10 +0000 (13:22 -0700)] 
Merge branch 'jc/safe-directory'

Follow-up on 2.45.1 regression fix.

* jc/safe-directory:
  safe.directory: setting safe.directory="." allows the "current" directory
  safe.directory: normalize the configured path
  safe.directory: normalize the checked path
  safe.directory: preliminary clean-up

10 months agot4129: fix racy index when calling chmod after git-add
Jeff King [Thu, 15 Aug 2024 15:30:07 +0000 (11:30 -0400)] 
t4129: fix racy index when calling chmod after git-add

This patch fixes a racy test failure in t4129.

The deletion test added by e95d515141 (apply: canonicalize modes read
from patches, 2024-08-05) wants to make sure that git-apply does not
complain about a non-canonical mode in the patch, even if that mode does
not match the working tree file. So it does this:

echo content >non-canon &&
git add non-canon &&
chmod 666 non-canon &&

This is wrong, because running chmod will update the ctime on the file,
making it stat-dirty and causing git-apply to refuse to apply the patch.
But this only happens sometimes, since it depends on the timestamps
crossing a second boundary (but it triggers pretty quickly when run with
--stress).

We can fix this by doing the chmod before updating the index. The order
isn't important here, as the mode will be canonicalized to 100644 in the
index anyway (in fact, the chmod is not even that important in the first
place, since git-apply will only look at the index; I only added it as
an extra confirmation that git-apply would not be confused by it).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agohowto-maintain: mention preformatted docs
Junio C Hamano [Wed, 14 Aug 2024 23:03:26 +0000 (16:03 -0700)] 
howto-maintain: mention preformatted docs

Forgot to mention that the preformatted documentation repositories
are updated every time the master branch of the project advances.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agogit-svn: mention `svn:global-ignores` in help+docs
Alex Galvin [Wed, 14 Aug 2024 20:03:10 +0000 (20:03 +0000)] 
git-svn: mention `svn:global-ignores` in help+docs

Git-SVN was previously taught to use the svn:global-ignores property as
well as svn:ignore when creating or showing .gitignore files from a
Subversion repository. However, the documentation and help message still
only mentioned svn:ignore. Update Git-SVN's documentation and help
command to mention support for the new property. Also capitalize the
help message for the 'mkdirs' command, for consistency.

Signed-off-by: Alex Galvin <agalvin@comqi.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoThe fourth batch
Junio C Hamano [Wed, 14 Aug 2024 21:17:22 +0000 (14:17 -0700)] 
The fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'tb/t7704-deflake'
Junio C Hamano [Wed, 14 Aug 2024 21:54:58 +0000 (14:54 -0700)] 
Merge branch 'tb/t7704-deflake'

A test that fails on an unusually slow machine was found, and made
less likely to cause trouble by lengthening the expiry value it
uses.

* tb/t7704-deflake:
  t/t7704-repack-cruft.sh: avoid failures during long-running tests

10 months agoMerge branch 'jc/document-use-of-local'
Junio C Hamano [Wed, 14 Aug 2024 21:54:58 +0000 (14:54 -0700)] 
Merge branch 'jc/document-use-of-local'

Doc update.

* jc/document-use-of-local:
  doc: note that AT&T ksh does not work with our test suite

10 months agoMerge branch 'rs/use-decimal-width'
Junio C Hamano [Wed, 14 Aug 2024 21:54:57 +0000 (14:54 -0700)] 
Merge branch 'rs/use-decimal-width'

Code clean-up.

* rs/use-decimal-width:
  log-tree: use decimal_width()

10 months agoMerge branch 'ss/packed-ref-store-leakfix'
Junio C Hamano [Wed, 14 Aug 2024 21:54:56 +0000 (14:54 -0700)] 
Merge branch 'ss/packed-ref-store-leakfix'

Leakfix.

* ss/packed-ref-store-leakfix:
  refs/files: prevent memory leak by freeing packed_ref_store

10 months agoMerge branch 'cp/unit-test-reftable-tree'
Junio C Hamano [Wed, 14 Aug 2024 21:54:56 +0000 (14:54 -0700)] 
Merge branch 'cp/unit-test-reftable-tree'

A test in reftable library has been rewritten using the unit test
framework.

* cp/unit-test-reftable-tree:
  t-reftable-tree: improve the test for infix_walk()
  t-reftable-tree: add test for non-existent key
  t-reftable-tree: split test_tree() into two sub-test functions
  t: move reftable/tree_test.c to the unit testing framework
  reftable: remove unnecessary curly braces in reftable/tree.c

10 months agoMerge branch 'kl/test-fixes'
Junio C Hamano [Wed, 14 Aug 2024 21:54:55 +0000 (14:54 -0700)] 
Merge branch 'kl/test-fixes'

A flakey test and incorrect calls to strtoX() functions have been
fixed.

* kl/test-fixes:
  t6421: fix test to work when repo dir contains d0
  set errno=0 before strtoX calls

10 months agoMerge branch 'jc/reflog-expire-lookup-commit-fix'
Junio C Hamano [Wed, 14 Aug 2024 21:54:55 +0000 (14:54 -0700)] 
Merge branch 'jc/reflog-expire-lookup-commit-fix'

"git reflog expire" failed to honor annotated tags when computing
reachable commits.

* jc/reflog-expire-lookup-commit-fix:
  Revert "reflog expire: don't use lookup_commit_reference_gently()"

10 months agoMerge branch 'jr/ls-files-expand-literal-doc'
Junio C Hamano [Wed, 14 Aug 2024 21:54:54 +0000 (14:54 -0700)] 
Merge branch 'jr/ls-files-expand-literal-doc'

Docfix.

* jr/ls-files-expand-literal-doc:
  doc: fix hex code escapes in git-ls-files

10 months agoMerge branch 'jc/leakfix-mailmap'
Junio C Hamano [Wed, 14 Aug 2024 21:54:53 +0000 (14:54 -0700)] 
Merge branch 'jc/leakfix-mailmap'

Leakfix.

* jc/leakfix-mailmap:
  mailmap: plug memory leak in read_mailmap_blob()

10 months agoMerge branch 'jc/leakfix-hashfile'
Junio C Hamano [Wed, 14 Aug 2024 21:54:53 +0000 (14:54 -0700)] 
Merge branch 'jc/leakfix-hashfile'

Leakfix.

* jc/leakfix-hashfile:
  csum-file: introduce discard_hashfile()

10 months agoMerge branch 'jc/patch-id'
Junio C Hamano [Wed, 14 Aug 2024 21:54:53 +0000 (14:54 -0700)] 
Merge branch 'jc/patch-id'

The patch parser in "git patch-id" has been tightened to avoid
getting confused by lines that look like a patch header in the log
message.

* jc/patch-id:
  patch-id: tighten code to detect the patch header
  patch-id: rewrite code that detects the beginning of a patch
  patch-id: make get_one_patchid() more extensible
  patch-id: call flush_current_id() only when needed
  t4204: patch-id supports various input format

10 months agoMerge branch 'ps/refs-wo-the-repository'
Junio C Hamano [Wed, 14 Aug 2024 21:54:52 +0000 (14:54 -0700)] 
Merge branch 'ps/refs-wo-the-repository'

In the refs subsystem, implicit reliance of the_repository has been
eliminated; the repository associated with the ref store object is
used instead.

* ps/refs-wo-the-repository:
  refs/reftable: stop using `the_repository`
  refs/packed: stop using `the_repository`
  refs/files: stop using `the_repository`
  refs/files: stop using `the_repository` in `parse_loose_ref_contents()`
  refs: stop using `the_repository`

10 months agoMerge branch 'jc/jl-git-no-advice-fix'
Junio C Hamano [Wed, 14 Aug 2024 21:54:51 +0000 (14:54 -0700)] 
Merge branch 'jc/jl-git-no-advice-fix'

Remove leftover debugging cruft from a test script.

* jc/jl-git-no-advice-fix:
  t0018: remove leftover debugging cruft

10 months agoMerge branch 'tb/config-fixed-value-with-valueless-true'
Junio C Hamano [Wed, 14 Aug 2024 21:54:51 +0000 (14:54 -0700)] 
Merge branch 'tb/config-fixed-value-with-valueless-true'

"git config --value=foo --fixed-value section.key newvalue" barfed
when the existing value in the configuration file used the
valueless true syntax, which has been corrected.

* tb/config-fixed-value-with-valueless-true:
  config.c: avoid segfault with --fixed-value and valueless config

10 months agoMerge branch 'jk/apply-patch-mode-check-fix'
Junio C Hamano [Wed, 14 Aug 2024 21:54:50 +0000 (14:54 -0700)] 
Merge branch 'jk/apply-patch-mode-check-fix'

The patch parser in 'git apply' has been a bit more lenient against
unexpected mode bits, like 100664, recorded on extended header lines.

* jk/apply-patch-mode-check-fix:
  apply: canonicalize modes read from patches

10 months agoMerge branch 'ps/ref-api-cleanup'
Junio C Hamano [Wed, 14 Aug 2024 21:54:50 +0000 (14:54 -0700)] 
Merge branch 'ps/ref-api-cleanup'

Code clean-up.

* ps/ref-api-cleanup:
  refs: drop `ref_store`-less functions

10 months agoMerge branch 'ps/ls-remote-out-of-repo-fix'
Junio C Hamano [Wed, 14 Aug 2024 21:54:49 +0000 (14:54 -0700)] 
Merge branch 'ps/ls-remote-out-of-repo-fix'

A recent update broke "git ls-remote" used outside a repository,
which has been corrected.

* ps/ls-remote-out-of-repo-fix:
  builtin/ls-remote: fall back to SHA1 outside of a repo

10 months agoMerge branch 'jc/transport-leakfix'
Junio C Hamano [Wed, 14 Aug 2024 21:54:49 +0000 (14:54 -0700)] 
Merge branch 'jc/transport-leakfix'

Leakfix.

* jc/transport-leakfix:
  transport: fix leak with transport helper URLs

10 months agoMerge branch 'rh/http-proxy-path'
Junio C Hamano [Wed, 14 Aug 2024 21:54:48 +0000 (14:54 -0700)] 
Merge branch 'rh/http-proxy-path'

The value of http.proxy can have "path" at the end for a socks
proxy that listens to a unix-domain socket, but we started to
discard it when we taught proxy auth code path to use the
credential helpers, which has been corrected.

* rh/http-proxy-path:
  http: do not ignore proxy path

10 months agoMerge branch 'cp/unit-test-reftable-pq'
Junio C Hamano [Wed, 14 Aug 2024 21:54:48 +0000 (14:54 -0700)] 
Merge branch 'cp/unit-test-reftable-pq'

The tests for "pq" part of reftable library got rewritten to use
the unit test framework.

* cp/unit-test-reftable-pq:
  t-reftable-pq: add tests for merged_iter_pqueue_top()
  t-reftable-pq: add test for index based comparison
  t-reftable-pq: make merged_iter_pqueue_check() callable by reference
  t-reftable-pq: make merged_iter_pqueue_check() static
  t: move reftable/pq_test.c to the unit testing framework
  reftable: change the type of array indices to 'size_t' in reftable/pq.c
  reftable: remove unnecessary curly braces in reftable/pq.c

10 months agoMerge branch 'jk/osxkeychain-username-is-nul-terminated'
Junio C Hamano [Wed, 14 Aug 2024 21:54:47 +0000 (14:54 -0700)] 
Merge branch 'jk/osxkeychain-username-is-nul-terminated'

The credential helper to talk to OSX keychain sometimes sent
garbage bytes after the username, which has been corrected.

* jk/osxkeychain-username-is-nul-terminated:
  credential/osxkeychain: respect NUL terminator in username

10 months agoMerge branch 'ps/leakfixes-part-3'
Junio C Hamano [Wed, 14 Aug 2024 21:54:47 +0000 (14:54 -0700)] 
Merge branch 'ps/leakfixes-part-3'

More leakfixes.

* ps/leakfixes-part-3: (24 commits)
  commit-reach: fix trivial memory leak when computing reachability
  convert: fix leaking config strings
  entry: fix leaking pathnames during delayed checkout
  object-name: fix leaking commit list items
  t/test-repository: fix leaking repository
  builtin/credential-cache: fix trivial leaks
  builtin/worktree: fix leaking derived branch names
  builtin/shortlog: fix various trivial memory leaks
  builtin/rerere: fix various trivial memory leaks
  builtin/credential-store: fix leaking credential
  builtin/show-branch: fix several memory leaks
  builtin/rev-parse: fix memory leak with `--parseopt`
  builtin/stash: fix various trivial memory leaks
  builtin/remote: fix various trivial memory leaks
  builtin/remote: fix leaking strings in `branch_list`
  builtin/ls-remote: fix leaking `pattern` strings
  builtin/submodule--helper: fix leaking buffer in `is_tip_reachable`
  builtin/submodule--helper: fix leaking clone depth parameter
  builtin/name-rev: fix various trivial memory leaks
  builtin/describe: fix trivial memory leak when describing blob
  ...

10 months agobuiltin/diff: free symmetric diff members
Patrick Steinhardt [Wed, 14 Aug 2024 06:52:58 +0000 (08:52 +0200)] 
builtin/diff: free symmetric diff members

We populate a `struct symdiff` in case the user has requested a
symmetric diff. Part of this is to populate a `skip` bitmap that
indicates which commits shall be ignored in the diff. But while this
bitmap is dynamically allocated, we never free it.

Fix this by introducing and calling a new `symdiff_release()` function
that does this for us.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>