]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
3 weeks agoMerge branch 'ne/alloc-free-and-null' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:35 +0000 (10:42 -0700)] 
Merge branch 'ne/alloc-free-and-null' into next

The clear_alloc_state() API function was not fully clearing the
structure for reuse, but since nobody reuses it, replace it with a
variant that frees the structure as well, making the callers simpler.

* ne/alloc-free-and-null:
  alloc: fix dangling pointer in alloc_state cleanup

3 weeks agoMerge branch 'jk/curl-global-trace-components' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:35 +0000 (10:42 -0700)] 
Merge branch 'jk/curl-global-trace-components' into next

Adjust to the way newer versions of cURL selectivel enables tracing
options, so that our tests can continue to work.

* jk/curl-global-trace-components:
  curl: add support for curl_global_trace() components

3 weeks agoMerge branch 'ag/doc-sendmail-gmail-example-update' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:34 +0000 (10:42 -0700)] 
Merge branch 'ag/doc-sendmail-gmail-example-update' into next

Doc update.

* ag/doc-sendmail-gmail-example-update:
  docs: update sendmail docs to use more secure SMTP server for Gmail

3 weeks agoMerge branch 'kn/clang-format-bitfields' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:34 +0000 (10:42 -0700)] 
Merge branch 'kn/clang-format-bitfields' into next

CodingGuidelines now spells out how bitfields are to be written.

* kn/clang-format-bitfields:
  Documentation: note styling for bit fields

3 weeks agoMerge branch 'jc/longer-disambiguation-fix' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:34 +0000 (10:42 -0700)] 
Merge branch 'jc/longer-disambiguation-fix' into next

"git rev-parse --short" and friends failed to disambiguate two
objects with object names that share common prefix longer than 32
characters.

* jc/longer-disambiguation-fix:
  abbrev: allow extending beyond 32 chars to disambiguate

3 weeks agoMerge branch 'sg/line-log-boundary-fixes' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:33 +0000 (10:42 -0700)] 
Merge branch 'sg/line-log-boundary-fixes' into next

Fix for a corner case bug in "git log -L...".

* sg/line-log-boundary-fixes:
  line-log: show all line ranges touched by the same diff range
  line-log: fix assertion error

3 weeks agoMerge branch 'jc/doc-includeif-hasconfig-remote-url-fix' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:33 +0000 (10:42 -0700)] 
Merge branch 'jc/doc-includeif-hasconfig-remote-url-fix' into next

Doc mark-up fix.

* jc/doc-includeif-hasconfig-remote-url-fix:
  config: document includeIf conditions consistently

3 weeks agoMerge branch 'ag/send-email-imap-sent' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:32 +0000 (10:42 -0700)] 
Merge branch 'ag/send-email-imap-sent' into next

"git send-email" learned to drive "git imap-send" to store already
sent e-mails in an IMAP folder.

* ag/send-email-imap-sent:
  send-email: enable copying emails to an IMAP folder without actually sending them
  send-email: add ability to send a copy of sent emails to an IMAP folder

3 weeks agoMerge branch 'pw/3.0-commentchar-auto-deprecation' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:32 +0000 (10:42 -0700)] 
Merge branch 'pw/3.0-commentchar-auto-deprecation' into next

Proposes to deprecate "core.commentChar=auto" that attempts to
dynamically pick a suitable comment character, as it is too much
trouble to support for little benefit.

* pw/3.0-commentchar-auto-deprecation:
  commit: print advice when core.commentString=auto
  config: warn on core.commentString=auto
  breaking-changes: deprecate support for core.commentString=auto

3 weeks agoMerge branch 'kh/doc-fast-import-markup-fix' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:31 +0000 (10:42 -0700)] 
Merge branch 'kh/doc-fast-import-markup-fix' into next

Doc mark-up fix.

* kh/doc-fast-import-markup-fix:
  doc: fast-import: replace literal block with paragraph

3 weeks agoSync with 'master'
Junio C Hamano [Wed, 10 Sep 2025 21:51:31 +0000 (14:51 -0700)] 
Sync with 'master'

3 weeks agodoc: fast-import: replace literal block with paragraph
Kristoffer Haugsbakk [Mon, 8 Sep 2025 20:28:45 +0000 (22:28 +0200)] 
doc: fast-import: replace literal block with paragraph

68061e34702 (fast-import: disallow "feature export-marks" by default,
2019-08-29) added the documentation for this option.  The second
paragraph is a literal block but it looks like it should just be
a regular paragraph.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoMerge branch 'master' of https://github.com/j6t/git-gui
Junio C Hamano [Wed, 10 Sep 2025 21:28:23 +0000 (14:28 -0700)] 
Merge branch 'master' of https://github.com/j6t/git-gui

* 'master' of https://github.com/j6t/git-gui:
  git-gui: sync Makefiles with git.git
  git-gui: fix error handling of Revert Changes command
  git-gui--askyesno (mingw): use Git for Windows' icon, if available
  git-gui--askyesno: allow overriding the window title
  git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
  git-gui: provide question helper for retry fallback on Windows
  git-gui: simplify using nice(1)
  git-gui: simplify PATH de-duplication

3 weeks agoMerge branch 'master' of https://github.com/j6t/gitk
Junio C Hamano [Wed, 10 Sep 2025 21:27:52 +0000 (14:27 -0700)] 
Merge branch 'master' of https://github.com/j6t/gitk

* 'master' of https://github.com/j6t/gitk:
  gitk: add README with usage, build, and contribution details
  gitk: fix trackpad scrolling for Tcl/Tk 8.7+
  gitk: use <Button-3> for ctx menus on macOS with Tcl 8.7+

3 weeks agoMerge branch 'mm/worktree-doc-typofix' into next
Junio C Hamano [Tue, 9 Sep 2025 21:58:43 +0000 (14:58 -0700)] 
Merge branch 'mm/worktree-doc-typofix' into next

Docfix.

* mm/worktree-doc-typofix:
  docs: fix typo in worktree.adoc 'extension'

3 weeks agoSync with master
Junio C Hamano [Mon, 8 Sep 2025 22:25:01 +0000 (15:25 -0700)] 
Sync with master

3 weeks agoMerge branch 'rs/object-name-extend-abbrev-len-update' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:43 +0000 (15:24 -0700)] 
Merge branch 'rs/object-name-extend-abbrev-len-update' into next

Code clean-up.

* rs/object-name-extend-abbrev-len-update:
  object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter

3 weeks agoMerge branch 'ps/upload-pack-oom-protection' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:43 +0000 (15:24 -0700)] 
Merge branch 'ps/upload-pack-oom-protection' into next

