]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 days agoGit 2.51-rc1 main master v2.51.0-rc1
Junio C Hamano [Thu, 7 Aug 2025 15:12:53 +0000 (08:12 -0700)] 
Git 2.51-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoDocumentation/RelNotes/2.51.0: improve wording for a couple entries
Patrick Steinhardt [Thu, 7 Aug 2025 05:09:25 +0000 (07:09 +0200)] 
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>
2 days agoMerge branch 'jt/archive-zip-deflate-fix'
Junio C Hamano [Thu, 7 Aug 2025 15:14:38 +0000 (08:14 -0700)] 
Merge branch 'jt/archive-zip-deflate-fix'

The deflate codepath in "git archive --format=zip" had a
longstanding bug coming from misuse of zlib API, which has been
corrected.

* jt/archive-zip-deflate-fix:
  archive: flush deflate stream until Z_STREAM_END

2 days agoMerge branch 'dl/squelch-maybe-uninitialized'
Junio C Hamano [Thu, 7 Aug 2025 15:14:38 +0000 (08:14 -0700)] 
Merge branch 'dl/squelch-maybe-uninitialized'

Squelch false-positive compiler warning.

* dl/squelch-maybe-uninitialized:
  t/unit-tests/clar: fix -Wmaybe-uninitialized with -Og
  remote: bail early from set_head() if missing remote name

2 days agoMerge branch 'jk/revert-squelch-compiler-warning'
Junio C Hamano [Thu, 7 Aug 2025 15:14:37 +0000 (08:14 -0700)] 
Merge branch 'jk/revert-squelch-compiler-warning'

Squelch false-positive compiler warning.

* jk/revert-squelch-compiler-warning:
  revert: initialize const value

4 days agoA bit more after -rc0
Junio C Hamano [Tue, 5 Aug 2025 18:53:34 +0000 (11:53 -0700)] 
A bit more after -rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 days agoMerge branch 'kj/renamed-submodule'
Junio C Hamano [Tue, 5 Aug 2025 18:53:56 +0000 (11:53 -0700)] 
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

4 days agoMerge branch 'rs/tighten-alias-help'
Junio C Hamano [Tue, 5 Aug 2025 18:53:55 +0000 (11:53 -0700)] 
Merge branch 'rs/tighten-alias-help'

"git -c alias.foo=bar foo -h baz" reported "'foo' is aliased to
'bar'" and then went on to run "git foo -h baz", which was
unexpected.  Tighten the rule so that alias expansion is reported
only when "-h" is the sole option.

* rs/tighten-alias-help:
  git: show alias info only with lone -h

4 days agoMerge branch 'ps/object-file-wo-the-repository'
Junio C Hamano [Tue, 5 Aug 2025 18:53:55 +0000 (11:53 -0700)] 
Merge branch 'ps/object-file-wo-the-repository'

Reduce implicit assumption and dependence on the_repository in the
object-file subsystem.

* ps/object-file-wo-the-repository:
  object-file: get rid of `the_repository` in index-related functions
  object-file: get rid of `the_repository` in `force_object_loose()`
  object-file: get rid of `the_repository` in `read_loose_object()`
  object-file: get rid of `the_repository` in loose object iterators
  object-file: remove declaration for `for_each_file_in_obj_subdir()`
  object-file: inline `for_each_loose_file_in_objdir_buf()`
  object-file: get rid of `the_repository` when writing objects
  odb: introduce `odb_write_object()`
  loose: write loose objects map via their source
  object-file: get rid of `the_repository` in `finalize_object_file()`
  object-file: get rid of `the_repository` in `loose_object_info()`
  object-file: get rid of `the_repository` when freshening objects
  object-file: inline `check_and_freshen()` functions
  object-file: get rid of `the_repository` in `has_loose_object()`
  object-file: stop using `the_hash_algo`
  object-file: fix -Wsign-compare warnings

4 days agot/unit-tests/clar: fix -Wmaybe-uninitialized with -Og
Denton Liu [Tue, 5 Aug 2025 05:31:16 +0000 (22:31 -0700)] 
t/unit-tests/clar: fix -Wmaybe-uninitialized with -Og

When building with -Og on gcc 15.1.1, the build produces a warning. In
practice, though, this cannot be hit because `exact` acts as a guard and
that variable can only be set after `matchlen` is already initialized

Assign a default value to `matchlen` so that the warning is silenced.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 days agoremote: bail early from set_head() if missing remote name
Jeff King [Tue, 5 Aug 2025 05:31:13 +0000 (22:31 -0700)] 
remote: bail early from set_head() if missing remote name

In "git remote set-head", we can take varying numbers of arguments
depending on whether we saw the "-d" or "-a" options. But the first
argument is always the remote name.

The current code is somewhat awkward in that it conditionally handles
the remote name up-front like this:

  if (argc)
     remote = ...from argv[0]...

and then only later decides to bail if we do not have the right number
of arguments for the options we saw.

