]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
10 months agoconfig: hide functions using `the_repository` by default
Patrick Steinhardt [Tue, 13 Aug 2024 09:14:23 +0000 (11:14 +0200)] 
config: hide functions using `the_repository` by default

The config subsystem provides a bunch of legacy functions that read or
set configuration for `the_repository`. The use of those functions is
discouraged, and it is easy to miss the implicit dependency on
`the_repository` that calls to those functions may cause.

Move all config-related functions that use `the_repository` into a block
that gets only conditionally compiled depending on whether or not the
macro has been defined. This also removes all dependencies on that
variable in "config.c", allowing us to remove the definition of said
preprocessor macro.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoglobal: prepare for hiding away repo-less config functions
Patrick Steinhardt [Tue, 13 Aug 2024 09:14:21 +0000 (11:14 +0200)] 
global: prepare for hiding away repo-less config functions

We're about to hide config functions that implicitly depend on
`the_repository` behind the `USE_THE_REPOSITORY_VARIABLE` macro. This
will uncover a bunch of dependents that transitively relied on the
global variable, but didn't define the macro yet.

Adapt them such that we define the macro to prepare for this change.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: don't depend on `the_repository` with branch conditions
Patrick Steinhardt [Tue, 13 Aug 2024 09:14:18 +0000 (11:14 +0200)] 
config: don't depend on `the_repository` with branch conditions

When computing branch "includeIf" conditions we use `the_repository` to
obtain the main ref store. We really shouldn't depend on this global
repository though, but should instead use the repository that is being
passed to us via `struct config_include_data`. Otherwise, when parsing
configuration of e.g. submodules, we may end up evaluating the condition
the via the wrong refdb.

Fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: don't have setters depend on `the_repository`
Patrick Steinhardt [Tue, 13 Aug 2024 09:14:15 +0000 (11:14 +0200)] 
config: don't have setters depend on `the_repository`

Some of the setters that accept a `struct repository` still implicitly
rely on `the_repository` via `git_config_set_multivar_in_file()`. While
this function would typically use the caller-provided path, it knows to
fall back to using the configuration path indicated by `the_repository`.

Adapt those functions to instead use the caller-provided repository.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: pass repo to functions that rename or copy sections
Patrick Steinhardt [Tue, 13 Aug 2024 09:14:12 +0000 (11:14 +0200)] 
config: pass repo to functions that rename or copy sections

Refactor functions that rename or copy config sections to accept a
`struct repository` such that we can get rid of the implicit dependency
on `the_repository`. Rename the functions accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: pass repo to `git_die_config()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:14:07 +0000 (11:14 +0200)] 
config: pass repo to `git_die_config()`

Refactor `git_die_config()` to accept a `struct repository` such that we
can get rid of the implicit dependency on `the_repository`. Rename the
function accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: pass repo to `git_config_get_expiry_in_days()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:14:03 +0000 (11:14 +0200)] 
config: pass repo to `git_config_get_expiry_in_days()`

Refactor `git_config_get_expiry_in_days()` to accept a `struct
repository` such that we can get rid of the implicit dependency on
`the_repository`. Rename the function accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: pass repo to `git_config_get_expiry()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:59 +0000 (11:13 +0200)] 
config: pass repo to `git_config_get_expiry()`

Refactor `git_config_get_expiry()` to accept a `struct repository` such
that we can get rid of the implicit dependency on `the_repository`.
Rename the function accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: pass repo to `git_config_get_max_percent_split_change()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:57 +0000 (11:13 +0200)] 
config: pass repo to `git_config_get_max_percent_split_change()`

Refactor `git_config_get_max_percent_split_change()` to accept a `struct
repository` such that we can get rid of the implicit dependency on
`the_repository`. Rename the function accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: pass repo to `git_config_get_split_index()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:54 +0000 (11:13 +0200)] 
config: pass repo to `git_config_get_split_index()`

Refactor `git_config_get_split_index()` to accept a `struct repository`
such that we can get rid of the implicit dependency on `the_repository`.
Rename the function accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: pass repo to `git_config_get_index_threads()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:49 +0000 (11:13 +0200)] 
config: pass repo to `git_config_get_index_threads()`

Refactor `git_config_get_index_threads()` to accept a `struct
repository` such that we can get rid of the implicit dependency on
`the_repository`. Rename the function accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: expose `repo_config_clear()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:46 +0000 (11:13 +0200)] 
config: expose `repo_config_clear()`

While we already have `repo_config_clear()` as an alternative to
`git_config_clear()` that doesn't rely on `the_repository`, it is not
exposed to callers outside of the config subsystem. Do so.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoconfig: introduce missing setters that take repo as parameter
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:43 +0000 (11:13 +0200)] 
config: introduce missing setters that take repo as parameter

While we already provide some of the config-setting interfaces with a
`struct repository` as parameter, others only have a variant that
implicitly depends on `the_repository`. Fill in those gaps such that we
can start to deprecate the repo-less variants.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agopath: hide functions using `the_repository` by default
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:40 +0000 (11:13 +0200)] 
path: hide functions using `the_repository` by default

The path subsystem provides a bunch of legacy functions that compute
paths relative to the "gitdir" and "commondir" directories of the global
`the_repository` variable. Use of those functions is discouraged, and it
is easy to miss the implicit dependency on `the_repository` that calls
to those functions may cause.

With `USE_THE_REPOSITORY_VARIABLE`, we have recently introduced a tool
that allows us to get rid of such functions over time. With this macro,
we can hide away functions that have such implicit dependency such that
other subsystems that want to be free of `the_repository` will not use
them by accident.

Move all path-related functions that use `the_repository` into a block
that gets only conditionally compiled depending on whether or not the
macro has been defined. This also removes all dependencies on that
variable in "path.c", allowing us to remove the definition of said
preprocessor macro.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agopath: stop relying on `the_repository` in `worktree_git_path()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:37 +0000 (11:13 +0200)] 
path: stop relying on `the_repository` in `worktree_git_path()`

When not provided a worktree, then `worktree_git_path()` will fall back
to returning a path relative to the main repository. In this case, we
implicitly rely on `the_repository` to derive the path. Remove this
dependency by passing a `struct repository` as parameter.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agopath: stop relying on `the_repository` when reporting garbage
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:31 +0000 (11:13 +0200)] 
path: stop relying on `the_repository` when reporting garbage