* ps/upload-pack-oom-protection:
  upload-pack: don't ACK non-commits repeatedly in protocol v2
  t5530: modernize tests

3 weeks agoMerge branch 'ds/midx-write-fixes' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:42 +0000 (15:24 -0700)] 
Merge branch 'ds/midx-write-fixes' into next

Fixes multiple crashes around midx write-out codepaths.

* ds/midx-write-fixes:
  midx-write: simplify error cases
  midx-write: reenable signed comparison errors
  midx-write: use uint32_t for preferred_pack_idx
  midx-write: use cleanup when incremental midx fails
  midx-write: put failing response value back
  midx-write: only load initialized packs

3 weeks agoMerge branch 'lo/repo-info-step-2' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:41 +0000 (15:24 -0700)] 
Merge branch 'lo/repo-info-step-2' into next

"repo info" learns a short-hand option "-z" that is the same as
"--format=nul", and learns to report the objects format used in the
repository.

* lo/repo-info-step-2:
  repo: add the field objects.format
  repo: add the flag -z as an alias for --format=nul

3 weeks agoMerge branch 'jt/de-global-bulk-checkin' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:40 +0000 (15:24 -0700)] 
Merge branch 'jt/de-global-bulk-checkin' into next

The bulk-checkin code used to depend on a file-scope static
singleton variable, which has been updated to pass an instance
throughout the callchain.

* jt/de-global-bulk-checkin:
  bulk-checkin: use repository variable from transaction
  bulk-checkin: require transaction for index_blob_bulk_checkin()
  bulk-checkin: remove global transaction state
  bulk-checkin: introduce object database transaction structure

3 weeks agoThe seventh batch
Junio C Hamano [Mon, 8 Sep 2025 21:54:20 +0000 (14:54 -0700)] 
The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoMerge branch 'tc/last-modified'
Junio C Hamano [Mon, 8 Sep 2025 21:54:35 +0000 (14:54 -0700)] 
Merge branch 'tc/last-modified'

A new command "git last-modified" has been added to show the closest
ancestor commit that touched each path.

* tc/last-modified:
  last-modified: use Bloom filters when available
  t/perf: add last-modified perf script
  last-modified: new subcommand to show when files were last modified

3 weeks agoMerge branch 'ds/ls-files-lazy-unsparse'
Junio C Hamano [Mon, 8 Sep 2025 21:54:34 +0000 (14:54 -0700)] 
Merge branch 'ds/ls-files-lazy-unsparse'

"git ls-files <pathspec>..." should not necessarily have to expand
the index fully if a sparsified directory is excluded by the
pathspec; the code is taught to expand the index on demand to avoid
this.

* ds/ls-files-lazy-unsparse:
  ls-files: conditionally leave index sparse

3 weeks agoMerge branch 'ds/path-walk-repack-fix'
Junio C Hamano [Mon, 8 Sep 2025 21:54:34 +0000 (14:54 -0700)] 
Merge branch 'ds/path-walk-repack-fix'

"git repack --path-walk" lost objects in some corner cases, which
has been corrected.

* ds/path-walk-repack-fix:
  path-walk: create initializer for path lists
  path-walk: fix setup of pending objects

3 weeks agoMerge branch 'am/xdiff-hash-tweak'
Junio C Hamano [Mon, 8 Sep 2025 21:54:34 +0000 (14:54 -0700)] 
Merge branch 'am/xdiff-hash-tweak'

Inspired by Ezekiel's recent effort to showcase Rust interface, the
hash function implementation used to hash lines have been updated
to the one used for ELF symbol lookup by Glibc.

* am/xdiff-hash-tweak:
  xdiff: optimize xdl_hash_record_verbatim
  xdiff: refactor xdl_hash_record()

3 weeks agoMerge branch 'da/cargo-serialize'
Junio C Hamano [Mon, 8 Sep 2025 21:54:33 +0000 (14:54 -0700)] 
Merge branch 'da/cargo-serialize'

Makefile tried to run multiple "cargo build" which would not work
very well; serialize their execution to work it around.

* da/cargo-serialize:
  Makefile: build libgit-rs and libgit-sys serially

4 weeks agogit-gui: sync Makefiles with git.git
Adam Dinwoodie [Sat, 15 Feb 2025 21:19:03 +0000 (21:19 +0000)] 
git-gui: sync Makefiles with git.git

In git.git, commit 5309c1e9fb39 (Makefile: set default goals in
makefiles, 2025-02-15) touched two Makefiles in the git-git/ directory.
Import these changes, so that the trees can converge again with the
next merge of this repository into git.git.

Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
4 weeks agoMerge branch 'ml/misc-simplifications'
Johannes Sixt [Sat, 6 Sep 2025 09:59:19 +0000 (11:59 +0200)] 
Merge branch 'ml/misc-simplifications'

* ml/misc-simplifications:
  git-gui: simplify using nice(1)
  git-gui: simplify PATH de-duplication

4 weeks agoMerge branch 'js/ask-yesno'
Johannes Sixt [Sat, 6 Sep 2025 09:59:09 +0000 (11:59 +0200)] 
Merge branch 'js/ask-yesno'

* js/ask-yesno:
  git-gui--askyesno (mingw): use Git for Windows' icon, if available
  git-gui--askyesno: allow overriding the window title
  git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
  git-gui: provide question helper for retry fallback on Windows

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
4 weeks agoupload-pack: don't ACK non-commits repeatedly in protocol v2
Patrick Steinhardt [Fri, 5 Sep 2025 06:18:02 +0000 (08:18 +0200)] 
upload-pack: don't ACK non-commits repeatedly in protocol v2

When a client performs a fetch or clone they can optionally send "have"
lines to tell the server which objects they already have available
locally. These object IDs are stored by the server in an object array so
that it can remember any objects it doesn't have to include in the pack
sent to the client.

While there isn't any reason to do so, clients are free to send the same
"have" line repeatedly. git-upload-pack(1) already knows to handle this
well: every commit it has seen via a "have" line gets marked with the
`THEY_HAVE` flag, and if such a commit is seen repeatedly we know to not
process it another time. This also has the effect that we only store the
object ID once, only, in the `have_obj` array.

There is an edge case though: if the client sends an object ID that does
not refer to a commit we neither store nor check the `THEY_HAVE` flag.
This means that we repeatedly store the same object ID in our `have_obj`
array, with two consequences:

  - In protocol v2 we deduplicate ACKs for commits, but not for any
    other objects as we send ACKs for every object ID in the `have_obj`
    array.

  - The `have_obj` array can grow in size indefinitely with both
    protocols.