This makes it hard to figure out if "remote" is always set when it needs
to be. Both for humans, but also for compilers; with -Og, gcc complains
that "remote" can be accessed without being initialized (although this
is not true, as we'd always die with a usage message in that case).

Let's instead enforce the presence of the remote argument up front,
which fixes the compiler warning and is easier to understand. It does
mean duplicating the code to print a usage message, but it's a single
line.

Noticed-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agoarchive: flush deflate stream until Z_STREAM_END
Justin Tobler [Sat, 2 Aug 2025 22:08:03 +0000 (17:08 -0500)] 
archive: flush deflate stream until Z_STREAM_END

In `archive-zip.c:write_zip_entry()` when using a stream as input for
deflating a file, the call to `git_deflate()` with Z_FINISH always
expects Z_STREAM_END to be returned. Per zlib documentation[1]:

        If the parameter flush is set to Z_FINISH, pending input is
        processed, pending output is flushed and deflate returns with
        Z_STREAM_END if there was enough output space. If deflate
        returns with Z_OK or Z_BUF_ERROR, this function must be called
        again with Z_FINISH and more output space (updated avail_out)
        but no more input data, until it returns with Z_STREAM_END or an
        error. After deflate has returned Z_STREAM_END, the only
        possible operations on the stream are deflateReset or
        deflateEnd.

In scenarios where the output buffer is not large enough to write all
the compressed data, it is perfectly valid for the underlying
`deflate()` to return Z_OK. Thus, expecting a single pass of `deflate()`
here to always return Z_STREAM_END is a bug. Update the code to flush
the deflate stream until Z_STREAM_END is returned.

[1]: https://zlib.net/manual.html

Helped-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agoMerge branch 'master' of https://github.com/j6t/git-gui
Junio C Hamano [Mon, 4 Aug 2025 18:45:23 +0000 (11:45 -0700)] 
Merge branch 'master' of https://github.com/j6t/git-gui

* 'master' of https://github.com/j6t/git-gui: (21 commits)
  git-gui: ensure own version of git-gui--askpass is used
  git-gui: Allow Tcl 9.0
  git-gui: use -profile tcl8 on encoding conversions
  git-gui: use -profile tcl8 for file input with Tcl 9
  git-gui: themed.tcl: use full namespace for color
  git-gui: remove EOL translation for gets
  git-gui: honor TCLTK_PATH in git-gui--askpass
  git-gui: retire Git Gui.app
  git-gui: fix dependency of GITGUI_MAIN on generator
  git-gui: remove uname_O in Makefile
  git-gui i18n: Remove the locations within the Bulgarian translation
  git-gui i18n: Update Bulgarian translation (557t)
  git-gui: do not mix -translation binary and -encoding
  git-gui: replace encoding binary with iso8859-1
  git-gui: translation binary defines iso8859-1
  git-gui: assure -eofchar {} on all channels
  git-gui: use /cmd/git-gui.exe for shortcut
  git-gui: Windows tk_getSaveFile is not useful for shortcuts
  git-gui: let nice work on Windows
  git-gui: do not add directories to PATH on Windows
  ...

5 days agoMerge branch 'master' of https://github.com/j6t/gitk
Junio C Hamano [Mon, 4 Aug 2025 18:44:30 +0000 (11:44 -0700)] 
Merge branch 'master' of https://github.com/j6t/gitk

* 'master' of https://github.com/j6t/gitk:
  gitk: Mention globs in description of preference to hide custom refs
  gitk: filter invisible upstream refs from reference list
  gitk: avoid duplicated upstream refs
  gitk i18n: Remove the locations within the Bulgarian translation
  gitk i18n: Update Bulgarian translation (322t)
  gitk: allow Tcl/Tk 9.0+
  gitk: use -profile tcl8 on encoding conversions
  gitk: use -profile tcl8 for file input with Tcl 9
  gitk: Tcl9 doesn't expand ~, use $env(HOME)
  gitk: switch to -translation binary
  gitk: update scrolling for TclTk 8.7+ / TIP 474
  gitk: restore ui colors after cancelling config dialog
  gitk: set config dialog color swatches in one place
  gitk: Add user preference to hide specific references

5 days agoMerge branch 'cb/no-tcl86-on-macos'
Johannes Sixt [Mon, 4 Aug 2025 16:27:03 +0000 (18:27 +0200)] 
Merge branch 'cb/no-tcl86-on-macos'

* cb/no-tcl86-on-macos:
  git-gui: ensure own version of git-gui--askpass is used
  git-gui: honor TCLTK_PATH in git-gui--askpass
  git-gui: retire Git Gui.app
  git-gui: fix dependency of GITGUI_MAIN on generator
  git-gui: remove uname_O in Makefile

5 days agogit-gui: ensure own version of git-gui--askpass is used
Carlo Marcelo Arenas Belón [Thu, 31 Jul 2025 08:06:28 +0000 (01:06 -0700)] 
git-gui: ensure own version of git-gui--askpass is used

When finding a location for the askpass helper, git will be asked
for its exec path, but if that git is not the same that called
git-gui then we might mistakenly point to its helper instead.

Assume that git-gui and the helper are colocated to derive its
path instead.

This is specially useful in macOS where a broken version of that
helper is provided by the system git.

[j6t: move directory to variable to help in-flight topics]

Suggested-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 days agoMerge branch 'docglobs' of github.com:ilyagr/gitk
Johannes Sixt [Mon, 4 Aug 2025 16:20:32 +0000 (18:20 +0200)] 
Merge branch 'docglobs' of github.com:ilyagr/gitk

* 'docglobs' of github.com:ilyagr/gitk:
  gitk: Mention globs in description of preference to hide custom refs

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
5 days agoGit 2.51-rc0 v2.51.0-rc0
Junio C Hamano [Mon, 4 Aug 2025 15:09:37 +0000 (08:09 -0700)] 
Git 2.51-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agoMerge branch 'jc/test-hashmap-is-still-here'
Junio C Hamano [Mon, 4 Aug 2025 15:10:36 +0000 (08:10 -0700)] 
Merge branch 'jc/test-hashmap-is-still-here'

Comment fix.

* jc/test-hashmap-is-still-here:
  test-hashmap: document why it is no longer used but still there

5 days agoMerge branch 'kh/doc-fast-import-historical'
Junio C Hamano [Mon, 4 Aug 2025 15:10:36 +0000 (08:10 -0700)] 
Merge branch 'kh/doc-fast-import-historical'

Doc update.

* kh/doc-fast-import-historical:
  doc: fast-import: contextualize the hardware cost

5 days agoMerge branch 'ms/meson-with-ancient-git-wo-ls-files-dedup'
Junio C Hamano [Mon, 4 Aug 2025 15:10:35 +0000 (08:10 -0700)] 
Merge branch 'ms/meson-with-ancient-git-wo-ls-files-dedup'

Build fix.

* ms/meson-with-ancient-git-wo-ls-files-dedup:
  meson: tolerate errors from git ls-files --deduplicate

5 days agoMerge branch 'jc/doc-release-vs-clear'
Junio C Hamano [Mon, 4 Aug 2025 15:10:35 +0000 (08:10 -0700)] 
Merge branch 'jc/doc-release-vs-clear'

Doc update.

* jc/doc-release-vs-clear:
  CodingGuidelines: clarify that S_release() does not reinitialize

5 days agoMerge branch 'ch/t7450-recursive-clone-test-fix'
Junio C Hamano [Mon, 4 Aug 2025 15:10:34 +0000 (08:10 -0700)] 
Merge branch 'ch/t7450-recursive-clone-test-fix'

Test fix.

* ch/t7450-recursive-clone-test-fix:
  t7450: inspect the correct path a broken code would write to

5 days agoMerge branch 'js/prompt-crlf-fix'
Junio C Hamano [Mon, 4 Aug 2025 15:10:34 +0000 (08:10 -0700)] 
Merge branch 'js/prompt-crlf-fix'

Interactive prompt code did not correctly strip CRLF from the end
of line on Windows.

* js/prompt-crlf-fix:
  interactive: do strip trailing CRLF from input

5 days agoMerge branch 'ps/meson-clar-decls-fix'
Junio C Hamano [Mon, 4 Aug 2025 15:10:34 +0000 (08:10 -0700)] 
Merge branch 'ps/meson-clar-decls-fix'

Build fix.

* ps/meson-clar-decls-fix:
  meson: ensure correct "clar-decls.h" header is used

5 days agoMerge branch 'js/mingw-fixes'
Junio C Hamano [Mon, 4 Aug 2025 15:10:33 +0000 (08:10 -0700)] 
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

5 days agoMerge branch 'lm/add-p-context'
Junio C Hamano [Mon, 4 Aug 2025 15:10:33 +0000 (08:10 -0700)] 
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

5 days agoMerge branch 'ps/config-wo-the-repository'
Junio C Hamano [Mon, 4 Aug 2025 15:10:32 +0000 (08:10 -0700)] 
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
  ...

5 days agoMerge branch 'kn/for-each-ref-skip-updates'
Junio C Hamano [Mon, 4 Aug 2025 15:10:32 +0000 (08:10 -0700)] 
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

5 days agoMerge branch 'jt/switch-restore-no-longer-experimental'
Junio C Hamano [Mon, 4 Aug 2025 15:10:31 +0000 (08:10 -0700)] 
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

5 days agoMerge branch 'jb/t7510-gpg-program-path'
Junio C Hamano [Mon, 4 Aug 2025 15:10:31 +0000 (08:10 -0700)] 
Merge branch 'jb/t7510-gpg-program-path'

A new test to ensure that a recent change will keep working.

* jb/t7510-gpg-program-path:
  t7510: use $PWD instead of $(pwd) inside PATH
  t7510: add test cases for non-absolute gpg program

5 days agoMerge branch 'cc/t9350-cleanup'
Junio C Hamano [Mon, 4 Aug 2025 15:10:30 +0000 (08:10 -0700)] 
Merge branch 'cc/t9350-cleanup'

Test clean-up.

* cc/t9350-cleanup:
  t9350: redirect input to only fast-import

5 days agoMerge branch 'hy/blame-simplify-get-commit-info'
Junio C Hamano [Mon, 4 Aug 2025 15:10:30 +0000 (08:10 -0700)] 
Merge branch 'hy/blame-simplify-get-commit-info'

Code simplification.

* hy/blame-simplify-get-commit-info:
  blame: remove parameter detailed in get_commit_info()

5 days agorevert: initialize const value
Jeff King [Mon, 4 Aug 2025 13:00:11 +0000 (09:00 -0400)] 
revert: initialize const value

When building with clang-22 and DEVELOPER=1 mode, this warning causes us
to fail compilation:

  builtin/revert.c:114:13: error: default initialization of an object of type 'const char' leaves the object uninitialized [-Werror,-Wdefault-const-init-var-unsafe]
    114 |         const char sentinel_value;
        |                    ^

The compiler is right that this code is a bit funny. We declare a const
value without an initializer. It cannot be assigned to because of the
const, but without an initializer it has no predictable value. So as a
variable it can never have any useful function, and if we tried to look
at it, we'd get undefined behavior.

But it does have a function. We never use its value, but rather use its
address as a sentinel value for some other variables:

        const char *gpg_sign = &sentinel_value;

...maybe set gpg_sign via parse_options...

if (gpg_sign != &sentinel_value)
...we got a non-default value...

Normally we'd use NULL as a sentinel value for a pointer, but it doesn't
work here because we also want to detect --no-gpg-sign, which is marked
by setting the pointer to NULL. We need a separate "this was not
touched" value, which is what this sentinel variable gives us.

So the code is correct as-is, but the sentinel variable itself is funny
enough that it's understandable for a compiler warning to flag it. Let's
try to appease the compiler.

There are a few possible options:

  1. Instead of a variable, we could just construct an artificial
     sentinel address like "1", "-1", etc. I think these technically
     fall afoul of the C standard (even if we do not access them, even
     constructing invalid pointers is not always allowed). But it's also
     something we do elsewhere, and even happens in some standard
     interfaces (e.g., mmap()'s MMAP_FAILED value). It does involve some
     annoying casts, though.

  2. We can mark it as static. That gives it a definite value, but
     perhaps makes people wonder if the static-ness is important, when
     it's not.

  3. We can just give it a value to shut the compiler up, even though
     nobody cares about that value.

I went with (3) here as the smallest and most obvious change.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agogitk: Mention globs in description of preference to hide custom refs
Ilya Grigoriev [Sun, 3 Aug 2025 04:59:24 +0000 (21:59 -0700)] 
gitk: Mention globs in description of preference to hide custom refs

This clarifies that one has to enter e.g. `jj/keep/*` and not just
`jj/keep`.

Follows up on 2441e19.

Signed-off-by: Ilya Grigoriev <ilyagr@users.noreply.github.com>
5 days agoThe seventeenth batch, just before -rc0
Junio C Hamano [Mon, 4 Aug 2025 01:44:07 +0000 (18:44 -0700)] 
The seventeenth batch, just before -rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agoMerge branch 'hl/test-helper-fd-close'
Junio C Hamano [Mon, 4 Aug 2025 01:44:27 +0000 (18:44 -0700)] 
Merge branch 'hl/test-helper-fd-close'

A few file descriptors left unclosed upon program completion in a
few test helper programs are now closed.

* hl/test-helper-fd-close:
  test-delta: close output descriptor after use
  test-delta: use strbufs to hold input files
  test-delta: handle errors with die()
  t/helper/test-truncate: close file descriptor after truncation

5 days agoMerge branch 'ow/rebase-verify-insn-fmt-before-initializing-state'
Junio C Hamano [Mon, 4 Aug 2025 01:44:27 +0000 (18:44 -0700)] 
Merge branch 'ow/rebase-verify-insn-fmt-before-initializing-state'

"git rebase -i" with bogus rebase.instructionFormat configuration
failed to produce the todo file after recording the state files,
leading to confused "git status"; this has been corrected.

* ow/rebase-verify-insn-fmt-before-initializing-state:
  rebase: write script before initializing state

5 days agoMerge branch 'ps/object-store-midx'
Junio C Hamano [Mon, 4 Aug 2025 01:44:26 +0000 (18:44 -0700)] 
Merge branch 'ps/object-store-midx'

Redefine where the multi-pack-index sits in the object subsystem,
which recently was restructured to allow multiple backends that
support a single object source that belongs to one repository.  A
midx does span mulitple "object sources".

* ps/object-store-midx:
  midx: remove now-unused linked list of multi-pack indices
  packfile: stop using linked MIDX list in `get_all_packs()`
  packfile: stop using linked MIDX list in `find_pack_entry()`
  packfile: refactor `get_multi_pack_index()` to work on sources
  midx: stop using linked list when closing MIDX
  packfile: refactor `prepare_packed_git_one()` to work on sources
  midx: start tracking per object database source

5 days agoMerge branch 'kn/for-each-ref-skip'
Junio C Hamano [Mon, 4 Aug 2025 01:44:26 +0000 (18:44 -0700)] 
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'

5 days agomingw: support Windows Server 2016 again
Johannes Schindelin [Sun, 3 Aug 2025 21:25:18 +0000 (21:25 +0000)] 
mingw: support Windows Server 2016 again

It was reported to the Git for Windows project that a simple `git init`
fails on Windows Server 2016:

  D:\Dev\test> git init
  error: could not write config file D:/Dev/test/.git/config: Function not implemented
  fatal: could not set 'core.repositoryformatversion' to '0'

According to https://endoflife.date/windows-server, Windows Server 2016
is officially supported for another one-and-a-half years as of time of
writing, so this is not good.

The culprit is the `mingw_rename()` changes that try to use POSIX
semantics when available, but fail to fall back properly on Windows
Server 2016.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agomingw_rename: support ReFS on Windows 2022
Johannes Schindelin [Sun, 3 Aug 2025 21:25:17 +0000 (21:25 +0000)] 
mingw_rename: support ReFS on Windows 2022

ReFS is an alternative filesystem to NTFS. On Windows 2022, it seems not
to support the rename operation using POSIX semantics that Git uses on
Windows as of 391bceae4350 (compat/mingw: support POSIX semantics for
atomic renames, 2024-10-27).

However, Windows 2022 reports `ERROR_NOT_SUPPORTED` in this instance.
This is in contrast to `ERROR_INVALID_PARAMETER` (as previous Windows
versions would report that do not support POSIX semantics in renames at
all).

Let's handle both errors the same: by falling back to the best-effort
option, namely to rename without POSIX semantics.

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

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agomingw: drop Windows 7-specific work-around
Johannes Schindelin [Sun, 3 Aug 2025 21:25:16 +0000 (21:25 +0000)] 
mingw: drop Windows 7-specific work-around

In ac33519ddfa8 (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>
5 days agomingw_open_existing: handle directories better
Matthias Aßhauer [Sun, 3 Aug 2025 21:25:15 +0000 (21:25 +0000)] 
mingw_open_existing: handle directories better

CreateFileW() requires FILE_FLAG_BACKUP_SEMANTICS to create a directory
handle [1] and errors out with ERROR_ACCESS_DENIED without this flag.
Fall back to accessing Directory handles this way.

[1] https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#directories

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

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoMerge branch 'strip-post-hooks' of github.com:orgads/git-gui
Johannes Sixt [Sat, 2 Aug 2025 12:45:19 +0000 (14:45 +0200)] 
Merge branch 'strip-post-hooks' of github.com:orgads/git-gui

* 'strip-post-hooks' of github.com:orgads/git-gui:
  git-gui: strip the commit message after running commit-msg hook

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
7 days agoMerge branch 'ml/tcl90'
Johannes Sixt [Sat, 2 Aug 2025 12:43:25 +0000 (14:43 +0200)] 
Merge branch 'ml/tcl90'

* ml/tcl90:
  git-gui: Allow Tcl 9.0
  git-gui: use -profile tcl8 on encoding conversions
  git-gui: use -profile tcl8 for file input with Tcl 9
  git-gui: themed.tcl: use full namespace for color
  git-gui: remove EOL translation for gets
  git-gui: do not mix -translation binary and -encoding
  git-gui: replace encoding binary with iso8859-1
  git-gui: translation binary defines iso8859-1
  git-gui: assure -eofchar {} on all channels

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
7 days agoMerge branch 'master' of https://github.com/alshopov/git-gui
Johannes Sixt [Sat, 2 Aug 2025 12:41:48 +0000 (14:41 +0200)] 
Merge branch 'master' of https://github.com/alshopov/git-gui

* 'master' of https://github.com/alshopov/git-gui:
  git-gui i18n: Remove the locations within the Bulgarian translation
  git-gui i18n: Update Bulgarian translation (557t)

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 days agoThe sixteenth batch
Junio C Hamano [Fri, 1 Aug 2025 18:26:46 +0000 (11:26 -0700)] 
The sixteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoMerge branch 'sk/reftable-clarify-tests'
Junio C Hamano [Fri, 1 Aug 2025 18:27:14 +0000 (11:27 -0700)] 
Merge branch 'sk/reftable-clarify-tests'

The reftable unit tests are now ported to the "clar" unit testing
framework.

* sk/reftable-clarify-tests:
  t/unit-tests: finalize migration of reftable-related tests
  t/unit-tests: convert reftable stack test to use clar
  t/unit-tests: convert reftable record test to use clar
  t/unit-tests: convert reftable readwrite test to use clar
  t/unit-tests: convert reftable table test to use clar
  t/unit-tests: convert reftable pq test to use clar
  t/unit-tests: convert reftable merged test to use clar
  t/unit-tests: convert reftable block test to use clar
  t/unit-tests: convert reftable basics test to use clar test framework
  t/unit-tests: implement clar specific reftable test helper functions

8 days agoMerge branch 'ly/pull-autostash'
Junio C Hamano [Fri, 1 Aug 2025 18:27:13 +0000 (11:27 -0700)] 
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

8 days agoMerge branch 'jc/document-test-balloons-in-flight'
Junio C Hamano [Fri, 1 Aug 2025 18:27:13 +0000 (11:27 -0700)] 
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

8 days agoMerge branch 'ag/imap-send-list-folders-doc'
Junio C Hamano [Fri, 1 Aug 2025 18:27:12 +0000 (11:27 -0700)] 
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

8 days agoMerge branch 'cb/meson-avoid-broken-macos-pcre2'
Junio C Hamano [Fri, 1 Aug 2025 18:27:12 +0000 (11:27 -0700)] 
Merge branch 'cb/meson-avoid-broken-macos-pcre2'

Build fix for macOS.

* cb/meson-avoid-broken-macos-pcre2:
  meson: work around broken system PCRE2 dependency in macOS

8 days agoMerge branch 'jc/ci-print-test-failures-fix'
Junio C Hamano [Fri, 1 Aug 2025 18:27:12 +0000 (11:27 -0700)] 
Merge branch 'jc/ci-print-test-failures-fix'

CI fix.

* jc/ci-print-test-failures-fix:
  ci: allow github-actions print test failures again

8 days agoMerge branch 'jk/unleak-reflog-expire-entry'
Junio C Hamano [Fri, 1 Aug 2025 18:27:11 +0000 (11:27 -0700)] 
Merge branch 'jk/unleak-reflog-expire-entry'

Leakfix.

* jk/unleak-reflog-expire-entry:
  reflog: close leak of reflog expire entry

8 days agoMerge branch 'jc/do-not-scan-argv-without-parsing'
Junio C Hamano [Fri, 1 Aug 2025 18:27:11 +0000 (11:27 -0700)] 
Merge branch 'jc/do-not-scan-argv-without-parsing'

Update a hard-to-read in-code NEEDSWORK comment.

* jc/do-not-scan-argv-without-parsing:
  rev-list: update a NEEDSWORK comment

8 days agoMerge branch 'jk/revision-no-early-output'
Junio C Hamano [Fri, 1 Aug 2025 18:27:10 +0000 (11:27 -0700)] 
Merge branch 'jk/revision-no-early-output'

Remove unsupported, unused, and unsupportable old option from "git
log".

* jk/revision-no-early-output:
  revision: drop early output option

8 days agoMerge branch 'jc/rev-list-info-cleanup'
Junio C Hamano [Fri, 1 Aug 2025 18:27:10 +0000 (11:27 -0700)] 
Merge branch 'jc/rev-list-info-cleanup'

Move structure definition from unrelated header file to where it
belongs.

* jc/rev-list-info-cleanup:
  rev-list: make "struct rev_list_info" static to the only user

8 days agomeson: tolerate errors from git ls-files --deduplicate
Martin Storsjö [Fri, 1 Aug 2025 16:28:14 +0000 (19:28 +0300)] 
meson: tolerate errors from git ls-files --deduplicate

When using the Meson build system with versions of Git before 2.31,
that does not yet know the `git ls-files --deduplicate` option, one
can observe the following error:

    ../meson.build:697:19: ERROR: Command `/usr/bin/git -C /home/martin/code/git ls-files --deduplicate '*.h' ':!contrib' ':!compat/inet_ntop.c' ':!compat/inet_pton.c' ':!compat/nedmalloc' ':!compat/obstack.*' ':!compat/poll' ':!compat/regex' ':!sha1collisiondetection' ':!sha1dc' ':!t/unit-tests/clar' ':!t/t[0-9][0-9][0-9][0-9]*' ':!xdiff'` failed with status 129.

The failing command is used to find all header files in our code
base, which is required for static analysis.

Static analysis is an entirely optional feature that distributors
typically don't care about, and we already know to skip running the
command when we are not in a Git repository. But we do not handle
the above failure gracefully, even though we could.

Fix this by passing `check: false` to `run_command`, which makes it
tolerate failures. Then check `returncode()` manually to decide
whether to inspect the output.

Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agodoc: fast-import: contextualize the hardware cost
Kristoffer Haugsbakk [Fri, 1 Aug 2025 13:42:25 +0000 (15:42 +0200)] 
doc: fast-import: contextualize the hardware cost

6e411d20440 (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>
8 days agoCodingGuidelines: clarify that S_release() does not reinitialize
Junio C Hamano [Fri, 1 Aug 2025 17:06:55 +0000 (10:06 -0700)] 
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>
8 days agoMerge branch 'ml/tcltk-9'
Johannes Sixt [Fri, 1 Aug 2025 16:39:15 +0000 (18:39 +0200)] 
Merge branch 'ml/tcltk-9'

* ml/tcltk-9:
  gitk: allow Tcl/Tk 9.0+
  gitk: use -profile tcl8 on encoding conversions
  gitk: use -profile tcl8 for file input with Tcl 9
  gitk: Tcl9 doesn't expand ~, use $env(HOME)
  gitk: switch to -translation binary
  gitk: update scrolling for TclTk 8.7+ / TIP 474

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 days agoMerge branch 'oa/hide-more-refs'
Johannes Sixt [Fri, 1 Aug 2025 16:38:08 +0000 (18:38 +0200)] 
Merge branch 'oa/hide-more-refs'

* oa/hide-more-refs:
  gitk: Add user preference to hide specific references

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 days agoMerge branch 'ml/abandon-old-version'
Johannes Sixt [Fri, 1 Aug 2025 16:36:15 +0000 (18:36 +0200)] 
Merge branch 'ml/abandon-old-version'

* ml/abandon-old-version:
  gitk: restore ui colors after cancelling config dialog
  gitk: set config dialog color swatches in one place

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 days agoMerge branch 'master' of github.com:alshopov/gitk
Johannes Sixt [Fri, 1 Aug 2025 16:35:44 +0000 (18:35 +0200)] 
Merge branch 'master' of github.com:alshopov/gitk

* 'master' of github.com:alshopov/gitk:
  gitk i18n: Remove the locations within the Bulgarian translation
  gitk i18n: Update Bulgarian translation (322t)

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 days agoMerge branch 'mr/sort-refs-by-type'
Johannes Sixt [Fri, 1 Aug 2025 16:35:16 +0000 (18:35 +0200)] 
Merge branch 'mr/sort-refs-by-type'

* mr/sort-refs-by-type:
  gitk: filter invisible upstream refs from reference list
  gitk: avoid duplicated upstream refs

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agointeractive: do strip trailing CRLF from input
Johannes Sixt [Thu, 31 Jul 2025 16:07:36 +0000 (18:07 +0200)] 
interactive: do strip trailing CRLF from input

`git reset -p file` on a Windows CMD refuses to do anything useful
with this error message:

    (1/5) Unstage this hunk [y,n,q,a,d,j,J,g,/,e,p,?]? n
    'nly one letter is expected, got 'n

The letter 'O' at the beginning of the line is overwritten by an
apostrophe, so, clearly the parser sees the string "n\r".

strbuf_trim_trailing_newline() removes trailing CRLF from the string.
In particular, it first removes LF if present, and if that was the
case, it also removes CR if present.

git_read_line_interactively() clearly intends to remove CRLF as it
calls strbuf_trim_trailing_newline(). However, input is gathered using
strbuf_getline_lf(), which already removes the trailing LF. Now
strbuf_trim_trailing_newline() does not see LF, so that it does not
remove CR, either, and leaves it for the caller to process.

Call strbuf_getline() instead, which removes both LF and CR.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 days agot7450: inspect the correct path a broken code would write to
chenjianhu [Thu, 31 Jul 2025 03:49:40 +0000 (03:49 +0000)] 
t7450: inspect the correct path a broken code would write to

Prior to 05e9cd64 (config: quote values containing CR character,
2025-05-19), a repository can trick "clone --recurse-submodules"
into running a post-checkout hook shipped with the project.  The
test was written to make sure the trick would no longer run the
hook with the fix in the commit.

However, the test did not check for the path the hook would
create; correct the path to the expected one if the bug were
still with us.

Signed-off-by: chenjianhu <chenjianhu@kylinos.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 days agogit-gui: Allow Tcl 9.0
Mark Levedahl [Sat, 17 May 2025 02:30:37 +0000 (22:30 -0400)] 
git-gui: Allow Tcl 9.0

TclTk 9.0 is now shipping, and git-gui is now patched to support use of
this newer version. Adjust required versions to allow Tcl/Tk >= 8.6,
including 9.x.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
9 days agogit-gui: use -profile tcl8 on encoding conversions
Mark Levedahl [Sat, 31 May 2025 19:18:31 +0000 (15:18 -0400)] 
git-gui: use -profile tcl8 on encoding conversions

git-gui in the prior commit learned to apply -profile tcl8 when reading
files, avoiding errors on non-binary data streams whose encoding is not
utf-8. But, git-gui also consumes binary data streams (generally blobs
from commits) as the output of commands, and internally decodes this to
support various displays.

With Tcl9, errors occur in this decoding for the same reasons described
in the previous commit: basically, the underlying data may contain
extended ascii characters violating the assumption of utf-8 encoding.

This problem has a similar fix to the prior issue: we must use the tlc8
profile when converting this data to the internal unicode format. Do so,
again only on Tcl9 as Tcl8.6 does not recognize -profile, and only Tcl
9.0 makes strict the default.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
9 days agogit-gui: use -profile tcl8 for file input with Tcl 9
Mark Levedahl [Sat, 31 May 2025 18:52:35 +0000 (14:52 -0400)] 
git-gui: use -profile tcl8 for file input with Tcl 9

git-gui invokes many git commands expecting output in utf-8 encoding,
but git accepts extended ascii (code page unknown) as utf-8 without
validating, so cannot guarantee valid utf-8 on output.  In particular,
using any extended ascii code page has long been acceptable on git given
that everyone on a project is aware of and uses that same code page to
view all data. utf-8 accepts only 7-bit ascii characters in single
bytes, and any characters outside of that base set require at least two
bytes for representation in unicode.

Tcl is a string based language, and transcodes all input data to an
internal unicode format, and to whatever format is requested on output:
"pure" binary is recoded byte by byte using iso8859-1.  Tcl8.x silently
recodes invalid utf-8 as binary data, so extended ascii characters
maintain their binary value on output but may not display correctly.

Tcl 8.7 added three profiles to control this behaviour: strict (raises
exceptions), replace (replaces each invalid byte with ?), and the
default tcl8 maintaining the old behavior.  Tcl 9 changes the default
profile to strict, meaning any invalid utf-8 raises an exception that
git-gui does not handle.

An example of this in the git repository is commit 7eb93c8965 ("[PATCH]
Simplify git script", 2005-09-07). This includes extended ascii
characters in the author name and commit message.

The tcl8 profile used so far has acceptable behavior given git-gui's
acceptance: this allows git-gui to accept extended ascii though it may
display incorrectly.  Let's continue that behavior by overriding open to
use the tcl8 profile on Tcl9 and later: Tcl 8.6 does not understand
fconfigure -profile, and Tcl 8.7 maintains the tcl8 profile.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
9 days agogit-gui: themed.tcl: use full namespace for color
Mark Levedahl [Sat, 10 May 2025 01:39:56 +0000 (21:39 -0400)] 
git-gui: themed.tcl: use full namespace for color

Tcl 9 imposes strict requirements on namespaces for variables, while Tcl
8 does not. lib/themed.tcl does not use the fully qualified name for the
"color" namespace, with result that variables are not found with Tcl
9.0. Fix this.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
9 days agogit-gui: remove EOL translation for gets
Mark Levedahl [Thu, 22 May 2025 01:13:27 +0000 (21:13 -0400)] 
git-gui: remove EOL translation for gets

git-gui configures '-translation lf' on a number of channels. The
default configuration is 'auto', which on input changes any occurrence
of \n, \r, or \r\n to \n, and on output changes any such EOL sequence to
a platform dependent value (\n on Unix, \r\n on Windows). Such
translation can be necessary, but much of what is configured now is
redundant.

In particular, many of the channels configured this way are then
consumed by gets, which already recognizes any of \n, \r, or \r\n as
terminators.  Configuring a channel to first change these line endings,
then give the result to gets, is redundant.

The valid uses of -translation lf are for output where we do not want
\r\n on Windows, and for consuming entire files without going through
gets, assuring that \n will be used internally. Let's remove all the
others that only serve to confuse.

lib/diff.tcl must have -translation lf because \r\n might be stored in
the repository (e.g., on Windows, with no crlf translation enabled), and
git will treat \n as the line ending, while the preceding \r is just
whitespace, and these may be split by ANSI color coding. git-gui's
read_diff handles this correctly as-is.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
9 days agoMerge branch 'ml/windows-tie-loose-ends'
Johannes Sixt [Thu, 31 Jul 2025 17:20:22 +0000 (19:20 +0200)] 
Merge branch 'ml/windows-tie-loose-ends'

* ml/windows-tie-loose-ends:
  git-gui: use /cmd/git-gui.exe for shortcut
  git-gui: Windows tk_getSaveFile is not useful for shortcuts
  git-gui: let nice work on Windows
  git-gui: do not add directories to PATH on Windows

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agogit-gui: honor TCLTK_PATH in git-gui--askpass
Carlo Marcelo Arenas Belón [Thu, 31 Jul 2025 08:06:27 +0000 (01:06 -0700)] 
git-gui: honor TCLTK_PATH in git-gui--askpass

Since its introduction in 8c76212 (git-gui: Add a simple implementation
of SSH_ASKPASS., 2008-10-15), git-gui--askpass has been calling whatever
wish interpreter is in the path, unlike git-gui.

Correct that by turning it into a script that would be processed at build
time.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agogit-gui: retire Git Gui.app
Carlo Marcelo Arenas Belón [Thu, 31 Jul 2025 08:06:26 +0000 (01:06 -0700)] 
git-gui: retire Git Gui.app

In a recent commit, the minimum version of Tcl/Tk was raised to
8.6, but the "app" relies on the system provided Framework that
is based on 8.5.

Remove it, and let git-gui use a third party version of Wish if
available.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agogit-gui: fix dependency of GITGUI_MAIN on generator
Carlo Marcelo Arenas Belón [Thu, 31 Jul 2025 08:06:25 +0000 (01:06 -0700)] 
git-gui: fix dependency of GITGUI_MAIN on generator

Since 854e883 (git-gui: extract script to generate "git-gui",
2025-03-11), the logic to generate the main script was pulled
out of the Makefile, but adding the resulting generator as a
dependency was missed.

If the logic changes, the main script should be regenerated, so
add it as a dependency.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agogit-gui: remove uname_O in Makefile
Carlo Marcelo Arenas Belón [Thu, 31 Jul 2025 08:06:24 +0000 (01:06 -0700)] 
git-gui: remove uname_O in Makefile

Last used in ae49066 (git gui Makefile - remove Cygwin modifications,
2023-06-26), and unused since.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
9 days agogitk: filter invisible upstream refs from reference list
Michael Rappazzo [Thu, 31 Jul 2025 11:53:21 +0000 (07:53 -0400)] 
gitk: filter invisible upstream refs from reference list

In refill_reflist, upstream refs are now only included if their
commits are visible in the current view. This prevents display
issues like multiple highlighted branches when clicking entries.

Signed-off-by: Michael Rappazzo <michael.rappazzo@infor.com>
9 days agotest-hashmap: document why it is no longer used but still there
Junio C Hamano [Wed, 30 Jul 2025 23:18:16 +0000 (16:18 -0700)] 
test-hashmap: document why it is no longer used but still there

As I ended up wasting a few dozen minutes looking for the reason why
this is still here, help future developers by saving them from
wasting their time by documenting why this code that apparently is
not used by anybody is still here.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 days agogitk: avoid duplicated upstream refs
Johannes Sixt [Tue, 29 Jul 2025 12:52:54 +0000 (14:52 +0200)] 
gitk: avoid duplicated upstream refs

It is possible that multiple local branches track the same upstream.
In this case, the refs dialog lists the tracked upstream branch
multiple times. This is undesirable. Make them unique.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
11 days agogit-gui i18n: Remove the locations within the Bulgarian translation
Alexander Shopov [Tue, 29 Jul 2025 18:09:45 +0000 (20:09 +0200)] 
git-gui i18n: Remove the locations within the Bulgarian translation

This makes sending diffs via mail list easier and
brings the po-file in line with git po-file.

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
11 days agogit-gui i18n: Update Bulgarian translation (557t)
Alexander Shopov [Mon, 28 Jul 2025 11:20:01 +0000 (13:20 +0200)] 
git-gui i18n: Update Bulgarian translation (557t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
11 days agogitk i18n: Remove the locations within the Bulgarian translation
Alexander Shopov [Tue, 29 Jul 2025 17:50:36 +0000 (19:50 +0200)] 
gitk i18n: Remove the locations within the Bulgarian translation

This makes sending diffs via mail list easier and
brings the po-file in line with git po-file.

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
11 days agogitk i18n: Update Bulgarian translation (322t)
Alexander Shopov [Mon, 28 Jul 2025 12:06:26 +0000 (14:06 +0200)] 
gitk i18n: Update Bulgarian translation (322t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
11 days agoadd-patch: add diff.context command line overrides
Leon Michalak [Tue, 29 Jul 2025 07:01:51 +0000 (07:01 +0000)] 
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>
11 days agoadd-patch: respect diff.context configuration
Leon Michalak [Tue, 29 Jul 2025 07:01:50 +0000 (07:01 +0000)] 
add-patch: respect diff.context configuration

Various builtins that use add-patch infrastructure do not respect
the user's diff.context and diff.interHunkContext file configurations.

The user may be used to seeing their diffs with customized context size,
but not in the patches "git add -p" shows them to pick from.

Teach add-patch infrastructure to read these configuration variables and
pass their values when spawning the underlying plumbing commands as
their command line option.

Signed-off-by: Leon Michalak <leonmichalak6@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agot: use test_config in t4055
Leon Michalak [Tue, 29 Jul 2025 07:01:49 +0000 (07:01 +0000)] 
t: use test_config in t4055

Use the modern "test_config" test utility instead of manual"git config"
as the former provides clean up on test completion.

This is a prerequisite to the commits that follow which add to this test
file.

Signed-off-by: Leon Michalak <leonmichalak6@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agot: use test_grep in t3701 and t4055
Leon Michalak [Tue, 29 Jul 2025 07:01:48 +0000 (07:01 +0000)] 
t: use test_grep in t3701 and t4055

As a preparatory clean-up, use the "test_grep" test utility instead of
regular "grep" which provides better debug information if tests fail.

Signed-off-by: Leon Michalak <leonmichalak6@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agomeson: ensure correct "clar-decls.h" header is used
Patrick Steinhardt [Tue, 29 Jul 2025 14:10:11 +0000 (16:10 +0200)] 
meson: ensure correct "clar-decls.h" header is used

The "clar-decls.h" header gets generated by us to extract prototypes of
unit test functions from our clar-based tests. This generated file is
then written into "t/unit-tests/" and included via "unit-test.h". The
intent of all this is that we can keep "-Wmissing-prototype" warnings
enabled. If we had that warning disabled, it would be easy to miss in
case any of the non-static functions had a typo in its name and thus
wasn't picked up by our test case extractor.

Including the file directly has a big downside though: if a source tree
was built both with our Makefile and with Meson, then the Meson build
would include the "clar-decls.h" file from our Makefile. And if those
are out of sync we get compiler errors.

We already fixed a similar issue in 4771501c0a (meson: ensure correct
version-def.h is used, 2025-01-14). Let's do the same and pass the
absolute path to "clar-decls.h" via a preprocessor define.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agot7510: use $PWD instead of $(pwd) inside PATH
Jeff King [Fri, 25 Jul 2025 05:13:09 +0000 (01:13 -0400)] 
t7510: use $PWD instead of $(pwd) inside PATH

On Windows, $(pwd) will give us a Windows-style path like "D:/foo".
Putting that into $PATH confuses anybody parsing that variable, since
colon is a separator character in $PATH. Instead, we should use the
Unix-style value we get from $PWD ("/d/foo").

This is similar to the cases fixed by 71dd50472d (t0021, t5615: use $PWD
instead of $(pwd) in PATH-like shell variables, 2016-11-11).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agoblame: remove parameter detailed in get_commit_info()
Han Young [Mon, 28 Jul 2025 03:55:48 +0000 (11:55 +0800)] 
blame: remove parameter detailed in get_commit_info()

The get_commit_info() function accepts a parameter that can be used
to stop the commit parsing early.  However, none of the callers use
this feature, and testing proved that the performance gain of
stopping parsing early is negligible and unmeasurable.

Signed-off-by: Han Young <hanyang.tony@bytedance.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agobuiltin: unmark git-switch and git-restore as experimental
Justin Tobler [Mon, 28 Jul 2025 19:42:18 +0000 (14:42 -0500)] 
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>
12 days agoref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'
Karthik Nayak [Mon, 28 Jul 2025 20:20:50 +0000 (22:20 +0200)] 
ref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'

In the commit 51511d68f4 (for-each-ref: introduce a '--start-after'
option, 2025-07-15), for introducing the '--start-after' flag, the
`ref_iterator_seek()` was modified to also accept a flag. This was to
allow the function to also set the prefix when
'REF_ITERATOR_SEEK_SET_PREFIX' was set.

In `do_filter_refs()` instead of passing the flag, we pass in '1' which
is the value of the flag. While this works, this is definitely hard to
read and introduces inconsistency. Change it to use the flag.

While here, remove the unnecessary 'if (prefix)' clause in the 'else'
statement, since the block already checks for 'prefix'.

Reported-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>
12 days agot6302: add test combining '--start-after' with '--exclude'
Karthik Nayak [Mon, 28 Jul 2025 20:20:49 +0000 (22:20 +0200)] 
t6302: add test combining '--start-after' with '--exclude'

The '--start-after' doesn't explicitly mention being compatible with the
'--exclude' flag, generally only incompatibility is explicitly called
out. However, it would be nice to test the compatibility between the
two to avoid future regressions. Let's do that.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agofor-each-ref: reword the documentation for '--start-after'
Karthik Nayak [Mon, 28 Jul 2025 20:20:48 +0000 (22:20 +0200)] 
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>
12 days agofor-each-ref: fix documentation argument ordering
Karthik Nayak [Mon, 28 Jul 2025 20:20:47 +0000 (22:20 +0200)] 
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>
12 days agoref-cache: use 'size_t' instead of int for length
Karthik Nayak [Mon, 28 Jul 2025 20:20:46 +0000 (22:20 +0200)] 
ref-cache: use 'size_t' instead of int for length

The commit 090eb5336c (refs: selectively set prefix in the seek
functions, 2025-07-15) modified the ref-cache iterator to support
seeking to a specified marker without setting the prefix.

The commit adds and uses an integer 'len' to capture the length of the
seek marker to compare with the entries of a given directory. Since the
type of the variable is 'int', this is met with a typecast of converting
a `strlen` to 'int' so it can be assigned to the 'len' variable.

This is whole operation is a bit wrong:
1. Since the 'len' variable is eventually used in a 'strncmp', it should
have been of type 'size_t'.
2. This also truncates the value provided from 'strlen' to an int, which
could cause a large refname to produce a negative number.

Let's do the correct thing here and simply use 'size_t' for `len`.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agoThe fifteenth batch
Junio C Hamano [Mon, 28 Jul 2025 19:02:20 +0000 (12:02 -0700)] 
The fifteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agoMerge branch 'ac/auto-comment-char-fix'
Junio C Hamano [Mon, 28 Jul 2025 19:02:34 +0000 (12:02 -0700)] 
Merge branch 'ac/auto-comment-char-fix'

"git commit" that concludes a conflicted merge failed to notice and remove
existing comment added automatically (like "# Conflicts:") when the
core.commentstring is set to 'auto'.

* ac/auto-comment-char-fix:
  config: set comment_line_str to "#" when core.commentChar=auto
  commit: avoid scanning trailing comments when 'core.commentChar' is "auto"