Commit Graph

16629 Commits (main)

Author SHA1 Message Date
Junio C Hamano 2c2ba49d55 Git 2.51-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-07 08:48:57 -07:00
Patrick Steinhardt 45dea789b0 Documentation/RelNotes/2.51.0: improve wording for a couple entries
Improve wording and fix typos for a couple entries part of the Git 2.51
release notes.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-07 08:48:49 -07:00
Junio C Hamano 64cbe5e2e8 A bit more after -rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-05 11:53:56 -07:00
Junio C Hamano 8982c5e909 Merge branch 'kj/renamed-submodule'
The case where a new submodule takes a path where used to be a
completely different subproject is now dealt a bit better than
before.

* kj/renamed-submodule:
  fixup! submodule: skip redundant active entries when pattern covers path
  fixup! submodule: prevent overwriting .gitmodules on path reuse
  submodule: skip redundant active entries when pattern covers path
  submodule: prevent overwriting .gitmodules on path reuse
2025-08-05 11:53:56 -07:00
Junio C Hamano 721c9e5ce7 Git 2.51-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-04 08:10:36 -07:00
Junio C Hamano 67fd2554bd Merge branch 'kh/doc-fast-import-historical'
Doc update.

* kh/doc-fast-import-historical:
  doc: fast-import: contextualize the hardware cost
2025-08-04 08:10:36 -07:00
Junio C Hamano 67424f5bca Merge branch 'jc/doc-release-vs-clear'
Doc update.

* jc/doc-release-vs-clear:
  CodingGuidelines: clarify that S_release() does not reinitialize
2025-08-04 08:10:35 -07:00
Junio C Hamano 817d661ce9 Merge branch 'js/mingw-fixes'
Windows fixes.

* js/mingw-fixes:
  mingw: support Windows Server 2016 again
  mingw_rename: support ReFS on Windows 2022
  mingw: drop Windows 7-specific work-around
  mingw_open_existing: handle directories better
2025-08-04 08:10:34 -07:00
Junio C Hamano d63f334a82 Merge branch 'lm/add-p-context'
"git add/etc -p" now honor the diff.context configuration variable,
and also they learn to honor the -U<n> command-line option.

* lm/add-p-context:
  add-patch: add diff.context command line overrides
  add-patch: respect diff.context configuration
  t: use test_config in t4055
  t: use test_grep in t3701 and t4055
2025-08-04 08:10:33 -07:00
Junio C Hamano 540aaa607c Merge branch 'ps/config-wo-the-repository'
The config API had a set of convenience wrapper functions that
implicitly use the_repository instance; they have been removed and
inlined at the calling sites.

* ps/config-wo-the-repository: (21 commits)
  config: fix sign comparison warnings
  config: move Git config parsing into "environment.c"
  config: remove unused `the_repository` wrappers
  config: drop `git_config_set_multivar()` wrapper
  config: drop `git_config_get_multivar_gently()` wrapper
  config: drop `git_config_set_multivar_in_file_gently()` wrapper
  config: drop `git_config_set_in_file_gently()` wrapper
  config: drop `git_config_set()` wrapper
  config: drop `git_config_set_gently()` wrapper
  config: drop `git_config_set_in_file()` wrapper
  config: drop `git_config_get_bool()` wrapper
  config: drop `git_config_get_ulong()` wrapper
  config: drop `git_config_get_int()` wrapper
  config: drop `git_config_get_string()` wrapper
  config: drop `git_config_get_string()` wrapper
  config: drop `git_config_get_string_multi()` wrapper
  config: drop `git_config_get_value()` wrapper
  config: drop `git_config_get_value()` wrapper
  config: drop `git_config_get()` wrapper
  config: drop `git_config_clear()` wrapper
  ...
2025-08-04 08:10:33 -07:00
Junio C Hamano 10be1c41bc Merge branch 'kn/for-each-ref-skip-updates'
Code clean-up.