The potentially-more-serious issue is the second one, as we basically
have a way for an adversary to allocate arbitrarily large buffers now.
Ultimately, this doesn't seem to be all that serious though: on my
machine, the growth of that array is at around 4MB/s, and after roughly
five minutes I was only at 1GB RSS. So this is concerning, but only
mildly so.

Fix this bug by storing the `THEY_HAVE` flag independent of the object
type so that we don't store duplicate object IDs in `have_obj` anymore.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agot5530: modernize tests
Patrick Steinhardt [Fri, 5 Sep 2025 06:18:01 +0000 (08:18 +0200)] 
t5530: modernize tests

Refactor tests to follow modern best practices:

  - Merge together tests that set up and verify a single use case.

  - Drop empty newlines at the beginning and end of test bodies.

  - Don't change directories in the main test body.

  - Remove an unused `D` variable.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agomidx-write: simplify error cases
Derrick Stolee [Fri, 5 Sep 2025 19:26:18 +0000 (19:26 +0000)] 
midx-write: simplify error cases

The write_midx_internal() method uses gotos to jump to a cleanup section to
clear memory before returning 'result'. Since these jumps are more common
for error conditions, initialize 'result' to -1 and then only set it to 0
before returning with success. There are a couple places where we return
with success via a jump.

This has the added benefit that the method now returns -1 on error instead
of an inconsistent 1 or -1.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agomidx-write: reenable signed comparison errors
Derrick Stolee [Fri, 5 Sep 2025 19:26:17 +0000 (19:26 +0000)] 
midx-write: reenable signed comparison errors

Remove the remaining signed comparison warnings in midx-write.c so that
they can be enforced as errors in the future. After the previous change,
the remaining errors are due to iterator variables named 'i'.

The strategy here involves defining the variable within the for loop
syntax to make sure we use the appropriate bitness for the loop
sentinel. This matters in at least one method where the variable was
compared to uint32_t in some loops and size_t in others.

While adjusting these loops, there were some where the loop boundary was
checking against a uint32_t value _plus one_. These were replaced with
non-strict comparisons, but also the value is checked to not be
UINT32_MAX. Since the value is the number of incremental multi-pack-
indexes, this is not a meaningful restriction. The new die() is about
defensive programming more than it being realistically possible.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agomidx-write: use uint32_t for preferred_pack_idx
Derrick Stolee [Fri, 5 Sep 2025 19:26:16 +0000 (19:26 +0000)] 
midx-write: use uint32_t for preferred_pack_idx

midx-write.c has the DISABLE_SIGN_COMPARE_WARNINGS macro defined for a
few reasons, but the biggest one is the use of a signed
preferred_pack_idx member inside the write_midx_context struct. The code
currently uses -1 to indicate an unset preferred pack but pack int ids
are normally handled as uint32_t. There are also a few loops that search
for the preferred pack by name and those iterators will need updates to
uint32_t in the next change.

For now, replace the use of -1 with a 'NO_PREFERRED_PACK' macro and an
equality check. The macro stores the max value of a uint32_t, so we
cannot store a preferred pack that appears last in a list of 2^32 total
packs, but that's expected to be unreasonable already. Furthermore, with
this change we end up extending the range from 2^31 possible packs to
2^32-1.

There are some careful things to worry about with initializing the
preferred pack in the struct and using that value when searching for a
preferred pack that was already incorrect but accidentally working when
the index was initialized to zero.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agomidx-write: use cleanup when incremental midx fails
Derrick Stolee [Fri, 5 Sep 2025 19:26:15 +0000 (19:26 +0000)] 
midx-write: use cleanup when incremental midx fails

The incremental mode of writing a multi-pack-index has a few extra
conditions that could lead to failure, but these are currently
short-ciruiting with 'return -1' instead of setting the method's
'result' variable and going to the cleanup tag.

Replace these returns with gotos to avoid memory issues when exiting
early due to error conditions.

Unfortunately, these error conditions are difficult to reproduce with
test cases, which is perhaps one reason why the memory loss was not
caught by existing test cases in memory tracking modes.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agomidx-write: put failing response value back
Derrick Stolee [Fri, 5 Sep 2025 19:26:14 +0000 (19:26 +0000)] 
midx-write: put failing response value back

This instance of setting the result to 1 before going to cleanup was
accidentally removed in fcb2205b77 (midx: implement support for writing
incremental MIDX chains, 2024-08-06). Build upon a test that already deletes
a packfile to verify that this error propagates to full command failure.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agomidx-write: only load initialized packs
Derrick Stolee [Fri, 5 Sep 2025 19:26:13 +0000 (19:26 +0000)] 
midx-write: only load initialized packs

The fill_packs_from_midx() method was refactored in fcb2205b77 (midx:
implement support for writing incremental MIDX chains, 2024-08-06) to
allow for preferred packfiles and incremental multi-pack-indexes.
However, this led to some conditions that can cause improperly
initialized memory in the context's list of packfiles.

The conditions caring about the preferred pack name or the incremental
flag are currently necessary to load a packfile. But the context is
still being populated with pack_info structs based on the packfile array
for the existing multi-pack-index even if prepare_midx_pack() isn't
called.

Add a new test that breaks under --stress when compiled with
SANITIZE=address. The chosen number of 100 packfiles was selected to get
the --stress output to fail about 50% of the time, while 50 packfiles
could not get a failure in most --stress runs.

The test case is marked as EXPENSIVE not only because of the number of
packfiles it creates, but because some CI environments were reporting
errors during the test that I could not reproduce, specifically around
being unable to open the packfiles or their pack-indexes.

When it fails under SANITIZE=address, it provides the following error:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==3263517==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000027
==3263517==The signal is caused by a READ memory access.
==3263517==Hint: address points to the zero page.
    #0 0x562d5d82d1fb in close_pack_windows packfile.c:299
    #1 0x562d5d82d3ab in close_pack packfile.c:354
    #2 0x562d5d7bfdb4 in write_midx_internal midx-write.c:1490
    #3 0x562d5d7c7aec in midx_repack midx-write.c:1795
    #4 0x562d5d46fff6 in cmd_multi_pack_index builtin/multi-pack-index.c:305
    ...

This failure stack trace is disconnected from the real fix because the bad
pointers are accessed later when closing the packfiles from the context.

There are a few different aspects to this fix that are worth noting:

 1. We return to the previous behavior of fill_packs_from_midx to not
    rely on the incremental flag or existence of a preferred pack.

 2. The behavior to scan all layers of an incremental midx is kept, so
    this is not a full revert of the change.

 3. We skip allocating more room in the pack_info array if the pack
    fails prepare_midx_pack().

 4. The method has always returned 0 for success and 1 for failure, but
    the condition checking for error added a check for a negative result
    for failure, so that is now updated.

 5. The call to open_pack_index() is removed, but this is needed later
    in the case of a preferred pack. That call is moved to immediately
    before its result is needed (checking for the object count).

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agoalloc: fix dangling pointer in alloc_state cleanup
ノウラ | Flare [Thu, 4 Sep 2025 17:44:16 +0000 (17:44 +0000)] 
alloc: fix dangling pointer in alloc_state cleanup