We access `the_repository` in `report_linked_checkout_garbage()` both
directly and indirectly via `get_git_dir()`. Remove this dependency by
instead passing a `struct repository` as parameter.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agohooks: remove implicit dependency on `the_repository`
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:28 +0000 (11:13 +0200)] 
hooks: remove implicit dependency on `the_repository`

We implicitly depend on `the_repository` in our hook subsystem because
we use `strbuf_git_path()` to compute hook paths. Remove this dependency
by accepting a `struct repository` as parameter instead.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoeditor: do not rely on `the_repository` for interactive edits
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:25 +0000 (11:13 +0200)] 
editor: do not rely on `the_repository` for interactive edits

We implicitly rely on `the_repository` when editing a file interactively
because we call `git_path()`. Adapt the function to instead take a
`struct repository` as a parameter so that we can remove this hidden
dependency.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agopath: expose `do_git_common_path()` as `repo_common_pathv()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:23 +0000 (11:13 +0200)] 
path: expose `do_git_common_path()` as `repo_common_pathv()`

With the same reasoning as the preceding commit, expose the function
`do_git_common_path()` as `repo_common_pathv()`. While at it, reorder
parameters such that they match the order we have in `repo_git_pathv()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agopath: expose `do_git_path()` as `repo_git_pathv()`
Patrick Steinhardt [Tue, 13 Aug 2024 09:13:20 +0000 (11:13 +0200)] 
path: expose `do_git_path()` as `repo_git_pathv()`

We're about to move functions of the "path" subsytem that do not use a
`struct repository` into "path.h" as static inlined functions. This will
require us to call `do_git_path()`, which is internal to "path.c".

Expose the function as `repo_git_pathv()` to prepare for the change.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'ps/refs-wo-the-repository' into ps/config-wo-the-repository
Junio C Hamano [Wed, 7 Aug 2024 21:13:20 +0000 (14:13 -0700)] 
Merge branch 'ps/refs-wo-the-repository' into ps/config-wo-the-repository

* 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 agoThe second batch
Junio C Hamano [Thu, 1 Aug 2024 17:17:48 +0000 (10:17 -0700)] 
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'as/show-ref-option-help-update'
Junio C Hamano [Thu, 1 Aug 2024 17:18:12 +0000 (10:18 -0700)] 
Merge branch 'as/show-ref-option-help-update'

A few descriptions in "git show-ref -h" have been clarified.

* as/show-ref-option-help-update:
  show-ref: improve short help messages of options

10 months agoMerge branch 'jc/doc-reviewing-guidelines-positive-reviews'
Junio C Hamano [Thu, 1 Aug 2024 17:18:11 +0000 (10:18 -0700)] 
Merge branch 'jc/doc-reviewing-guidelines-positive-reviews'

The reviewing guidelines document now explicitly encourages people
to give positive reviews and how.

* jc/doc-reviewing-guidelines-positive-reviews:
  ReviewingGuidelines: encourage positive reviews more

10 months agoMerge branch 'jc/doc-rebase-fuzz-vs-offset-fix'
Junio C Hamano [Thu, 1 Aug 2024 17:18:11 +0000 (10:18 -0700)] 
Merge branch 'jc/doc-rebase-fuzz-vs-offset-fix'

"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 agoStart the 2.47 cycle
Junio C Hamano [Wed, 31 Jul 2024 20:02:10 +0000 (13:02 -0700)] 
Start the 2.47 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge branch 'jc/how-to-maintain-updates'
Junio C Hamano [Wed, 31 Jul 2024 20:34:21 +0000 (13:34 -0700)] 
Merge branch 'jc/how-to-maintain-updates'

Doc update.

* jc/how-to-maintain-updates:
  howto-maintain: update daily tasks
  howto-maintain: cover a whole development cycle

10 months agoMerge branch 'tn/doc-commit-fix'
Junio C Hamano [Wed, 31 Jul 2024 20:34:20 +0000 (13:34 -0700)] 
Merge branch 'tn/doc-commit-fix'

Docfix.

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

10 months agoMerge branch 'jc/doc-one-shot-export-with-shell-func'
Junio C Hamano [Wed, 31 Jul 2024 20:34:19 +0000 (13:34 -0700)] 
Merge branch 'jc/doc-one-shot-export-with-shell-func'

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 'cp/unit-test-reftable-merged'
Junio C Hamano [Wed, 31 Jul 2024 20:34:19 +0000 (13:34 -0700)] 
Merge branch 'cp/unit-test-reftable-merged'

Another reftable test has been ported to use the unit test framework.

* cp/unit-test-reftable-merged:
  t-reftable-merged: add test for REFTABLE_FORMAT_ERROR
  t-reftable-merged: use reftable_ref_record_equal to compare ref records
  t-reftable-merged: add tests for reftable_merged_table_max_update_index
  t-reftable-merged: improve the const-correctness of helper functions
  t-reftable-merged: improve the test t_merged_single_record()
  t: harmonize t-reftable-merged.c with coding guidelines
  t: move reftable/merged_test.c to the unit testing framework

10 months agoMerge branch 'kn/ci-clang-format'
Junio C Hamano [Wed, 31 Jul 2024 20:34:18 +0000 (13:34 -0700)] 
Merge branch 'kn/ci-clang-format'

A CI job that use clang-format to check coding style issues in new
code has been added.

* kn/ci-clang-format:
  ci/style-check: add `RemoveBracesLLVM` in CI job
  check-whitespace: detect if no base_commit is provided
  ci: run style check on GitHub and GitLab
  clang-format: formalize some of the spacing rules
  clang-format: avoid spacing around bitfield colon
  clang-format: indent preprocessor directives after hash

10 months agoMerge branch 'jc/checkout-no-op-switch-errors'
Junio C Hamano [Wed, 31 Jul 2024 20:34:18 +0000 (13:34 -0700)] 
Merge branch 'jc/checkout-no-op-switch-errors'

"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 agoMerge branch 'pw/add-patch-with-suppress-blank-empty'
Junio C Hamano [Wed, 31 Jul 2024 20:34:17 +0000 (13:34 -0700)] 
Merge branch 'pw/add-patch-with-suppress-blank-empty'