* kn/for-each-ref-skip-updates:
  ref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'
  t6302: add test combining '--start-after' with '--exclude'
  for-each-ref: reword the documentation for '--start-after'
  for-each-ref: fix documentation argument ordering
  ref-cache: use 'size_t' instead of int for length
2025-08-04 08:10:32 -07:00
Junio C Hamano 0dc39a6e83 Merge branch 'jt/switch-restore-no-longer-experimental'
"git switch" and "git restore" are declared to be no longer
experimental.

* jt/switch-restore-no-longer-experimental:
  builtin: unmark git-switch and git-restore as experimental
2025-08-04 08:10:31 -07:00
Junio C Hamano e075325927 The seventeenth batch, just before -rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-03 18:44:28 -07:00
Junio C Hamano 8d9f536a51 Merge branch 'kn/for-each-ref-skip'
"git for-each-ref" learns "--start-after" option to help
applications that want to page its output.

* kn/for-each-ref-skip:
  ref-cache: set prefix_state when seeking
  for-each-ref: introduce a '--start-after' option
  ref-filter: remove unnecessary else clause
  refs: selectively set prefix in the seek functions
  ref-cache: remove unused function 'find_ref_entry()'
  refs: expose `ref_iterator` via 'refs.h'
2025-08-03 18:44:26 -07:00
Johannes Schindelin ce6ccbaf92 mingw: drop Windows 7-specific work-around
In ac33519ddf (mingw: restrict file handle inheritance only on Windows
7 and later, 2019-11-22), I introduced code to safe-guard the
defense-in-depth handling that restricts handles' inheritance so that it
would work with Windows 7, too.

Let's revert this patch: Git for Windows dropped supporting Windows 7 (and
Windows 8) directly after Git for Windows v2.46.2. For full details, see
https://gitforwindows.org/requirements#windows-version.

Actually, on second thought: revert only the part that makes this handle
inheritance restriction logic optional and that suggests to open a bug
report if it fails, but keep the fall-back to try again without said
logic: There have been a few false positives over the past few years
(where the warning was triggered e.g. because Defender was still
accessing a file that Git wanted to overwrite), and the fall-back logic
seems to have helped occasionally in such situations.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-03 18:30:38 -07:00
Junio C Hamano 866e6a391f The sixteenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01 11:27:14 -07:00
Junio C Hamano 6fe666b2ce Merge branch 'ly/pull-autostash'
"git pull" learned to pay attention to pull.autostash configuration
variable, which overrides rebase/merge.autostash.

* ly/pull-autostash:
  pull: add pull.autoStash config option
2025-08-01 11:27:14 -07:00
Junio C Hamano cbcde15e73 Merge branch 'jc/document-test-balloons-in-flight'
To help our developers, document what C99 language features are
being considered for adoption, in addition to what past experiments
have already decided.

* jc/document-test-balloons-in-flight:
  CodingGuidelines: document test balloons in flight
2025-08-01 11:27:13 -07:00
Junio C Hamano 8ad370f668 Merge branch 'ag/imap-send-list-folders-doc'
Document recently added "git imap-send --list" with an example.

* ag/imap-send-list-folders-doc:
  docs: explain how to use `git imap-send --list` command to get a list of available folders
2025-08-01 11:27:13 -07:00
Kristoffer Haugsbakk cca758d324 doc: fast-import: contextualize the hardware cost
6e411d2044 (Initial draft of fast-import documentation., 2007-02-05)
pointed out how much time a fast-import took on some hardware with a
specific cost.  Let’s further point out that this experiment was done
in 2007.  So modern hardware should have no issues with such a repo.

Also move the parenthetical to the end now that it contains four words.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01 10:40:26 -07:00
Junio C Hamano 4ac3302a1a CodingGuidelines: clarify that S_release() does not reinitialize
In the section for naming various API functions, the fact that
S_release() only releases the resources without preparing the
structure for immediate reuse becomes only apparent when you
readentries for S_release() and S_clear().

Clarify the description of S_release() a bit to make the entry self
sufficient.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-08-01 10:08:17 -07:00
Leon Michalak 2b3ae04011 add-patch: add diff.context command line overrides
This patch compliments the previous commit, where builtins that use
add-patch infrastructure now respect diff.context and
diff.interHunkContext file configurations.