All callers of clear_alloc_state() immediately free what they
cleared, so currently it does not hurt anybody that the
alloc_state is left in an unreusable state, but it is an
error-prone API. Replace it with a new function that clears but
in addition frees the structure, as well as NULLing the pointer
that points at it and adjust existing callers.

As it is a moral equivalent of FREE_AND_NULL(), except that what it
frees has internal structure that needs to be cleaned, allow the
helper to be called twice in a row, by making a call with a pointer
to a pointer variable that already is NULLed.

While at it, rename allocate_alloc_state() and name the new
function alloc_state_free_and_null(), to follow more closely the
function naming convention specified in the CodingGuidelines
(namely, functions about S are named with S_ prefix and then
verb).

Signed-off-by: ノウラ | Flare <nouraellm@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agoobject-name: declare pointer type of extend_abbrev_len()'s 2nd parameter
René Scharfe [Thu, 4 Sep 2025 17:58:25 +0000 (19:58 +0200)] 
object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter

Expose the expected type of the second parameter of extend_abbrev_len()
instead of casting a void pointer internally.  Just a single caller
passes in a void pointer, the rest pass the correct type.  Let the
compiler help keeping it that way.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agorepo: add the field objects.format
Lucas Seiki Oshiro [Thu, 4 Sep 2025 13:40:17 +0000 (10:40 -0300)] 
repo: add the field objects.format

The flag `--show-object-format` from git-rev-parse is used for
retrieving the object storage format. This way, it is used for
querying repository metadata, fitting in the purpose of git-repo-info.

Add a new field `objects.format` to the git-repo-info subcommand
containing that information.

Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Mentored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agorepo: add the flag -z as an alias for --format=nul
Lucas Seiki Oshiro [Thu, 4 Sep 2025 13:40:16 +0000 (10:40 -0300)] 
repo: add the flag -z as an alias for --format=nul

Other Git commands that have nul-terminated output (e.g. git-config,
git-status, git-ls-files) have a flag `-z` for using the null character
as the record separator.

Add the `-z` flag to git-repo-info as an alias for `--format=nul`,
making it consistent with the behavior of the other commands.

Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Mentored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agoMerge branch 'rs/describe-with-lazy-queue-and-oidset' into next
Junio C Hamano [Thu, 4 Sep 2025 16:01:03 +0000 (09:01 -0700)] 
Merge branch 'rs/describe-with-lazy-queue-and-oidset' into next

Instead of scanning for the remaining items to see if there are
still commits to be explored in the queue, use khash to remember
which items are still on the queue (an unacceptable alternative is
to reserve one object flag bits).

* rs/describe-with-lazy-queue-and-oidset:
  describe: use oidset in finish_depth_computation()

4 weeks agoMerge branch 'tc/t0450-harden' into next
Junio C Hamano [Thu, 4 Sep 2025 16:01:03 +0000 (09:01 -0700)] 
Merge branch 'tc/t0450-harden' into next

Test updates.

* tc/t0450-harden:
  t0450: add allowlist for builtins with missing .adoc
  t0450: fix test for out-of-tree builds

4 weeks agoMerge branch 'kh/doc-markup-fixes' into next
Junio C Hamano [Wed, 3 Sep 2025 21:54:38 +0000 (14:54 -0700)] 
Merge branch 'kh/doc-markup-fixes' into next

Doc markup fixes.

* kh/doc-markup-fixes:
  doc: remove extra backtick for inline-verbatim
  doc: add missing backtick for inline-verbatim

4 weeks agoMerge branch 'km/alias-doc-markup-fix' into next
Junio C Hamano [Wed, 3 Sep 2025 21:54:38 +0000 (14:54 -0700)] 
Merge branch 'km/alias-doc-markup-fix' into next

Docfix.

* km/alias-doc-markup-fix:
  doc: fix formatting of function-wrap shell alias

4 weeks agoMerge branch 'ps/gitlab-ci-disable-windows-monitoring' into next
Junio C Hamano [Wed, 3 Sep 2025 21:54:38 +0000 (14:54 -0700)] 
Merge branch 'ps/gitlab-ci-disable-windows-monitoring' into next

Windows "real-time monitoring" interferes with the execution of
tests and affects negatively in both correctness and performance,
which has been disabled in Gitlab CI.

* ps/gitlab-ci-disable-windows-monitoring:
  gitlab-ci: disable realtime monitoring to unbreak Windows jobs

4 weeks agoMerge branch 'ms/refs-exists' into next
Junio C Hamano [Wed, 3 Sep 2025 21:54:37 +0000 (14:54 -0700)] 
Merge branch 'ms/refs-exists' into next

"git refs exists" that works like "git show-ref --exists" has been
added.

* ms/refs-exists:
  t: add test for git refs exists subcommand
  t1422: refactor tests to be shareable
  t1403: split 'show-ref --exists' tests into a separate file
  builtin/refs: add 'exists' subcommand

4 weeks agoMerge branch 'ps/object-store-midx-dedup-info' into next
Junio C Hamano [Wed, 3 Sep 2025 21:54:36 +0000 (14:54 -0700)] 
Merge branch 'ps/object-store-midx-dedup-info' into next

Further code clean-up for multi-pack-index code paths.

* ps/object-store-midx-dedup-info:
  midx: compute paths via their source
  midx: stop duplicating info redundant with its owning source
  midx: write multi-pack indices via their source
  midx: load multi-pack indices via their source
  midx: drop redundant `struct repository` parameter
  odb: simplify calling `link_alt_odb_entry()`
  odb: return newly created in-memory sources
  odb: consistently use "dir" to refer to alternate's directory
  odb: allow `odb_find_source()` to fail
  odb: store locality in object database sources

4 weeks agot0450: add allowlist for builtins with missing .adoc
Toon Claes [Fri, 8 Aug 2025 09:59:43 +0000 (11:59 +0200)] 
t0450: add allowlist for builtins with missing .adoc

Before we were silently skipping all builtins that don't have a matching
.adoc file. This is overly loose and might skip documentation files
when it shouldn't, for example when there was a typo in the filename.

To ensure no new builtins are added without documentation, add an
allowlist: t0450/adoc-missing. In this file only builtin commands that
do *not* have a corresponding .adoc file shall be listed. If there is a
mismatch, fail the test. This should force future contributions to
either add an .adoc, or add the builtin name to the allowlist file.