"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 'rj/make-cleanup'
Junio C Hamano [Wed, 31 Jul 2024 20:34:17 +0000 (13:34 -0700)] 
Merge branch 'rj/make-cleanup'

A build tweak knob has been simplified by not setting the value
that is already the default; another unused one has been removed.

* rj/make-cleanup:
  config.mak.uname: remove unused uname_P variable
  Makefile: drop -Wno-universal-initializer from SP_EXTRA_FLAGS

10 months agoMerge branch 'jt/doc-post-receive-hook-update'
Junio C Hamano [Wed, 31 Jul 2024 20:34:16 +0000 (13:34 -0700)] 
Merge branch 'jt/doc-post-receive-hook-update'

Doc update.

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

10 months agoMerge branch 'ad/merge-with-diff-algorithm'
Junio C Hamano [Wed, 31 Jul 2024 20:34:16 +0000 (13:34 -0700)] 
Merge branch 'ad/merge-with-diff-algorithm'

Many Porcelain commands that internally use the merge machinery
were taught to consistently honor the diff.algorithm configuration.

* ad/merge-with-diff-algorithm:
  merge-recursive: honor diff.algorithm

10 months agoMerge branch 'rs/t-strvec-use-test-msg'
Junio C Hamano [Wed, 31 Jul 2024 20:34:15 +0000 (13:34 -0700)] 
Merge branch 'rs/t-strvec-use-test-msg'

Unit test clean-up.

* rs/t-strvec-use-test-msg:
  t-strvec: fix type mismatch in check_strvec
  t-strvec: improve check_strvec() output
  t-strvec: use test_msg()

10 months agorefs/reftable: stop using `the_repository`
Patrick Steinhardt [Tue, 30 Jul 2024 05:23:05 +0000 (07:23 +0200)] 
refs/reftable: stop using `the_repository`

Convert the reftable ref backend to stop using `the_repository` in favor
of the repo that gets passed in via `struct ref_store`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agorefs/packed: stop using `the_repository`
Patrick Steinhardt [Tue, 30 Jul 2024 05:23:01 +0000 (07:23 +0200)] 
refs/packed: stop using `the_repository`

Convert the packed ref backend to stop using `the_repository` in favor
of the repo that gets passed in via `struct ref_store`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agorefs/files: stop using `the_repository`
Patrick Steinhardt [Tue, 30 Jul 2024 05:22:56 +0000 (07:22 +0200)] 
refs/files: stop using `the_repository`

Convert the files ref backend to stop using `the_repository` in favor of
the repo that gets passed in via `struct ref_store`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agorefs/files: stop using `the_repository` in `parse_loose_ref_contents()`
Patrick Steinhardt [Tue, 30 Jul 2024 05:22:51 +0000 (07:22 +0200)] 
refs/files: stop using `the_repository` in `parse_loose_ref_contents()`

We implicitly rely on `the_repository` in `parse_loose_ref_contents()`
by calling `parse_oid_hex()`. Convert the function to instead use
`parse_oid_hex_algop()` and have callers pass in the hash algorithm to
use.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agorefs: stop using `the_repository`
Patrick Steinhardt [Tue, 30 Jul 2024 05:22:46 +0000 (07:22 +0200)] 
refs: stop using `the_repository`

Convert "refs.c" to stop using `the_repository` in favor of the repo
that gets passed in via `struct ref_store`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoGit 2.46 v2.46.0
Junio C Hamano [Mon, 29 Jul 2024 14:14:09 +0000 (07:14 -0700)] 
Git 2.46

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agoMerge tag 'l10n-2.46.0-rnd2' of https://github.com/git-l10n/git-po
Junio C Hamano [Mon, 29 Jul 2024 14:11:16 +0000 (07:11 -0700)] 
Merge tag 'l10n-2.46.0-rnd2' of https://github.com/git-l10n/git-po

l10n-2.46.0-rnd2

* tag 'l10n-2.46.0-rnd2' of https://github.com/git-l10n/git-po:
  l10n: zh_CN: updated translation for 2.46
  l10n: sv.po: Update Swedish translation
  l10n: zh_TW: Git 2.46
  l10n: Update German translation
  l10n: vi: Updated translation for 2.46
  l10n: uk: v2.46 update
  l10n: bg.po: Updated Bulgarian translation (5734t)
  l10n: fr: v2.46.0
  l10n: tr: Update Turkish translations
  l10n: po-id for 2.46

11 months agol10n: zh_CN: updated translation for 2.46
Teng Long [Thu, 18 Jul 2024 11:36:09 +0000 (19:36 +0800)] 
l10n: zh_CN: updated translation for 2.46

Signed-off-by: Teng Long <dyroneteng@gmail.com>
Co-authored-by: 依云 <lilydjwg@gmail.com>
Reviewed-by: 依云 <lilydjwg@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
11 months agol10n: sv.po: Update Swedish translation
Peter Krefting [Sun, 21 Jul 2024 14:05:05 +0000 (15:05 +0100)] 
l10n: sv.po: Update Swedish translation

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
11 months agoMerge branch 'l10n/zh-TW/2024-07-24' of github.com:l10n-tw/git-po
Jiang Xin [Sat, 27 Jul 2024 08:27:25 +0000 (16:27 +0800)] 
Merge branch 'l10n/zh-TW/2024-07-24' of github.com:l10n-tw/git-po

* 'l10n/zh-TW/2024-07-24' of github.com:l10n-tw/git-po:
  l10n: zh_TW: Git 2.46

11 months agoMerge branch 'l10n-de-2.46' of github.com:ralfth/git
Jiang Xin [Sat, 27 Jul 2024 08:25:13 +0000 (16:25 +0800)] 
Merge branch 'l10n-de-2.46' of github.com:ralfth/git

* 'l10n-de-2.46' of github.com:ralfth/git:
  l10n: Update German translation

11 months agoMerge branch 'vi-2.46' of github.com:Nekosha/git-po
Jiang Xin [Sat, 27 Jul 2024 08:24:48 +0000 (16:24 +0800)] 
Merge branch 'vi-2.46' of github.com:Nekosha/git-po