In particular, this patch helps users who don't want to set persistent
context configurations or just want a way to override them on a one-time
basis, by allowing the relevant builtins to accept corresponding command
line options that override the file configurations.

This mimics commands such as diff and log, which allow for both context
file configuration and command line overrides.

Signed-off-by: Leon Michalak <leonmichalak6@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-29 08:52:45 -07:00
Justin Tobler f609dc4f7a builtin: unmark git-switch and git-restore as experimental
In 4e43b7ff (Declare both git-switch and git-restore experimental,
2019-04-25), the newly introduced git-switch(1) and git-restore(1)
commands were marked as experimental. This was done to provide time to
make breaking changes to the interface. It has now been over six years
since these commands were implemented and there hasn't been much change.
Consequently, users have grown to rely on how these commands work and it
is no longer feasible to make any breaking changes.

Let's remove the experimental label for git-switch(1) and
git-restore(1).

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-28 14:24:03 -07:00
Karthik Nayak fa0f4e46f5 for-each-ref: reword the documentation for '--start-after'
The documentation for '--start-after' states that the flag cannot be
used with general pattern matching. This is a bit vague, since there is
no clear understanding about what 'general' means here. Rewrite the
sentence to be more specific.

While here, fix a typo in the 'OPT_STRING'.

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>
2025-07-28 14:16:37 -07:00
Karthik Nayak a7c8a4c5f5 for-each-ref: fix documentation argument ordering
Improve the 'git-for-each-ref(1)' documentation with two corrections:

1. Add parentheses around `--exclude=<pattern>` to indicate this option
   can be repeated as a complete unit.

2. Move `--stdin | <pattern> ...` to the end, after all flags, since
   `<pattern>` is a positional argument that should appear last in the
   argument list.

While here, change to using the synopsis block which will automatically
format placeholders in italics and keywords in monospace.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-28 14:16:37 -07:00
Junio C Hamano e813a0200a The fifteenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-28 12:02:34 -07:00
Junio C Hamano e4ef0485fd The fourteenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-24 16:03:57 -07:00
Junio C Hamano 422a5222f8 Merge branch 'bc/contribution-under-non-real-names'
Document that we do not require "real" name when signing your
patches off.

* bc/contribution-under-non-real-names:
  SubmittingPatches: allow non-real name contributions
2025-07-24 16:03:57 -07:00
Junio C Hamano 5ce97021dd Merge branch 'pw/adopt-c99-bool-officially'
Declare weather-balloon we raised for "bool" type 18 months ago a
success and officially allow using the type in our codebase.

* pw/adopt-c99-bool-officially:
  strbuf: convert predicates to return bool
  git-compat-util: convert string predicates to return bool
  CodingGuidelines: allow the use of bool
2025-07-24 16:03:55 -07:00
K Jayatheerth 1fa06ceddf submodule: prevent overwriting .gitmodules on path reuse
Adding a submodule at a path that previously hosted
another submodule (e.g., 'child') reuses the submodule
name derived from the path. If the original submodule
was only moved (e.g., to 'child_old') and not renamed,
this silently overwrites its configuration in .gitmodules.

This behavior loses user configuration and causes
confusion when the original submodule is expected
to remain intact. It assumes that the path-derived
name is always safe to reuse, even though the name
might still be in use elsewhere in the repository.

Teach module_add() to check if the computed submodule
name already exists in the repository's submodule config,
and if so, refuse the operation unless the user explicitly
renames the submodule or uses the --force option,
which will automatically generate a unique name by
appending a number (e.g., child1).

Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-24 13:35:07 -07:00
Junio C Hamano 9b2527caa4 CodingGuidelines: document test balloons in flight
Due to portability concerns, we do not blindly say "It is in [[this
standard]], so we will make liberal use of it" for many features,
and use of C99 language features follow this same principle.  When
we contemplate adopting a language feature that we haven't used in
our codebase, we typically first raise a test balloon, which

 - is a piece of code that exercises the language feature we are
   trying to see if it is OK to adopt

 - is in a small section of code that we know everybody who cares
   about having a working Git must be compiling

 - is in a fairly stable part of the code, to allow reverting it
   easily if some platforms do not understand it yet.