Signed-off-by: Toon Claes <toon@iotcl.com>
[jc: squashed Patrick's "missing file fix" in]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agodocs: fix typo in worktree.adoc 'extension'
Mikhail Malinouski [Wed, 3 Sep 2025 14:50:40 +0000 (14:50 +0000)] 
docs: fix typo in worktree.adoc 'extension'

The documentation incorrectly referred to the extension without an 's'.
This fixes the typo for clarity.

Signed-off-by: Mikhail Malinouski <m.l.malinouski@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agodescribe: use oidset in finish_depth_computation()
René Scharfe [Tue, 2 Sep 2025 18:24:52 +0000 (20:24 +0200)] 
describe: use oidset in finish_depth_computation()

Depth computation can end early if all remaining commits are flagged.
The current code determines if that's the case by checking all queue
items each time it dequeues a flagged commit.  This can cause
quadratic complexity.

We could simply count the flagged items in the queue and then update
that number as we add and remove items.  That would provide a general
speedup, but leave one case where we have to scan the whole queue: When
we flag a previously seen, but unflagged commit.  It could be on the
queue and then we'd have to decrease our count.

We could dedicate an object flag to track queue membership, but that
would leave less for candidate tags, affecting the results.  So use a
hash table, specifically an oidset of commit hashes, to track that.
This avoids quadratic behaviour in all cases and provides a nice
performance boost over the previous commit, 08bb69d70f (describe: use
prio_queue_replace(), 2025-08-03):

Benchmark 1: ./git_08bb69d70f describe $(git rev-list v2.41.0..v2.47.0)
  Time (mean ± σ):     855.3 ms ±   1.3 ms    [User: 790.8 ms, System: 49.9 ms]
  Range (min … max):   853.7 ms … 857.8 ms    10 runs

Benchmark 2: ./git describe $(git rev-list v2.41.0..v2.47.0)
  Time (mean ± σ):     610.8 ms ±   1.7 ms    [User: 546.9 ms, System: 49.3 ms]
  Range (min … max):   608.9 ms … 613.3 ms    10 runs

Summary
  ./git describe $(git rev-list v2.41.0..v2.47.0) ran
    1.40 ± 0.00 times faster than ./git_08bb69d70f describe $(git rev-list v2.41.0..v2.47.0)

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agodoc: remove extra backtick for inline-verbatim
Kristoffer Haugsbakk [Tue, 2 Sep 2025 20:35:47 +0000 (22:35 +0200)] 
doc: remove extra backtick for inline-verbatim

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agodoc: add missing backtick for inline-verbatim
Kristoffer Haugsbakk [Tue, 2 Sep 2025 20:35:46 +0000 (22:35 +0200)] 
doc: add missing backtick for inline-verbatim

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agot: add test for git refs exists subcommand
Meet Soni [Tue, 26 Aug 2025 06:41:10 +0000 (12:11 +0530)] 
t: add test for git refs exists subcommand

Add a test script, `t/t1462-refs-exists.sh`, for the `git refs exists`
command.

This script acts as a simple driver, leveraging the shared test library
created in the preceding commit. It works by overriding the
`$git_show_ref_exists` variable to "git refs exists" and then sourcing the
shared library (`t/show-ref-exists-tests.sh`).

This approach ensures that `git refs exists` is tested against the
entire comprehensive test suite of `git show-ref --exists`, verifying
that it acts as a compatible drop-in replacement.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agot1422: refactor tests to be shareable
Meet Soni [Tue, 26 Aug 2025 06:41:09 +0000 (12:11 +0530)] 
t1422: refactor tests to be shareable

In preparation for adding tests for the `git refs exists` command,
refactor the existing t1422 test suite to make its logic shareable.

Move the core test logic from `t1422-show-ref-exists.sh` to
`show-ref-exists-tests.sh` file. Inside this script, replace hardcoded
calls to "git show-ref --exists" with the `$git_show_ref_exists`
variable.

The original `t1422-show-ref-exists.sh` script now becomes a simple
"driver". It is responsible for setting the default value of the
variable and then sourcing the test library.

This structure follows an established pattern for sharing tests and
prepares the test suite for the `refs exists` tests to be added in a
subsequent commit.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agot1403: split 'show-ref --exists' tests into a separate file
Meet Soni [Tue, 26 Aug 2025 06:41:08 +0000 (12:11 +0530)] 
t1403: split 'show-ref --exists' tests into a separate file

The test file for git-show-ref(1), `t1403-show-ref.sh`, contains a group
of tests for the '--exists' flag. To improve organization and to prepare
for refactoring these tests to be shareable, move the '--exists' tests
and their corresponding setup logic into a self-contained test suite,
`t1422-show-ref-exists.sh`.

This is a pure code-movement refactoring with no change in test coverage
or behavior.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agobuiltin/refs: add 'exists' subcommand
Meet Soni [Tue, 26 Aug 2025 06:41:07 +0000 (12:11 +0530)] 
builtin/refs: add 'exists' subcommand

As part of the ongoing effort to consolidate reference handling,
introduce a new `exists` subcommand. This command provides the same
functionality and exit-code behavior as `git show-ref --exists`, serving
as its modern replacement.

The logic for `show-ref --exists` is minimal. Rather than creating a
shared helper function which would be overkill for ~20 lines of code,
its implementation is intentionally duplicated here. This contrasts with
`git refs list`, where sharing the larger implementation of
`for-each-ref` was necessary.

Documentation for the new subcommand is also added to the `git-refs(1)`
man page.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agogitlab-ci: disable realtime monitoring to unbreak Windows jobs
Patrick Steinhardt [Tue, 2 Sep 2025 10:47:41 +0000 (12:47 +0200)] 
gitlab-ci: disable realtime monitoring to unbreak Windows jobs

The GitLab CI runners using Windows machines have realtime monitoring
via Windows Defender enabled by default. This has just now started to
cause issues in our CI jobs using Microsoft Visual Studio:

    Program 'meson.exe' failed to run: Operation did not complete successfully because the file contains a virus or
    potentially unwanted softwareAt line:356 char:1
    + meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcre ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
    At line:356 char:1
    + meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcre ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
        + FullyQualifiedErrorId : NativeCommandFailed

The detected issue is more likely than not completely bogus, but it
breaks the jobs.

Fix the issue by disabling realtime monitoring. Besides unbreaking CI,
it also improves our build times a bit:

  - Building Git goes from 26 to 22 minutes.

  - Executing tests goes from ~1h for one slice of tests to ~30 minutes.

This is still painfully slow, but the issue here is that the Windows
runners on GitLab CI are quite underwhelming overall.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agodoc: fix formatting of function-wrap shell alias
Kyle E. Mitchell [Mon, 1 Sep 2025 18:04:18 +0000 (11:04 -0700)] 
doc: fix formatting of function-wrap shell alias

Add a missed backtick to the end of a code segment so that it will be
rendered like preceding examples.

I deeply appreciate the thoroughness of this documentation.  I noticed
the formatting discrepancy reading https://git-scm.com/docs/git-config.

Signed-off-by: Kyle E. Mitchell <kyle@kemitchell.com>
Acked-by: Jean-Noël AVILA <avila.jn@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agoSync with 'master'
Junio C Hamano [Tue, 2 Sep 2025 15:23:13 +0000 (08:23 -0700)] 
Sync with 'master'

4 weeks agoMerge branch 'je/doc-add' into next
Junio C Hamano [Tue, 2 Sep 2025 15:22:58 +0000 (08:22 -0700)] 
Merge branch 'je/doc-add' into next

Documentation for "git add" has been updated.

* je/doc-add:
  doc: rephrase the purpose of the staging area

4 weeks agoThe sixth batch
Junio C Hamano [Tue, 2 Sep 2025 15:20:31 +0000 (08:20 -0700)] 
The sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agoMerge branch 'ds/doc-ggg-pr-fork-clarify'
Junio C Hamano [Tue, 2 Sep 2025 15:21:27 +0000 (08:21 -0700)] 
Merge branch 'ds/doc-ggg-pr-fork-clarify'

Update the instruction to use of GGG in the MyFirstContribution
document to say that a GitHub PR could be made against `git/git`
instead of `gitgitgadget/git`.

* ds/doc-ggg-pr-fork-clarify:
  doc: clarify which remotes can be used with GitGitGadget

4 weeks agoMerge branch 'js/doc-sending-patch-via-thunderbird'
Junio C Hamano [Tue, 2 Sep 2025 15:21:26 +0000 (08:21 -0700)] 
Merge branch 'js/doc-sending-patch-via-thunderbird'

Doc update.

* js/doc-sending-patch-via-thunderbird:
  doc/format-patch: adjust Thunderbird MUA hint to new add-on

4 weeks agoMerge branch 'kh/doc-config-typofix'
Junio C Hamano [Tue, 2 Sep 2025 15:21:26 +0000 (08:21 -0700)] 
Merge branch 'kh/doc-config-typofix'

Documentation typofix.

* kh/doc-config-typofix:
  doc: config: replace backtick with apostrophe for possessive

4 weeks agoMerge branch 'kh/doc-interpret-trailers-markup-fix'
Junio C Hamano [Tue, 2 Sep 2025 15:21:25 +0000 (08:21 -0700)] 
Merge branch 'kh/doc-interpret-trailers-markup-fix'

Fix missing single-quote pairs in a documentation page.

* kh/doc-interpret-trailers-markup-fix:
  doc: interpret-trailers: close all pairs of single quotes

4 weeks agoMerge branch 'ja/asciidoc-doctor-verbatim-fixes'
Junio C Hamano [Tue, 2 Sep 2025 15:21:25 +0000 (08:21 -0700)] 
Merge branch 'ja/asciidoc-doctor-verbatim-fixes'

Doc mark-up fix.

* ja/asciidoc-doctor-verbatim-fixes:
  doc: fix asciidoc format compatibility in pretty-formats.adoc

4 weeks agogit-gui: fix error handling of Revert Changes command
Johannes Sixt [Mon, 1 Sep 2025 18:20:08 +0000 (20:20 +0200)] 
git-gui: fix error handling of Revert Changes command

The command Revert Changes has two different erroneous behaviors
depending on the Tcl version used.

The command uses a "chord" facility where different "notes" are
evaluated asynchronously and any error is reported after all of them
have finished. The intent is that a private namespace is used where
the notes can store the error state. Tcl 9 changed namespace handling
in a subtle way, as https://www.tcl-lang.org/software/tcltk/9.0.html
summarizes under "Notable incompatibilities":

    Unqualified varnames resolved in current namespace, not global.
    Note that in almost all cases where this causes a change, the
    change is actually the removal of a latent bug.

And that's exactly what happens here.

- Under Tcl 9:

  - When the command operates without any errors, the variable `err`
    is never set. When the error handler wants to inspect `err` (in
    the correct private namespace), it does not find it and a Tcl
    error about an unset variable occurs. Incidentally, this is also
    the case when the user cancels the operation with the option
    "Do Nothing"!

    On the other hand, when an error occurs during the operation, `err`
    is set and found as intended.

  Check for the existence of the variable `err` before the attempt to
  read it.

- Under Tcl 8.6:

  The error handler looks up `err` in the global namespace, which is
  bogus and unintended. The variable is set due to the many
  `catch ... err` that occur during startup in the global namespace.

  - When the command operates without any errors, the error handler
    finds the global `err`, which happens to be the empty string at
    this point, and no error is reported.

    On the other hand, when an error occurs during the operation, the
    global `err` is set and found, so that an error is reported as
    desired.

    However, the value of `err` persists in the global namespace. When
    the command is repeated, an error is reported again, even if there
    was actually no error, and even "Do Nothing" was used to cancel
    the operation.

  Clear the global `err` before the operation begins.

The lingering error message is not a problem under Tcl 9, because a
prestine namespace is established every time the command is used.

This fixes https://github.com/j6t/git-gui/issues/21.

Helped-by: Igor Stepushchik
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 weeks agoSync with 'master'
Junio C Hamano [Fri, 29 Aug 2025 17:24:03 +0000 (10:24 -0700)] 
Sync with 'master'

5 weeks agoMerge branch 'tc/last-modified' into next
Junio C Hamano [Fri, 29 Aug 2025 17:23:54 +0000 (10:23 -0700)] 
Merge branch 'tc/last-modified' into next

A new command "git last-modified" is proposed to show the closest
ancestor commit that touched each path.

* tc/last-modified:
  last-modified: use Bloom filters when available
  t/perf: add last-modified perf script
  last-modified: new subcommand to show when files were last modified

5 weeks agoMerge branch 'ds/ls-files-lazy-unsparse' into next
Junio C Hamano [Fri, 29 Aug 2025 17:23:53 +0000 (10:23 -0700)] 
Merge branch 'ds/ls-files-lazy-unsparse' into next

"git ls-files <pathspec>..." should not necessarily have to expand
the index fully if a sparsified directory is excluded by the
pathspec; the code is taught to expand the index on demand to avoid
this.

* ds/ls-files-lazy-unsparse:
  ls-files: conditionally leave index sparse

5 weeks agoMerge branch 'ds/path-walk-repack-fix' into next
Junio C Hamano [Fri, 29 Aug 2025 17:23:53 +0000 (10:23 -0700)] 
Merge branch 'ds/path-walk-repack-fix' into next

"git repack --path-walk" lost objects in some corner cases, which
has been corrected.

* ds/path-walk-repack-fix:
  path-walk: create initializer for path lists
  path-walk: fix setup of pending objects

5 weeks agoMerge branch 'am/xdiff-hash-tweak' into next
Junio C Hamano [Fri, 29 Aug 2025 17:23:53 +0000 (10:23 -0700)] 
Merge branch 'am/xdiff-hash-tweak' into next

Inspired by Ezekiel's recent effort to showcase Rust interface, the
hash function implementation used to hash lines have been updated
to the one used for ELF symbol lookup by Glibc.

* am/xdiff-hash-tweak:
  xdiff: optimize xdl_hash_record_verbatim
  xdiff: refactor xdl_hash_record()

5 weeks agoMerge branch 'da/cargo-serialize' into next
Junio C Hamano [Fri, 29 Aug 2025 17:23:52 +0000 (10:23 -0700)] 
Merge branch 'da/cargo-serialize' into next

Makefile tried to run multiple "cargo build" which would not work
very well; serialize their execution to work it around.

* da/cargo-serialize:
  Makefile: build libgit-rs and libgit-sys serially

5 weeks agodoc: rephrase the purpose of the staging area
Julia Evans [Fri, 29 Aug 2025 11:55:02 +0000 (11:55 +0000)] 
doc: rephrase the purpose of the staging area

Git does not really "store the contents of the next commit"
anywhere; rather, you the user use the index to prepare it.

Signed-off-by: Julia Evans <julia@jvns.ca>
[jc; made the change relative to what is already in 'next']
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoThe fifth batch
Junio C Hamano [Fri, 29 Aug 2025 16:43:39 +0000 (09:43 -0700)] 
The fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoMerge branch 'js/doc-gitk-history'
Junio C Hamano [Fri, 29 Aug 2025 16:44:38 +0000 (09:44 -0700)] 
Merge branch 'js/doc-gitk-history'

Manual page for "gitk" is updated with the current maintainer's
name.

* js/doc-gitk-history:
  doc/gitk: update reference to the external project

5 weeks agoMerge branch 'jk/describe-blob'
Junio C Hamano [Fri, 29 Aug 2025 16:44:37 +0000 (09:44 -0700)] 
Merge branch 'jk/describe-blob'

"git describe <blob>" misbehaves and/or crashes in some corner
cases, which has been taught to exit with failure gracefully.

* jk/describe-blob:
  describe: pass commit to describe_commit()
  describe: handle blob traversal with no commits
  describe: catch unborn branch in describe_blob()
  describe: error if blob not found
  describe: pass oid struct by const pointer

5 weeks agoMerge branch 'jk/no-clobber-dangling-symref-with-fetch'
Junio C Hamano [Fri, 29 Aug 2025 16:44:37 +0000 (09:44 -0700)] 
Merge branch 'jk/no-clobber-dangling-symref-with-fetch'

"git fetch" can clobber a symref that is dangling when the
remote-tracking HEAD is set to auto update, which has been
corrected.

* jk/no-clobber-dangling-symref-with-fetch:
  refs: do not clobber dangling symrefs
  t5510: prefer "git -C" to subshell for followRemoteHEAD tests
  t5510: stop changing top-level working directory
  t5510: make confusing config cleanup more explicit

5 weeks agoMerge branch 'ds/doc-community-discord'
Junio C Hamano [Fri, 29 Aug 2025 16:44:36 +0000 (09:44 -0700)] 
Merge branch 'ds/doc-community-discord'

Discord has been added to the first contribution documentation as
another way to ask for help.

* ds/doc-community-discord:
  doc: add discord to ways of getting help

5 weeks agoMerge branch 'ps/reftable-libgit2-cleanup'
Junio C Hamano [Fri, 29 Aug 2025 16:44:36 +0000 (09:44 -0700)] 
Merge branch 'ps/reftable-libgit2-cleanup'

Code clean-ups.

* ps/reftable-libgit2-cleanup:
  refs/reftable: always reload stacks when creating lock
  reftable: don't second-guess errors from flock interface
  reftable/stack: handle outdated stacks when compacting
  reftable/stack: allow passing flags to `reftable_stack_add()`
  reftable/stack: fix compiler warning due to missing braces
  reftable/stack: reorder code to avoid forward declarations
  reftable/writer: drop Git-specific `QSORT()` macro
  reftable/writer: fix type used for number of records

5 weeks agoMerge branch 'ad/t1517-short-help-tests-fix'
Junio C Hamano [Fri, 29 Aug 2025 16:44:35 +0000 (09:44 -0700)] 
Merge branch 'ad/t1517-short-help-tests-fix'

Test fix.

* ad/t1517-short-help-tests-fix:
  t/t1517: mark tests that fail with GIT_TEST_INSTALLED

5 weeks agolast-modified: use Bloom filters when available
Toon Claes [Tue, 5 Aug 2025 09:33:58 +0000 (11:33 +0200)] 
last-modified: use Bloom filters when available

Our 'git last-modified' performs a revision walk, and computes a diff at
each point in the walk to figure out whether a given revision changed
any of the paths it considers interesting.

When changed-path Bloom filters are available, we can avoid computing
many such diffs. Before computing a diff, we first check if any of the
remaining paths of interest were possibly changed at a given commit by
consulting its Bloom filter. If any of them are, we are resigned to
compute the diff.

If none of those queries returned "maybe", we know that the given commit
doesn't contain any changed paths which are interesting to us. So, we
can avoid computing it in this case.

Comparing the perf test results on git.git:

    Test                                        HEAD~             HEAD
    ------------------------------------------------------------------------------------
    8020.1: top-level last-modified             4.49(4.34+0.11)   2.22(2.05+0.09) -50.6%
    8020.2: top-level recursive last-modified   5.64(5.45+0.11)   5.62(5.30+0.11) -0.4%
    8020.3: subdir last-modified                0.11(0.06+0.04)   0.07(0.03+0.04) -36.4%

Based-on-patch-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agot/perf: add last-modified perf script
Toon Claes [Tue, 5 Aug 2025 09:33:57 +0000 (11:33 +0200)] 
t/perf: add last-modified perf script

This just runs some simple last-modified commands. We already test
correctness in the regular suite, so this is just about finding
performance regressions from one version to another.

Based-on-patch-by: Jeff King <peff@peff.net>
Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agolast-modified: new subcommand to show when files were last modified
Toon Claes [Tue, 5 Aug 2025 09:33:56 +0000 (11:33 +0200)] 
last-modified: new subcommand to show when files were last modified

Similar to git-blame(1), introduce a new subcommand
git-last-modified(1). This command shows the most recent modification to
paths in a tree. It does so by expanding the tree at a given commit,
taking note of the current state of each path, and then walking
backwards through history looking for commits where each path changed
into its final commit ID.

Based-on-patch-by: Jeff King <peff@peff.net>
Improved-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agogit-gui--askyesno (mingw): use Git for Windows' icon, if available
Johannes Schindelin [Thu, 28 Aug 2025 08:58:50 +0000 (08:58 +0000)] 
git-gui--askyesno (mingw): use Git for Windows' icon, if available

This provides a unified look-and-feel in Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 weeks agogit-gui--askyesno: allow overriding the window title
Johannes Schindelin [Thu, 28 Aug 2025 08:58:49 +0000 (08:58 +0000)] 
git-gui--askyesno: allow overriding the window title

"Question?" is maybe not the most informative thing to ask. In the
absence of better information, it is the best we can do, of course.

However, Git for Windows' auto updater just learned the trick to use
git-gui--askyesno to ask the user whether to update now or not. And in
this scripted scenario, we can easily pass a command-line option to
change the window title.

So let's support that with the new `--title <title>` option.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 weeks agogit gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Johannes Schindelin [Thu, 28 Aug 2025 08:58:48 +0000 (08:58 +0000)] 
git gui: set GIT_ASKPASS=git-gui--askpass if not set yet

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 weeks agogit-gui: provide question helper for retry fallback on Windows
Heiko Voigt [Thu, 28 Aug 2025 08:58:47 +0000 (08:58 +0000)] 
git-gui: provide question helper for retry fallback on Windows

Make use of the new environment variable GIT_ASK_YESNO to support the
recently implemented fallback in case unlink, rename or rmdir fail for
files in use on Windows. The added dialog will present a yes/no question
to the the user which will currently be used by the windows compat layer
to let the user retry a failed file operation.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 weeks agoSync with 'master'
Junio C Hamano [Thu, 28 Aug 2025 18:30:21 +0000 (11:30 -0700)] 
Sync with 'master'

5 weeks agoThe fourth batch
Junio C Hamano [Thu, 28 Aug 2025 18:28:26 +0000 (11:28 -0700)] 
The fourth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoMerge branch 'bc/doc-compat-object-format-not-working'
Junio C Hamano [Thu, 28 Aug 2025 18:28:58 +0000 (11:28 -0700)] 
Merge branch 'bc/doc-compat-object-format-not-working'

The compatObjectFormat extension is used to hide an incomplete
feature that is not yet usable for any purpose other than
developing the feature further.  Document it as such to discourage
its use by mere mortals.

* bc/doc-compat-object-format-not-working:
  docs: note that extensions.compatobjectformat is incomplete

5 weeks agoMerge branch 'jk/fetch-check-graph-objects-fix'
Junio C Hamano [Thu, 28 Aug 2025 18:28:58 +0000 (11:28 -0700)] 
Merge branch 'jk/fetch-check-graph-objects-fix'

Under a race against another process that is repacking the
repository, especially a partially cloned one, "git fetch" may
mistakenly think some objects we do have are missing, which has
been corrected.

* jk/fetch-check-graph-objects-fix:
  fetch-pack: re-scan when double-checking graph objects

5 weeks agoMerge branch 'sg/line-log-merge-optim'
Junio C Hamano [Thu, 28 Aug 2025 18:28:57 +0000 (11:28 -0700)] 
Merge branch 'sg/line-log-merge-optim'

"git log -L..." compared trees of multiple parents with the tree of the
merge result in an unnecessarily inefficient way.

* sg/line-log-merge-optim:
  line-log: simplify condition checking for merge commits
  line-log: initialize diff queue in process_ranges_ordinary_commit()
  line-log: get rid of the parents array in process_ranges_merge_commit()
  line-log: avoid unnecessary tree diffs when processing merge commits

5 weeks agoMerge branch 'js/progress-delay-fix'
Junio C Hamano [Thu, 28 Aug 2025 18:28:57 +0000 (11:28 -0700)] 
Merge branch 'js/progress-delay-fix'

The start_delayed_progress() function in the progress eye-candy API
did not clear its internal state, making an initial delay value
larger than 1 second ineffective, which has been corrected.

* js/progress-delay-fix:
  progress: pay attention to (customized) delay time

5 weeks agoMerge branch 'je/doc-rebase'
Junio C Hamano [Thu, 28 Aug 2025 18:28:57 +0000 (11:28 -0700)] 
Merge branch 'je/doc-rebase'

Documentation for "git rebase" has been updated.

* je/doc-rebase:
  doc: git-rebase: update discussion of internals
  doc: git-rebase: move --onto explanation down
  doc: git rebase: clarify arguments syntax
  doc: git rebase: dedup merge conflict discussion
  doc: git-rebase: start with an example

5 weeks agogitk: add README with usage, build, and contribution details
Michael Rappazzo [Wed, 27 Aug 2025 22:59:56 +0000 (18:59 -0400)] 
gitk: add README with usage, build, and contribution details

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 weeks agols-files: conditionally leave index sparse
Derrick Stolee [Fri, 15 Aug 2025 16:12:53 +0000 (16:12 +0000)] 
ls-files: conditionally leave index sparse

When running 'git ls-files' with a pathspec, the index entries get
filtered according to that pathspec before iterating over them in
show_files().  In 78087097b8 (ls-files: add --sparse option,
2021-12-22), this iteration was prefixed with a check for the '--sparse'
option which allows the command to output directory entries; this
created a pre-loop call to ensure_full_index().

However, when a user runs 'git ls-files' where the pathspec matches
directories that are recursively matched in the sparse-checkout, there
are not any sparse directories that match the pathspec so they would not
be written to the output. The expansion in this case is just a
performance drop for no behavior difference.

Replace this global check to expand the index with a check inside the
loop for a matched sparse directory. If we see one, then expand the
index and continue from the current location. This is safe since the
previous entries in the index did not have any sparse directories and
thus would remain stable in this expansion.

A test in t1092 confirms that this changes the behavior.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoMerge branch 'tk87-touchpad-scroll' of github.com:ZhongRuoyu/gitk
Johannes Sixt [Wed, 27 Aug 2025 18:52:35 +0000 (20:52 +0200)] 
Merge branch 'tk87-touchpad-scroll' of github.com:ZhongRuoyu/gitk

* 'tk87-touchpad-scroll' of github.com:ZhongRuoyu/gitk:
  gitk: fix trackpad scrolling for Tcl/Tk 8.7+

Signed-off-by: Johannes Sixt <j6t@kdbg.org>