* 'vi-2.46' of github.com:Nekosha/git-po:
  l10n: vi: Updated translation for 2.46

11 months agoMerge branch '2.46-uk-update' of github.com:arkid15r/git-ukrainian-l10n
Jiang Xin [Sat, 27 Jul 2024 08:21:09 +0000 (16:21 +0800)] 
Merge branch '2.46-uk-update' of github.com:arkid15r/git-ukrainian-l10n

* '2.46-uk-update' of github.com:arkid15r/git-ukrainian-l10n:
  l10n: uk: v2.46 update

11 months agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Sat, 27 Jul 2024 08:20:29 +0000 (16:20 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

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

11 months agoMerge branch 'l10N_fr_2.46' of github.com:jnavila/git
Jiang Xin [Sat, 27 Jul 2024 08:18:53 +0000 (16:18 +0800)] 
Merge branch 'l10N_fr_2.46' of github.com:jnavila/git

* 'l10N_fr_2.46' of github.com:jnavila/git:
  l10n: fr: v2.46.0

11 months agoMerge branch 'tr-l10n' of github.com:bitigchi/git-po
Jiang Xin [Sat, 27 Jul 2024 08:17:45 +0000 (16:17 +0800)] 
Merge branch 'tr-l10n' of github.com:bitigchi/git-po

* 'tr-l10n' of github.com:bitigchi/git-po:
  l10n: tr: Update Turkish translations

11 months agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Sat, 27 Jul 2024 08:16:43 +0000 (16:16 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.46

11 months agol10n: zh_TW: Git 2.46
Yi-Jyun Pan [Sat, 27 Jul 2024 06:34:25 +0000 (14:34 +0800)] 
l10n: zh_TW: Git 2.46

Co-authored-by: Lumynous <lumynou5.tw@gmail.com>
Co-authored-by: Ngoo Ka-iu <willy04wu69@gmail.com>
Co-authored-by: Nightfeather Chen <slat@nightfeather.me>
Co-authored-by: Kisaragi Hiu <mail@kisaragi-hiu.com>
Co-authored-by: hms5232 <hms5232@hhming.moe>
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
11 months agol10n: Update German translation
Ralf Thielow [Sat, 13 Jul 2024 12:42:34 +0000 (14:42 +0200)] 
l10n: Update German translation

Reviewed-by: Matthias Rüster <matthias.ruester@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
11 months agol10n: vi: Updated translation for 2.46
Vũ Tiến Hưng [Fri, 26 Jul 2024 04:03:27 +0000 (11:03 +0700)] 
l10n: vi: Updated translation for 2.46

Signed-off-by: Vũ Tiến Hưng <newcomerminecraft@gmail.com>
11 months agodoc: difference in location to apply is "offset", not "fuzz"
Junio C Hamano [Thu, 25 Jul 2024 17:27:29 +0000 (10:27 -0700)] 
doc: difference in location to apply is "offset", not "fuzz"

The documentation to "git rebase" says that the line numbers (in the
rebased change) may not exactly be the same as the line numbers the
change gets replayed on top of the new base, but uses a wrong noun
"fuzz".  It should have said "offset".

They are both terms of art.  "fuzz" is about context lines not
exactly matching.  "offset" is about the difference in the location
that a change was taken from the original and the change gets
replayed on the target.  "offset" is often inevitable and part of
normal life.  "fuzz" on the other hand is often a sign of trouble
(and indeed "Git" refuses to apply a change with "fuzz", except
there are options to be fuzzy about whitespaces).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoReviewingGuidelines: encourage positive reviews more
Junio C Hamano [Thu, 25 Jul 2024 15:49:34 +0000 (08:49 -0700)] 
ReviewingGuidelines: encourage positive reviews more

I saw some contributors hesitate to give a positive review on
patches by their coworkers.  When written well, a positive review
does not have to be a hollow "looks good" that rubber stamps an
useless approval on a topic that is not interesting to others.

Let's add a few paragraphs to encourage positive reviews, which is a
bit harder to give than a review to point out things to improve.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoshow-ref: improve short help messages of options
Alexander Shopov [Wed, 24 Jul 2024 11:11:11 +0000 (14:11 +0300)] 
show-ref: improve short help messages of options

Trivial change to indicate that branches and tags are real options
that can be used combined to get more information.  This helps with
linting translations and prompting the user that the terms represent
options.

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agol10n: uk: v2.46 update
Arkadii Yakovets [Wed, 24 Jul 2024 21:30:10 +0000 (14:30 -0700)] 
l10n: uk: v2.46 update

Co-authored-by: Kate Golovanova <kate@kgthreads.com>
Signed-off-by: Arkadii Yakovets <ark@cho.red>
Signed-off-by: Kate Golovanova <kate@kgthreads.com>
11 months agoGit 2.46-rc2 v2.46.0-rc2
Junio C Hamano [Tue, 23 Jul 2024 23:54:19 +0000 (16:54 -0700)] 
Git 2.46-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'ps/ref-storage-migration-fix'
Junio C Hamano [Tue, 23 Jul 2024 23:54:34 +0000 (16:54 -0700)] 
Merge branch 'ps/ref-storage-migration-fix'

Hotfix for a topic already in -rc.

* ps/ref-storage-migration-fix:
  refs: fix format migration on Cygwin

11 months agoMerge branch 'js/doc-markup-updates-fix'
Junio C Hamano [Tue, 23 Jul 2024 23:54:34 +0000 (16:54 -0700)] 
Merge branch 'js/doc-markup-updates-fix'

Work around asciidoctor's css that renders `monospace` material
in the SYNOPSIS section of manual pages as block elements.

* js/doc-markup-updates-fix:
  Doc: fix Asciidoctor css workaround
  asciidoctor: fix `synopsis` rendering

11 months agoMerge branch 'ja/doc-markup-updates-fix'
Junio C Hamano [Tue, 23 Jul 2024 23:54:33 +0000 (16:54 -0700)] 
Merge branch 'ja/doc-markup-updates-fix'

Fix documentation mark-up regression in 2.45.

* ja/doc-markup-updates-fix:
  doc: git-clone fix discrepancy between asciidoc and asciidoctor

11 months agoMerge branch 'ds/midx-write-repack-fix'
Junio C Hamano [Tue, 23 Jul 2024 23:54:33 +0000 (16:54 -0700)] 
Merge branch 'ds/midx-write-repack-fix'

Repacking a repository with multi-pack index started making stupid
pack selections in Git 2.45, which has been corrected.

* ds/midx-write-repack-fix:
  midx-write: revert use of --stdin-packs
  t5319: add failing test case for repack/expire

11 months agoDoc: fix Asciidoctor css workaround
Junio C Hamano [Mon, 22 Jul 2024 21:17:55 +0000 (14:17 -0700)] 
Doc: fix Asciidoctor css workaround

The previous step introduced docinfo.html to be used to tweak the
CSS used by the asciidoctor, that by default renders <code> inside
<pre> as a block element, breaking the SYNOPSIS section of a few
pages that adopted a new convention we use since Git 2.45.

But in this project, HTML files are all generated.  We do not force
any human to write HTML by hand, which is an unusual and cruel
punishment.  "*.html" is in the .gitignore file, and "make clean"
removes them.  Having a tracked .html file makes "make clean" make
the tree dirty by removing the tracked docinfo.html file.

Let's do an obvious, minimum and stupid workaround to generate that
file at runtime instead.  The mark-up is being rethought in a major
way for the next development cycle, and the CSS workaround we added
in the previous step may have to adjusted, possibly in a large way,
anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoci/style-check: add `RemoveBracesLLVM` in CI job
Karthik Nayak [Tue, 23 Jul 2024 08:21:11 +0000 (10:21 +0200)] 
ci/style-check: add `RemoveBracesLLVM` in CI job

For 'clang-format', setting 'RemoveBracesLLVM' to 'true', adds a check
to ensure we avoid curly braces for single-statement bodies in
conditional blocks.

However, the option does come with two warnings [1]:

    This option will be renamed and expanded to support other styles.

and

    Setting this option to true could lead to incorrect code formatting
    due to clang-format’s lack of complete semantic information. As
    such, extra care should be taken to review code changes made by
    this option.

The latter seems to be of concern. While we want to experiment with the
rule, adding it to the in-tree '.clang-format' could affect end-users.
Let's only add it to the CI jobs for now. With time, we can evaluate
its efficacy and decide if we want to add it to '.clang-format' or
retract it entirely. We do so, by adding the existing rules in
'.clang-format' and this rule to a temp file outside the working tree,
which is then used by 'git clang-format'. This ensures we don't murk
with files in-tree.

[1]: https://clang.llvm.org/docs/ClangFormatStyleOptions.html#removebracesllvm

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agocheck-whitespace: detect if no base_commit is provided
Karthik Nayak [Tue, 23 Jul 2024 08:21:10 +0000 (10:21 +0200)] 
check-whitespace: detect if no base_commit is provided

The 'check-whitespace' CI script exits gracefully if no base commit is
provided or if an invalid revision is provided. This is not good because
if a particular CI provides an incorrect base_commit, it would fail
successfully.

This is exactly the case with the GitLab CI. The CI is using the
"$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" variable to get the base commit
SHA, but variable is only defined for _merged_ pipelines. So it is empty
for regular pipelines [1]. This should've failed the check-whitespace
job.

Let's fallback to 'CI_MERGE_REQUEST_DIFF_BASE_SHA' if
"CI_MERGE_REQUEST_TARGET_BRANCH_SHA" isn't available in GitLab CI,
similar to the previous commit. Let's also add a check for incorrect
base_commit in the 'check-whitespace.sh' script. While here, fix a small
typo too.

[1]: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#predefined-variables-for-merge-request-pipelines

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoci: run style check on GitHub and GitLab
Karthik Nayak [Tue, 23 Jul 2024 08:21:09 +0000 (10:21 +0200)] 
ci: run style check on GitHub and GitLab

We don't run style checks on our CI, even though we have a
'.clang-format' setup in the repository. Let's add one, the job will
validate only against the new commits added and will only run on merge
requests. Since we're introducing it for the first time, let's allow
this job to fail, so we can validate if this is useful and eventually
enforce it.

For GitHub, we allow the job to pass by adding 'continue-on-error: true'
to the workflow. This means the job would show as passed, even if the
style check failed. To know the status of the job, users have to
manually check the logs.

For GitLab, we allow the job to pass by adding 'allow_failure: true', to
the job. Unlike GitHub, here the job will show as failed with a yellow
warning symbol, but the pipeline would still show as passed.

Also for GitLab, we use the 'CI_MERGE_REQUEST_TARGET_BRANCH_SHA'
variable by default to obtain the base SHA of the merged pipeline (which
is only available for merged pipelines [1]). Otherwise we use the
'CI_MERGE_REQUEST_DIFF_BASE_SHA' variable.

[1]: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#predefined-variables-for-merge-request-pipelines

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoclang-format: formalize some of the spacing rules
Karthik Nayak [Tue, 23 Jul 2024 08:21:08 +0000 (10:21 +0200)] 
clang-format: formalize some of the spacing rules

There are some spacing rules that we follow in the project and it makes
sense to formalize them:
* Ensure there is no space inserted after the logical not '!' operator.
* Ensure there is no space before the case statement's colon.
* Ensure there is no space before the first bracket '[' of an array.
* Ensure there is no space in empty blocks.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoclang-format: avoid spacing around bitfield colon
Karthik Nayak [Tue, 23 Jul 2024 08:21:07 +0000 (10:21 +0200)] 
clang-format: avoid spacing around bitfield colon

The spacing around colons is currently not standardized and as such we
have the following practices in our code base:
- Spacing around the colon `int bf : 1`: 146 instances
- No spacing around the colon `int bf:1`: 148 instances
- Spacing before the colon `int bf :1`: 6 instances
- Spacing after the colon `int bf: 1`: 12 instances

Let's formalize this by picking the most followed pattern and add the
corresponding style to '.clang-format'.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoclang-format: indent preprocessor directives after hash
Karthik Nayak [Tue, 23 Jul 2024 08:21:06 +0000 (10:21 +0200)] 
clang-format: indent preprocessor directives after hash

We do not have a rule around the indentation of preprocessor directives.
This was also discussed on the list [1], noting how there is often
inconsistency in the styling. While there was discussion, there was no
conclusion around what is the preferred style here. One style being
indenting after the hash:

    #if FOO
    #  if BAR
    #    include <foo>
    #  endif
    #endif

The other being before the hash:

    #if FOO
      #if BAR
        #include <foo>
      #endif
    #endif

Let's pick the former and add 'IndentPPDirectives: AfterHash' value to
our '.clang-format'. There is no clear reason to pick one over the
other, but it would definitely be nicer to be consistent.

[1]: https://lore.kernel.org/r/xmqqwmmm1bw6.fsf@gitster.g

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agorefs: fix format migration on Cygwin
Patrick Steinhardt [Tue, 23 Jul 2024 12:31:28 +0000 (14:31 +0200)] 
refs: fix format migration on Cygwin

It was reported that t1460-refs-migrate.sh fails when using Cygwin with
errors like the following:

    error: could not link file '.git/ref_migration.sr9pEF/reftable' to '.git/reftable': Permission denied

As some debugging surfaced, the root cause of this is that some files of
the newly-initialized ref store are still open when the target format is
the "reftable" format, and Cygwin refuses to rename open files.

Fix this issue by closing the new ref store before renaming its files
into place. This is a slight change in behaviour compared to before,
where we kept the new ref store open and then updated the repository's
ref store to point to it.

While we could re-open the new ref store after we have moved files
around, this is ultimately unnecessary. We know that the only user of
`repo_migrate_ref_storage_format()` is the git-refs(1) command, and it
won't access the ref store after it has been migrated anyway. So
reinitializing the ref store would be a waste of time. Regardless of
that it is still sensible to leave the repository in a consistent state.
But instead of reinitializing the ref store, we can simply unset the
repo's ref store altogether and let `get_main_ref_store()` lazily
initialize the new ref store as required.

Reported-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoCodingGuidelines: document a shell that "fails" "VAR=VAL shell_func"
Junio C Hamano [Tue, 23 Jul 2024 00:04:54 +0000 (17:04 -0700)] 
CodingGuidelines: document a shell that "fails" "VAR=VAL shell_func"

Over the years, we accumulated the community wisdom to avoid the
common "one-short export" construct for shell functions, but seem to
have lost on which exact platform it is known to fail.  Now during
an investigation on a breakage for a recent topic, we found one
example of failing shell.  Let's document that.

This does *not* mean that we can freely start using the construct
once Ubuntu 20.04 is retired.  But it does mean that we cannot use
the construct until Ubuntu 20.04 is fully retired from the machines
that matter.  Moreover, posix explicitly says that the behaviour for
the construct is unspecified.

Helped-by: Kyle Lippincott <spectral@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agodoc: remove dangling closing parenthesis
Tomas Nordin [Mon, 22 Jul 2024 22:53:02 +0000 (22:53 +0000)] 
doc: remove dangling closing parenthesis

The second line of the synopsis, starting with [--dry-run] has a
dangling closing paren in the second optional group. Probably added by
mistake, so remove it.

Signed-off-by: Tomas Nordin <tomasn@posteo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoasciidoctor: fix `synopsis` rendering
Johannes Schindelin [Mon, 22 Jul 2024 20:25:49 +0000 (20:25 +0000)] 
asciidoctor: fix `synopsis` rendering

Since 76880f0510c (doc: git-clone: apply new documentation formatting
guidelines, 2024-03-29), the synopsis of `git clone`'s manual page is
rendered differently than before; Its parent commit did the same for
`git init`.

The result looks quite nice. When rendered with AsciiDoc, that is. When
rendered using AsciiDoctor and displayed in a graphical web browser such
as Firefox, Chrome, Edge, etc, the result is quite unpleasant to my eye,
reading something like this:

SYNOPSIS

 git clone
  [
 --template=
 <template-directory>]
  [
 -l
 ] [
 -s
 ] [
 --no-hardlinks
 ] [
 -q
 ] [
[... continuing like this ...]

The reason is that AsciiDoctor's default style sheet contains this (see
https://github.com/asciidoctor/asciidoctor/blob/854923b15533/src/stylesheets/asciidoctor.css#L519-L521
for context):

pre > code {
  display: block;
}

It is this `display: block` that forces the parts that are enclosed in
`<code>` tags (such as the `git clone` or the `--template=` part) to be
rendered on their own line.

Side note: This seems not to affect console web browsers like `lynx` or
`w3m`, most likely because most style sheet directions cannot be
respected in text terminals and therefore they seem to punt on style
sheets altogether.

To fix this, let's apply the method recommended by AsciiDoctor in
https://docs.asciidoctor.org/asciidoctor/latest/html-backend/default-stylesheet/#customize-docinfo
to partially override AsciiDoctor's default style sheet so that the
`<code>` sections of the synopsis are no longer each rendered on their
own, individual lines.

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

Even on the Git home page, where AsciiDoctor's default stylesheet is
_not_ used, this change resulted in some unpleasant rendering where not
only the font is changed for the `<code>` sections of the synopsis, but
padding and a different background color make the visual impression
quite uneven. This has been addressed in the meantime, via
https://github.com/git/git-scm.com/commit/a492d0565512.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agol10n: bg.po: Updated Bulgarian translation (5734t)
Alexander Shopov [Sun, 21 Jul 2024 19:31:10 +0000 (22:31 +0300)] 
l10n: bg.po: Updated Bulgarian translation (5734t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
11 months agoadd-patch: use normalize_marker() when recounting edited hunk
Phillip Wood [Sat, 20 Jul 2024 16:02:00 +0000 (16:02 +0000)] 
add-patch: use normalize_marker() when recounting edited hunk

After the user has edited a hunk the number of lines in the pre- and
post- image lines is recounted the hunk header can be updated before
passing the hunk to "git apply". The recounting code correctly handles
empty context lines where the leading ' ' is omitted by treating '\n'
and '\r' as context lines.

Update this code to use normalize_marker() so that the handling of empty
context lines is consistent with the rest of the hunk parsing
code. There is a small change in behavior as normalize_marker() only
treats "\r\n" as an empty context line rather than any line starting
with '\r'. This should not matter in practice as Macs have used Unix
line endings since MacOs 10 was released in 2001 and if it transpires
that someone is still using an earlier version of MacOs where lines end
with '\r' then we will need to change the handling of '\r' in
normalize_marker() anyway.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoadd-patch: handle splitting hunks with diff.suppressBlankEmpty
Phillip Wood [Sat, 20 Jul 2024 16:01:59 +0000 (16:01 +0000)] 
add-patch: handle splitting hunks with diff.suppressBlankEmpty

When "add -p" parses diffs, it looks for context lines starting with a
single space. But when diff.suppressBlankEmpty is in effect, an empty
context line will omit the space, giving us a true empty line. This
confuses the parser, which is unable to split based on such a line.

It's tempting to say that we should just make sure that we generate a
diff without that option.  However, although we do not parse hunks that
the user has manually edited with parse_diff() we do allow the user
to split such hunks. As POSIX calls the decision of whether to print the
space here "implementation-defined" we need to handle edited hunks where
empty context lines omit the space.

So let's handle both cases: a context line either starts with a space or
consists of a totally empty line by normalizing the first character to a
space when we parse them. Normalizing the first character rather than
changing the code to check for a space or newline will hopefully future
proof against introducing similar bugs if the code is changed.

Reported-by: Ilya Tumaykin <itumaykin@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agodoc: git-clone fix discrepancy between asciidoc and asciidoctor
Jean-Noël Avila [Sat, 20 Jul 2024 17:34:13 +0000 (17:34 +0000)] 
doc: git-clone fix discrepancy between asciidoc and asciidoctor

Asciidoc.py does not have the concept of generalized roles, whereas
asciidoctor interprets [foo]`blah` as blah with role foo in the
synopsis, making in effect foo disappear in the output. Note that
square brackets not directly followed by an inline markup do not
define a role, which is why we do not have the issue on other parts of
the documentation.

In order to get a consistant result across asciidoctor and
asciidoc.py, the hack is to use the {empty} entity
to split the bracket part from the inline format part.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agohowto-maintain: update daily tasks
Junio C Hamano [Fri, 19 Jul 2024 20:52:09 +0000 (13:52 -0700)] 
howto-maintain: update daily tasks

Some "implementation details" of how I perform these integration
tasks day to day have changed since the document was originally
written.  Update to reflect the way things are currently done.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agohowto-maintain: cover a whole development cycle
Junio C Hamano [Fri, 19 Jul 2024 20:44:35 +0000 (13:44 -0700)] 
howto-maintain: cover a whole development cycle

The "policy" part is more important than the "daily operation" part
in that it establishes why certain maintainer tasks exist and are
performed the way they are.

The text briefly touches the role each integration branches play in
the workflow, but does not give the whole picture of what happens in
a single development cycle using these branches.  Extend the
description to describe a whole development cycle.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agol10n: fr: v2.46.0
Jean-Noël Avila [Wed, 17 Jul 2024 20:39:57 +0000 (22:39 +0200)] 
l10n: fr: v2.46.0

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
11 months agomidx-write: revert use of --stdin-packs
Derrick Stolee [Thu, 18 Jul 2024 19:55:46 +0000 (19:55 +0000)] 
midx-write: revert use of --stdin-packs

This reverts b7d6f23a171 (midx-write.c: use `--stdin-packs` when
repacking, 2024-04-01) and then marks the test created in the previous
change as passing.

The fundamental issue with the reverted change is that the focus on
pack-files separates the object selection from how the multi-pack-index
selects a single pack-file for an object ID with multiple copies among
the tracked pack-files.

The change was made with the intention of improving delta compression in
the resulting pack-file, but that can be resolved with the existing
object list mechanism. There are other potential pitfalls of doing an
object walk at this time if the repository is a blobless partial clone,
and that will require additional testing on top of the one that changes
here.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Acked-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agol10n: tr: Update Turkish translations
Emir SARI [Sun, 14 Jul 2024 19:20:03 +0000 (22:20 +0300)] 
l10n: tr: Update Turkish translations

Signed-off-by: Emir SARI <emir_sari@icloud.com>
11 months agol10n: po-id for 2.46
Bagas Sanjaya [Sun, 14 Jul 2024 07:50:43 +0000 (14:50 +0700)] 
l10n: po-id for 2.46

Update following components:

  * builtin/clone.c
  * builtin/config.c
  * builtin/for-each-repo.c
  * builtin/refs.c
  * command-list.h
  * commit-graph.c
  * http.c
  * pack-bitmap-write.c
  * pack-bitmap.c
  * promisor-remote.c
  * refs.c
  * sequencer.c

Translate following new components:

  * pseudo-merge.c
  * refs/files-backend.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
11 months agot5319: add failing test case for repack/expire
Derrick Stolee [Thu, 18 Jul 2024 19:55:45 +0000 (19:55 +0000)] 
t5319: add failing test case for repack/expire

Git 2.45.0 included the change b7d6f23a171 (midx-write.c: use
`--stdin-packs` when repacking, 2024-04-01) which caused the 'git
multi-pack-index repack' command to use 'git pack-objects --stdin-packs'
instead of listing the objects to repack. While this change was
motivated by efficient cross-process communication and the ability to
improve delta compression, it breaks a fundamental function of the
'incremental-repack' task that is enabled by default in Scalar clones or
Git repositories that run 'git maintenance start'.

The 'incremental-repack' task performs a two-step process of the
'expire' and 'repack' subcommands of the 'git multi-pack-index' builtin.
The 'expire' command removes any pack-files listed in the
multi-pack-index but without any referenced objects. The 'repack' task
then finds a batch of pack-files to repack and sends their objects to
'git pack-objects'. Both the pack-files chosen for the batch and the
objects chosen to repack are based on the ones that the multi-pack-index
references. Objects that appear in a pack-file but have a duplicate copy
in a newer pack-file are not considered in this case. Since the
multi-pack-index references only the newest copy of an object, this
allows the next 'incremental-repack' task to remove the pack-files in
the next 'expire' task. This delay is intentional due to how Windows
handles may block deletion of files with open read handles.

However, the mentioned commit changed this behavior to divorce the set
of objects referenced by the multi-pack-index and instead use a set of
"included" and "excluded" pack-files in the 'git pack-objects' builtin.
When a pack-file is selected as "included", only the objects it contains
but are not in any "excluded" pack-files are considered for repacking.
This has led to client repositories failing to remove old pack-files as
they still have some referenced objects. This grows over time until the
point that Git is trying to repack the same pack-files over and over.

For now, create a test case that demonstrates the expected behavior, but
also fails in its final line. The setup here it attempting to recreate a
typical situation for a repository that uses a blobless partial clone.
There would be a large initial pack-file from the clone that is never
selected in the 'repack' batch. There are other pack-files that have a
combination of new objects from incremental fetches and possibly blobs
that are not connected to those incremental fetches; these blobs could
be filled in from commands like 'git checkout' or 'git blame'. The
pack-files also have some overlap on purpose so test-1 has some
duplicates in test-2 and test-2 has some duplicates in test-3.

At the end of the test, the test-2 pack-file still exists though it
should have been expired. This test will pass when reverting the
offending commit.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoGit 2.46-rc1 v2.46.0-rc1
Junio C Hamano [Thu, 18 Jul 2024 15:23:53 +0000 (08:23 -0700)] 
Git 2.46-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'jk/am-retry'
Junio C Hamano [Thu, 18 Jul 2024 15:30:27 +0000 (08:30 -0700)] 
Merge branch 'jk/am-retry'

Test fix as a follow-up to an already graduated topic.

* jk/am-retry:
  t4153: stop redirecting input from /dev/zero

11 months agoMerge branch 'tb/pseudo-merge-reachability-bitmap'
Junio C Hamano [Thu, 18 Jul 2024 15:30:27 +0000 (08:30 -0700)] 
Merge branch 'tb/pseudo-merge-reachability-bitmap'

Doc update.

* tb/pseudo-merge-reachability-bitmap:
  Documentation/gitpacking: make sample configs listing blocks

11 months agoMerge branch 'ps/pseudo-ref-terminology'
Junio C Hamano [Thu, 18 Jul 2024 15:30:26 +0000 (08:30 -0700)] 
Merge branch 'ps/pseudo-ref-terminology'

Doc update.

* ps/pseudo-ref-terminology:
  Documentation/glossary: fix double word

11 months agoMerge branch 'tb/doc-max-tree-depth-fix'
Junio C Hamano [Thu, 18 Jul 2024 15:30:26 +0000 (08:30 -0700)] 
Merge branch 'tb/doc-max-tree-depth-fix'

Doc update.

* tb/doc-max-tree-depth-fix:
  Documentation: fix default value for core.maxTreeDepth

11 months agoMerge branch 'ch/refs-without-the-repository-fix'
Junio C Hamano [Thu, 18 Jul 2024 15:30:25 +0000 (08:30 -0700)] 
Merge branch 'ch/refs-without-the-repository-fix'

Comment fix.

* ch/refs-without-the-repository-fix:
  refs: correct the version numbers in a comment

11 months agoconfig.mak.uname: remove unused uname_P variable
Ramsay Jones [Thu, 18 Jul 2024 01:13:25 +0000 (02:13 +0100)] 
config.mak.uname: remove unused uname_P variable

The uname_P make variable was added in commit e15f545155 ("Makefile
tweaks: Solaris 9+ dont need iconv / move up uname variables",
2006-02-20), but it seems to never have been used (even in that original
commit). The man page for 'uname' notes that the '-p' processor option
is non-portable (the 'uname_M' variable is used by the Makefile for that
purpose).

Remove the unused 'uname_P' make variable.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMakefile: drop -Wno-universal-initializer from SP_EXTRA_FLAGS
Ramsay Jones [Thu, 18 Jul 2024 01:12:19 +0000 (02:12 +0100)] 
Makefile: drop -Wno-universal-initializer from SP_EXTRA_FLAGS

Commit 1c96642326 ("sparse: allow '{ 0 }' to be used without warnings",
2020-05-22) added -Wno-universal-initializer to the SP_EXTRA_FLAGS in
order to suppress potential sparse warnings from using '{0}' as an
aggregate initializer. At that time, the default was for sparse to
issue warnings (i.e. the default was -Wuniversal-initializer) if such
an initializer was used to initialize an aggregate whose first member
was a pointer type. However, this default was changed just a few days
later to -Wno-universal-initializer (first released in sparse v0.6.2)
and has been so in all subsequent release versions of sparse.  Thus,
including -Wno-universal-initializer in the SP_EXTRA_FLAGS variable is
redundant.

Remove the unnecessary warning flag from SP_EXTRA_FLAGS, essentially
reverting commit 1c96642326.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoPost 2.46-rc0 batch #3
Junio C Hamano [Wed, 17 Jul 2024 17:47:05 +0000 (10:47 -0700)] 
Post 2.46-rc0 batch #3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'js/unit-test-oidtree-cmake-fix'
Junio C Hamano [Wed, 17 Jul 2024 17:47:27 +0000 (10:47 -0700)] 
Merge branch 'js/unit-test-oidtree-cmake-fix'

Build fix.

* js/unit-test-oidtree-cmake-fix:
  cmake: fix build of `t-oidtree`

11 months agoMerge branch 'js/var-git-shell-path'
Junio C Hamano [Wed, 17 Jul 2024 17:47:27 +0000 (10:47 -0700)] 
Merge branch 'js/var-git-shell-path'

"git var GIT_SHELL_PATH" should report the path to the shell used
to spawn external commands, but it didn't do so on Windows, which
has been corrected.

* js/var-git-shell-path:
  var(win32): do report the GIT_SHELL_PATH that is actually used
  run-command: declare the `git_shell_path()` function globally
  run-command(win32): resolve the path to the Unix shell early
  mingw(is_msys2_sh): handle forward slashes in the `sh.exe` path, too
  win32: override `fspathcmp()` with a directory separator-aware version
  strvec: declare the `strvec_push_nodup()` function globally
  run-command: refactor getting the Unix shell path into its own function

11 months agoMerge branch 'ps/doc-http-empty-cookiefile'
Junio C Hamano [Wed, 17 Jul 2024 17:47:26 +0000 (10:47 -0700)] 
Merge branch 'ps/doc-http-empty-cookiefile'

What happens when http.cookieFile gets the special value "" has
been clarified in the documentation.

* ps/doc-http-empty-cookiefile:
  doc: update http.cookieFile with in-memory cookie processing