After a few years, with no breakage report from the community, we'd
declare that the feature is now safe to use in our codebase.  Before
that, we forbid the use of the language construct except for the
designated test balloon code site.

The CodingGuidelines document lists these selected features that we
already have determined that they are safe, and also those features
that we know some platforms had trouble with.

Let's also start listing ongoing test balloons and expected timeline
for adoption.  Recently phillip proposed to adopt the syntax to
spell a structure literally (i.e. compound literal) with a new test
balloon, which Patrick made redundant by pointing out an existing
one we had already.but without documenting it.  Start the new section
with an entry for that test balloon.

Helped-by: Patrick Steinhardt <ps@pks.im>
Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-24 09:23:59 -07:00
Junio C Hamano 97e14d99f6 The thirteenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-23 15:45:16 -07:00
Junio C Hamano 5216bcbc84 Merge branch 'cc/fast-import-export-signature-names'
Clean up the way how signature on commit objects are exported to
and imported from fast-import stream.

* cc/fast-import-export-signature-names:
  fast-(import|export): improve on commit signature output format
2025-07-23 15:45:16 -07:00
Patrick Steinhardt 9ce196e86b config: drop `git_config()` wrapper
In 036876a106 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config()`. All callsites
are adjusted so that they use `repo_config(the_repository, ...)`
instead. While some callsites might already have a repository available,
this mechanical conversion is the exact same as the current situation
and thus cannot cause any regression. Those sites should eventually be
cleaned up in a later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-23 08:15:18 -07:00
Aditya Garg 0b86937589 docs: explain how to use `git imap-send --list` command to get a list of available folders
The output `git imap-send --list` command can be a bit confusing for new
users since the IMAP LIST command output is very verbose. Help such users
to analyse the same by using an example output.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-22 08:49:15 -07:00
Lidong Yan e3378607c8 pull: add pull.autoStash config option
Git uses `rebase.autostash` or `merge.autostash` to determine whether a
dirty worktree is allowed during pull. However, this behavior is not
clearly documented, making it difficult for users to discover how to
enable autostash, or causing them to unknowingly enable it. Add new
config option `pull.autostash` along with its documentation and test
cases.

`pull.autostash` provides the same functionality as `rebase.autostash`
and `merge.autostash`, but overrides them when set. If `pull.autostash`
is not set, it falls back to `rebase.autostash` or `merge.autostash`,
depending on the value of `pull.rebase`.

Signed-off-by: Lidong Yan <yldhome2d2@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-21 15:01:21 -07:00
Junio C Hamano 3f2a94875d The twelfth batch 2025-07-21 09:14:29 -07:00
Junio C Hamano 3a112b53a4 Merge branch 'jb/gpg-program-variable-is-a-pathname'
The gpg.program configuration variable, which names a pathname to
the (custom) GPG compatible program, can now be spelled with ~tilde
expansion.

* jb/gpg-program-variable-is-a-pathname:
  gpg-interface: expand gpg.program as a path
2025-07-21 09:14:29 -07:00
Junio C Hamano fe02fe75fc Merge branch 'ja/doc-git-log-markup'
Doc mark-up updates.

* ja/doc-git-log-markup:
  doc: git-log: convert log config to new doc format
  doc: git-log: convert diff options to new doc format
  doc: git-log: convert pretty formats to new doc format
  doc: git-log: convert pretty options to new doc format
  doc: git-log: convert rev list options to new doc format
  doc: git-log: convert line range format to new doc format
  doc: git-log: convert line range options to new doc format
  doc: git-log convert rev-list-description to new doc format
  doc: convert git-log to new documentation format
2025-07-21 09:14:28 -07:00
Junio C Hamano b5e966dde7 Merge branch 'rh/doc-glob-pathspec-fix'
Docfix.

* rh/doc-glob-pathspec-fix:
  doc: correct doc for glob pathspec
2025-07-21 09:14:27 -07:00
Junio C Hamano 867d9b19be Merge branch 'ps/meson-cleanups'
Meson-based build update.

* ps/meson-cleanups:
  ci: use Meson's new `--slice` option
  meson: update subproject wrappers
  meson: fix lookup of shell on MINGW64
  meson: clean up unnecessary variables
  meson: improve summary of auto-detected features
  meson: stop printing 'https' option twice in our summaries
  meson: stop discovering native version of Python
2025-07-21 09:14:27 -07:00
Junio C Hamano 205493d56d Merge branch 'tb/midx-avoid-cruft-packs'
"pack-objects" has been taught to avoid pointing into objects in
cruft packs from midx.

* tb/midx-avoid-cruft-packs:
  repack: exclude cruft pack(s) from the MIDX where possible
  pack-objects: introduce '--stdin-packs=follow'
  pack-objects: swap 'show_{object,commit}_pack_hint'
  pack-objects: fix typo in 'show_object_pack_hint()'
  pack-objects: perform name-hash traversal for unpacked objects
  pack-objects: declare 'rev_info' for '--stdin-packs' earlier
  pack-objects: factor out handling '--stdin-packs'
  pack-objects: limit scope in 'add_object_entry_from_pack()'
  pack-objects: use standard option incompatibility functions
2025-07-21 09:14:26 -07:00
Junio C Hamano 90c0775e97 The eleventh batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-16 09:42:29 -07:00
Junio C Hamano fe6fb09c27 Merge branch 'ag/doc-send-email'
Documentation updates for "git send-email".

* ag/doc-send-email:
  docs: mention possible options for Proton Mail users
  docs: add a paragraph explaining the `sendmailCmd` option of sendemail
  docs: add an OAuth2.0 credential helper for AOL accounts
  docs: add outlookidfix config option to sendemail documentation
  docs: link OpenSSL's verify(1) manual page to know about -CAfile and -CApath options
2025-07-16 09:42:29 -07:00
Junio C Hamano edb4fd9669 Merge branch 'ps/doc-pack-refs-auto-with-files-backend-fix'
Doc update.

* ps/doc-pack-refs-auto-with-files-backend-fix:
  docs/git-pack-refs: document heuristic used for packing loose refs
2025-07-16 09:42:28 -07:00
Phillip Wood bfa405ea36 CodingGuidelines: allow the use of bool
We have had a test balloon for C99's bool type since 8277dbe987
(git-compat-util: convert skip_{prefix,suffix}{,_mem} to bool,
2023-12-16). As we've had it over 18 months without any complaints
let's declare it a success.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-16 08:18:05 -07:00
brian m. carlson 1f0fed312a SubmittingPatches: allow non-real name contributions
Our submission guidelines require people to use their real name, but
this is not always suitable for various reasons.

For people who are transgender or non-binary and are transitioning or
who think they might want to transition, it can be a major obstacle and
cause major discomfort to require the use of their real name.  This is
made worse by the fact that Git provides no way to change names built
into history, so the use of a deadname is forever.  Our code of conduct
states that we "pledge to act and interact in ways that contribute to an
open, welcoming, diverse, inclusive, and healthy community," and
changing this policy is one way we can improve things for contributors.

In addition, there are some developers who are so widely known
pseudonymously that they have a Wikipedia page with their handle and no
real name.  It would seem silly to reject patches from people who are
known and respected in their open-source community just because they
don't wish to share a real name.

There are also other good reasons why people might operate
pseudonymously: because they or their family members are well known and
they wish to protect their privacy, because of current or past
harassment or retaliation or fear of that happening in the future, or
because of concerns about unwanted attention from government officials
or other authority figures.  As much as possible, we want to welcome
contributions from anyone who is willing to participate positively in
our community without having them worry about their safety or privacy.

In all of these cases, we should allow people to proceed using a
preferred name or pseudonymously if, in their best judgment, that's the
right thing to do.  State that it is common to use a real name but
explicitly mention that contributors who are not comfortable doing so or
prefer to operate pseudonymously or under a preferred name can proceed
otherwise, provided the name is distinctive, identifying, and not
misleading.  For instance, using U+2060 (WORD JOINER) as one's ID would
likely be distinctive but not identifying, since most people would have
trouble reading it due to its zero-width nature.

We prohibit identities which are misleading, since our goal is to create
a community which works together with a common goal, and misleading or
deceiving others is not conducive to good community or compatible with
our code of conduct, nor is it compatible with making a legal assertion
about the provenance of one's code.

Explicitly prohibit anonymous contributions to ensure that we have some
line of provenance to a known (if pseudonymous) author who might be able
to respond to questions about it.  Explain that this is the reason we
have this policy to help contributors understand the rationale better.

Use "some form of your real name" since some current contributors use
shortened forms of their name or use initials, which have always been
considered acceptable.  This helps guide people who would be fine using
their real name but have misconfigured `user.name` thinking it is
intended to be a username or is used for authentication (despite our
documentation to the contrary), but also allows for a variety of
circumstances where the contributor would feel more comfortable not
doing so.

Note that this policy is the same as that of the Linux kernel[0] and the
CNCF[1], as well as many smaller projects.  The Linux kernel patch was
Acked-by one of the Linux Foundation's lawyers, Michael Dolan, so it
appears these changes have had legal review.

Additionally, retain the section header ID for ease of linking across
versions.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4563201f33a022fc0353033d9dfeb1606a88330
[1] https://github.com/cncf/foundation/blob/659fd32c86dc/dco-guidelines.md

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-16 07:35:45 -07:00
Junio C Hamano 32571a0222 The tenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-15 15:18:18 -07:00
Junio C Hamano 51b50c55a9 Merge branch 'ps/object-store'
Code clean-up around object access API.

* ps/object-store:
  odb: rename `read_object_with_reference()`
  odb: rename `pretend_object_file()`
  odb: rename `has_object()`
  odb: rename `repo_read_object_file()`
  odb: rename `oid_object_info()`
  odb: trivial refactorings to get rid of `the_repository`
  odb: get rid of `the_repository` when handling submodule sources
  odb: get rid of `the_repository` when handling the primary source
  odb: get rid of `the_repository` in `for_each()` functions
  odb: get rid of `the_repository` when handling alternates
  odb: get rid of `the_repository` in `odb_mkstemp()`
  odb: get rid of `the_repository` in `assert_oid_type()`
  odb: get rid of `the_repository` in `find_odb()`
  odb: introduce parent pointers
  object-store: rename files to "odb.{c,h}"
  object-store: rename `object_directory` to `odb_source`
  object-store: rename `raw_object_store` to `object_database`
2025-07-15 15:18:18 -07:00
Karthik Nayak dabecb9db2 for-each-ref: introduce a '--start-after' option
The `git-for-each-ref(1)` command is used to iterate over references
present in a repository. In large repositories with millions of
references, it would be optimal to paginate this output such that we
can start iteration from a given reference. This would avoid having to
iterate over all references from the beginning each time when paginating
through results.

The previous commit added 'seek' functionality to the reference
backends. Utilize this and expose a '--start-after' option in
'git-for-each-ref(1)'. When used, the reference iteration seeks to the
lexicographically next reference and iterates from there onward.

This enables efficient pagination workflows, where the calling script
can remember the last provided reference and use that as the starting
point for the next set of references:
    git for-each-ref --count=100
    git for-each-ref --count=100 --start-after=refs/heads/branch-100
    git for-each-ref --count=100 --start-after=refs/heads/branch-200

Since the reference iterators only allow seeking to a specified marker
via the `ref_iterator_seek()`, we introduce a helper function
`start_ref_iterator_after()`, which seeks to next reference by simply
adding (char) 1 to the marker.

We must note that pagination always continues from the provided marker,
as such any concurrent reference updates lexicographically behind the
marker will not be output. Document the same.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-07-15 11:54:20 -07:00