]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
8 days agoMerge branch 'ps/sane-ctype-workaround'
Junio C Hamano [Wed, 23 Jul 2025 22:45:16 +0000 (15:45 -0700)] 
Merge branch 'ps/sane-ctype-workaround'

Our <sane-ctype.h> header file relied on that the system-supplied
<ctype.h> header is not later included, which would override our
macro definitions, but "amazon linux" broke this assumption.  Fix
this by preemptively including <ctype.h> near the beginning of
<sane-ctype.h> ourselves.

* ps/sane-ctype-workaround:
  sane-ctype: fix compiler error on Amazon Linux 2

8 days agoMerge branch 'ly/changed-paths-traversal'
Junio C Hamano [Wed, 23 Jul 2025 22:45:15 +0000 (15:45 -0700)] 
Merge branch 'ly/changed-paths-traversal'

Lift the limitation to use changed-path filter in "git log" so that
it can be used for a pathspec with multiple literal paths.

* ly/changed-paths-traversal:
  bloom: optimize multiple pathspec items in revision
  revision: make helper for pathspec to bloom keyvec
  bloom: replace struct bloom_key * with struct bloom_keyvec
  bloom: rename function operates on bloom_key
  bloom: add test helper to return murmur3 hash

10 days agoMerge branch 'master' of https://github.com/j6t/git-gui
Junio C Hamano [Tue, 22 Jul 2025 20:30:52 +0000 (13:30 -0700)] 
Merge branch 'master' of https://github.com/j6t/git-gui

* 'master' of https://github.com/j6t/git-gui: (26 commits)
  git-gui: eliminate _search_exe
  git-gui: remove procs gitexec and _git_cmd
  git-gui: use dashless 'git cmd' form for read/write
  git-gui: default to full copy for linked worktrees
  git-gui: use git-clone
  git-gui: remove non-ttk code
  git-gui: remove ${NS} indirection for ttk
  git-gui: always use themed widgets from ttk
  git-gui: remove redundant check for Tk >= 8.5
  git-gui: remove unreachable Tk 8.4 code
  git-gui: remove unused git-version
  git-gui: use git_init to create new repository dir
  git-gui: git-remote is always available
  git-gui: git merge understands --strategy=recursive
  git-gui: git-diff knows submodules and textconv
  git-gui: git-blame understands -w and textconv
  git-gui: git rev-parse knows show_toplevel
  git-gui: use git-branch --show-current
  git-gui: git-diff-index always knows submodules
  git-gui: git ls-files knows --exclude-standard
  ...

10 days agoMerge branch 'master' of https://github.com/j6t/gitk
Junio C Hamano [Tue, 22 Jul 2025 20:30:21 +0000 (13:30 -0700)] 
Merge branch 'master' of https://github.com/j6t/gitk

* 'master' of https://github.com/j6t/gitk: (21 commits)
  gitk: remove header of now empty section "General options"
  gitk: separate upstream refs when using the sort-by-type option
  gitk: make 'sort-refs-by-type' optional and persistent
  gitk: sort by ref type on the 'tags and heads' view
  gitk: choosefont - remove a stray debugging line
  gitk: allow horizontal commit-graph scrolling
  gitk: update aqua scrolling for TclTk 8.6 / TIP171
  gitk: update x11 scrolling for TclTk 8.6 / TIP 171
  gitk: update win32 scrolling for Tk 8.6 / TIP 171
  gitk: mousewheel scrolling functions for Tk 8.6
  gitk: wheel scrolling multiplier preference
  gitk: separate x11 / win32 / aqua Mouse bindings
  gitk: remove non-ttk support code
  gitk: replace ${NS} with ttk
  gitk: always use themed Tk (ttk)
  gitk: use $config_variables as list for save/restore
  gitk: remove implementations for Tcl/Tk < 8.6
  gitk: Make TclTk 8.6 the minimum, allow 8.7
  gitk: remove code targeting git <= 1.7.2
  gitk: require git >= 2.20
  ...

10 days agogitk: remove header of now empty section "General options"
Johannes Sixt [Fri, 18 Jul 2025 20:49:21 +0000 (22:49 +0200)] 
gitk: remove header of now empty section "General options"

An earlier commit remove the only option that was available under
"General options". We don't need the header for the empty section.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
10 days agoMerge branch 'ml/abandon-old-version' (early part)
Johannes Sixt [Tue, 22 Jul 2025 16:29:54 +0000 (18:29 +0200)] 
Merge branch 'ml/abandon-old-version' (early part)

* 'ml/abandon-old-version' (early part):
  gitk: allow horizontal commit-graph scrolling
  gitk: update aqua scrolling for TclTk 8.6 / TIP171
  gitk: update x11 scrolling for TclTk 8.6 / TIP 171
  gitk: update win32 scrolling for Tk 8.6 / TIP 171
  gitk: mousewheel scrolling functions for Tk 8.6
  gitk: wheel scrolling multiplier preference
  gitk: separate x11 / win32 / aqua Mouse bindings
  gitk: remove non-ttk support code
  gitk: replace ${NS} with ttk
  gitk: always use themed Tk (ttk)
  gitk: use $config_variables as list for save/restore
  gitk: remove implementations for Tcl/Tk < 8.6
  gitk: Make TclTk 8.6 the minimum, allow 8.7
  gitk: remove code targeting git <= 1.7.2
  gitk: require git >= 2.20

10 days agoMerge branch 'mr/sort-refs-by-type'
Johannes Sixt [Tue, 22 Jul 2025 16:13:31 +0000 (18:13 +0200)] 
Merge branch 'mr/sort-refs-by-type'

* mr/sort-refs-by-type:
  gitk: separate upstream refs when using the sort-by-type option
  gitk: make 'sort-refs-by-type' optional and persistent
  gitk: sort by ref type on the 'tags and heads' view

10 days agoMerge branch 'ti/support-sha256'
Johannes Sixt [Tue, 22 Jul 2025 16:04:55 +0000 (18:04 +0200)] 
Merge branch 'ti/support-sha256'

* ti/support-sha256:
  gitk: Add support of SHA256 repositories

10 days agoMerge branch 'ml/abandon-old-versions'
Johannes Sixt [Tue, 22 Jul 2025 15:37:33 +0000 (17:37 +0200)] 
Merge branch 'ml/abandon-old-versions'

* ml/abandon-old-versions:
  git-gui: eliminate _search_exe
  git-gui: remove procs gitexec and _git_cmd
  git-gui: use dashless 'git cmd' form for read/write
  git-gui: default to full copy for linked worktrees
  git-gui: use git-clone
  git-gui: remove unused git-version
  git-gui: use git_init to create new repository dir
  git-gui: git-remote is always available
  git-gui: git merge understands --strategy=recursive
  git-gui: git-diff knows submodules and textconv
  git-gui: git-blame understands -w and textconv
  git-gui: git rev-parse knows show_toplevel
  git-gui: use git-branch --show-current
  git-gui: git-diff-index always knows submodules
  git-gui: git ls-files knows --exclude-standard
  git-gui: require git >= 2.36

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
10 days agoMerge branch 'ml/tcl86'
Johannes Sixt [Tue, 22 Jul 2025 15:34:08 +0000 (17:34 +0200)] 
Merge branch 'ml/tcl86'

* ml/tcl86:
  git-gui: remove non-ttk code
  git-gui: remove ${NS} indirection for ttk
  git-gui: always use themed widgets from ttk
  git-gui: remove redundant check for Tk >= 8.5
  git-gui: remove unreachable Tk 8.4 code
  git-gui: Make TclTk 8.6 the minimum, allow 8.7

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
10 days agogit-gui: eliminate _search_exe
Mark Levedahl [Sat, 5 Apr 2025 12:00:00 +0000 (08:00 -0400)] 
git-gui: eliminate _search_exe

git-gui has _search_exe as needed to give the executable suffix
(.exe) on Windows. But, the prior commit eliminated the only user of
this variable. Delete it.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
10 days agogit-gui: remove procs gitexec and _git_cmd
Mark Levedahl [Sun, 6 Apr 2025 15:14:35 +0000 (11:14 -0400)] 
git-gui: remove procs gitexec and _git_cmd

gitexec looks up and caches the method to execute git subcommands using
the long deprecated dashed form if found in $(git--exec-path). But,
git_read and git_write now use the dashless form, by-passing gitexec.
This leaves two remaining uses of gitexec: one during startup to define
use of an ssh_key helper, and one in the about dialog box. These are
neither performance critical nor likely to be called more than once, so
do not justify an otherwise unused cacheing system.

Let's change those two uses, making gitexec unused. This allows removing
gitexec and _git_cmd.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
10 days agogit-gui: use dashless 'git cmd' form for read/write
Mark Levedahl [Sat, 5 Apr 2025 03:08:35 +0000 (23:08 -0400)] 
git-gui: use dashless 'git cmd' form for read/write

git-gui implements its own approach to locating and running various git
subcommands, bypassing git's capabilities for running git-*.  This was
written in 2007: at that time, many git commands were shell-scripts
stored in $(git --exec-path), git's run-command api was not well adapted
to Windows and had serious performance issues when it worked at all, and
running subcommand 'git foo' as 'git-foo' was common and fully supported.

On Windows, git-gui searches $(git --exec-path) for builtin commands,
then attempts to find an interpreter on PATH to run those, invoking
these differently than on other platforms. For instance, the explicit
shebang #!/usr/bin/perl found in a script will be run by the first Perl
interpreter found on $PATH, which might not be at that specific location
so could be different than what git would run.

The various issues leading to the current implemention no longer exist.
Most git commands are now builtins, links to run those are not installed
in $(git --exec-path) by default (the "dashless" form is recommended
instead), and git's run-command api works well everywhere.

So, let's use git to launch its subcommands on all platforms.  Do so by
modifying procs git_read and git_write to use the "dashless" form for
invoking git commands, avoiding the search for git-<foo>. This leaves
_git_cmd unused with cleanup in a later patch.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
10 days agogit-gui: default to full copy for linked worktrees
Mark Levedahl [Mon, 21 Jul 2025 15:12:18 +0000 (11:12 -0400)] 
git-gui: default to full copy for linked worktrees

git-gui's default clone method is git-clone's default, and this uses
hardlinks rather than copying the objects directory for local
repositories. However, this method explicitly fails if a symlink (or
.gitfile) exists in the path to the objects directory. Thus, the default
clone option fails for worktrees created by git-new-workdir or
git-worktree.  git-gui's original do_clone trapped this error for a
symlinked git-new-workdir tree, directly falling back to a full clone,
while the updated git-gui using git-clone does not. (The old do_clone
could not handle gitfile linked worktrees, however).

Let's apply the more friendly fallback to a full clone in both these
cases where git-clone behavior throws an error on the default method.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
10 days agogit-gui: use git-clone
Mark Levedahl [Fri, 9 Feb 2024 23:07:45 +0000 (18:07 -0500)] 
git-gui: use git-clone

git-gui clones a repository by invoking git-plumbing commands, in proc
do_clone, rather than using git-clone.  The justification was that the
low-level commands are guaranteed to provide a stable interface, while
the higher level commands such as git-clone may not be stable. This
approach requires git-gui to continually evolve by mirroring new
features in git itself, which has not happened, while the user interface
in git-clone has proven very stable. Also, git-gui does directly call
many other non-plumbing commands in git's repertoire.

do_clone's last significant functionality change was in 2015, and
updates are required for shallow clones, the reftable backend, cloning
from linked worktrees, and perhaps other features and bugs. For
instance, I had reports of git-gui failing to correctly clone
repositories prior to 2015, resulting in essentially the patch given
here. The only significant work was supporting .gitfile linked worktrees
unknown to do_clone, but supported by git-clone, and none regarding the
interface to git-clone itself. That interface is clearly stable enough
to not be a problem.

Supporting new use-cases with this requires exposing new options in the
clone dialog, then passing flags to git-clone. This avoids updating
do_clone to understand those options, reducing the maintenance burdens.

So, teach git-gui to use git-clone.  This change is in one patch as
there is no obvious incremental path to migration. The existing dialog /
options / status screen are unchanged, the known user-visible changes
are that cloning from a working directory linked by a gitfile now works,
there is no auto-fallback to a full copy when cloning linked workdirs
and worktrees (meaning git-clone fails unless a full or shared copy is
selected), and messages displayed are from git-clone.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
11 days agoThe twelfth batch
Junio C Hamano [Mon, 21 Jul 2025 15:45:47 +0000 (08:45 -0700)] 
The twelfth batch

11 days agoMerge branch 'jb/gpg-program-variable-is-a-pathname'
Junio C Hamano [Mon, 21 Jul 2025 16:14:28 +0000 (09:14 -0700)] 
Merge branch 'jb/gpg-program-variable-is-a-pathname'

The gpg.program configuration variable, which names a pathname to
the (custom) GPG compatible program, can now be spelled with ~tilde
expansion.

* jb/gpg-program-variable-is-a-pathname:
  gpg-interface: expand gpg.program as a path

11 days agoMerge branch 'cb/daemon-reap-children'
Junio C Hamano [Mon, 21 Jul 2025 16:14:28 +0000 (09:14 -0700)] 
Merge branch 'cb/daemon-reap-children'

Futz with SIGCHLD handling in "git daemon".

* cb/daemon-reap-children:
  daemon: use sigaction() to install child_handler()
  compat/mingw: allow sigaction(SIGCHLD)

11 days agoMerge branch 'ja/doc-git-log-markup'
Junio C Hamano [Mon, 21 Jul 2025 16:14:27 +0000 (09:14 -0700)] 
Merge branch 'ja/doc-git-log-markup'

Doc mark-up updates.

* ja/doc-git-log-markup:
  doc: git-log: convert log config to new doc format
  doc: git-log: convert diff options to new doc format
  doc: git-log: convert pretty formats to new doc format
  doc: git-log: convert pretty options to new doc format
  doc: git-log: convert rev list options to new doc format
  doc: git-log: convert line range format to new doc format
  doc: git-log: convert line range options to new doc format
  doc: git-log convert rev-list-description to new doc format
  doc: convert git-log to new documentation format

11 days agoMerge branch 'rh/doc-glob-pathspec-fix'
Junio C Hamano [Mon, 21 Jul 2025 16:14:27 +0000 (09:14 -0700)] 
Merge branch 'rh/doc-glob-pathspec-fix'

Docfix.

* rh/doc-glob-pathspec-fix:
  doc: correct doc for glob pathspec

11 days agoMerge branch 'ps/meson-cleanups'
Junio C Hamano [Mon, 21 Jul 2025 16:14:26 +0000 (09:14 -0700)] 
Merge branch 'ps/meson-cleanups'

Meson-based build update.

* ps/meson-cleanups:
  ci: use Meson's new `--slice` option
  meson: update subproject wrappers
  meson: fix lookup of shell on MINGW64
  meson: clean up unnecessary variables
  meson: improve summary of auto-detected features
  meson: stop printing 'https' option twice in our summaries
  meson: stop discovering native version of Python

11 days agoMerge branch 'jk/remote-avoid-overlapping-names'
Junio C Hamano [Mon, 21 Jul 2025 16:14:26 +0000 (09:14 -0700)] 
Merge branch 'jk/remote-avoid-overlapping-names'

"git remote" now detects remote names that overlap with each other
(e.g., remote nickname "outer" and "outer/inner" are used at the
same time), as it will lead to overlapping remote-tracking
branches.

* jk/remote-avoid-overlapping-names:
  remote: detect collisions in remote names

11 days agoMerge branch 'tb/midx-avoid-cruft-packs'
Junio C Hamano [Mon, 21 Jul 2025 16:14:26 +0000 (09:14 -0700)] 
Merge branch 'tb/midx-avoid-cruft-packs'

"pack-objects" has been taught to avoid pointing into objects in
cruft packs from midx.

* tb/midx-avoid-cruft-packs:
  repack: exclude cruft pack(s) from the MIDX where possible
  pack-objects: introduce '--stdin-packs=follow'
  pack-objects: swap 'show_{object,commit}_pack_hint'
  pack-objects: fix typo in 'show_object_pack_hint()'
  pack-objects: perform name-hash traversal for unpacked objects
  pack-objects: declare 'rev_info' for '--stdin-packs' earlier
  pack-objects: factor out handling '--stdin-packs'
  pack-objects: limit scope in 'add_object_entry_from_pack()'
  pack-objects: use standard option incompatibility functions

11 days agoMerge branch 'bc/use-sha256-by-default-in-3.0'
Junio C Hamano [Mon, 21 Jul 2025 16:14:25 +0000 (09:14 -0700)] 
Merge branch 'bc/use-sha256-by-default-in-3.0'

Prepare to flip the default hash function to SHA-256.

* bc/use-sha256-by-default-in-3.0:
  Enable SHA-256 by default in breaking changes mode
  help: add a build option for default hash
  t5300: choose the built-in hash outside of a repo
  t4042: choose the built-in hash outside of a repo
  t1007: choose the built-in hash outside of a repo
  t: default to compile-time default hash if not set
  setup: use the default algorithm to initialize repo format
  Use legacy hash for legacy formats
  builtin: use default hash when outside a repository
  hash: add a constant for the legacy hash algorithm
  hash: add a constant for the default hash algorithm

11 days agogit-gui: remove non-ttk code
Mark Levedahl [Tue, 20 May 2025 17:53:52 +0000 (13:53 -0400)] 
git-gui: remove non-ttk code

git-gui has code paths to support older non-ttk widgets, but this code
is no longer reachable as ttk is always used. Remove that code.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
12 days agogitk: separate upstream refs when using the sort-by-type option
Michael Rappazzo [Sat, 19 Jul 2025 19:24:39 +0000 (15:24 -0400)] 
gitk: separate upstream refs when using the sort-by-type option

Since the upstream refs of local refs may be of more significance in the
context of the local refs, they are sorted after local refs and before the
remainder of the remote refs.

Signed-off-by: Michael Rappazzo <michael.rappazzo@infor.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
12 days agogitk: make 'sort-refs-by-type' optional and persistent
Michael Rappazzo [Fri, 18 Jul 2025 20:33:08 +0000 (16:33 -0400)] 
gitk: make 'sort-refs-by-type' optional and persistent

On the 'tags and heads' view, add an option to enable or disable
'Sort refs by type'.  This option is read from and written to the
config file.  Clicking on the option will update the refs in the
view.

Signed-off-by: Michael Rappazzo <michael.rappazzo@infor.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
12 days agogitk: sort by ref type on the 'tags and heads' view
Michael Rappazzo [Mon, 1 Jun 2015 15:05:25 +0000 (11:05 -0400)] 
gitk: sort by ref type on the 'tags and heads' view

In the 'tags and heads' view, the list of refs was globally sorted,
which caused the local ref list to be split around other ref list types.

This change re-orders the view to be: local refs, remote refs, tags,
and then other refs.

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
13 days agogit-gui: remove ${NS} indirection for ttk
Mark Levedahl [Mon, 14 Jul 2025 16:15:49 +0000 (12:15 -0400)] 
git-gui: remove ${NS} indirection for ttk

git-gui uses ${NS} to switch between non-themed and themed widgets, with
${NS} == 'ttk' selecting the latter. As git-gui now always uses ttk,
this indirection is not needed. Remove it.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: always use themed widgets from ttk
Mark Levedahl [Wed, 21 May 2025 20:31:14 +0000 (16:31 -0400)] 
git-gui: always use themed widgets from ttk

git-gui optionally uses themed ui elements from ttk, but the full set of
ttk ui elements is always available with Tk 8.6.  Keeping code making
ttk use optional increases maintenance burden for no benefit.  Let's use
ttk always, allowing removal of alternate code paths in subsequent
patches.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: remove redundant check for Tk >= 8.5
Mark Levedahl [Sun, 18 Feb 2024 18:06:05 +0000 (13:06 -0500)] 
git-gui: remove redundant check for Tk >= 8.5

Since commit c80d7be5e1e0d, git-gui checks for the availability of ttk
before enabling its use, but this check is redundant as Tk >= 8.6 is
required.  Remove the redundant check.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: remove unreachable Tk 8.4 code
Mark Levedahl [Fri, 16 Feb 2024 23:24:06 +0000 (18:24 -0500)] 
git-gui: remove unreachable Tk 8.4 code

git-gui has remnant code to allow some drawing with Tk 8.4 predating the
addition of themed widgets. As git-gui requires Tk >= 8.6, this code can
never trigger. Remove it.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: remove unused git-version
Mark Levedahl [Tue, 13 Feb 2024 05:19:56 +0000 (00:19 -0500)] 
git-gui: remove unused git-version

git-version supports choosing different bodies of code passed into it,
rather than using the more traditional if/else construct typically used.
The only use of git-version in this mode was by its author in 2007, and
that code has been deleted.  So, delete this now unused function that
was mostly ignored.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: use git_init to create new repository dir
Mark Levedahl [Fri, 9 Feb 2024 22:58:04 +0000 (17:58 -0500)] 
git-gui: use git_init to create new repository dir

When creating a new repository, git-gui creates a directory, cds to it,
then runs git-init, but git-init learned to create and initialize the
directory in 1.6.5. git-gui requires git version >= 2.36, so teach
git-gui to use git-init's full capability.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: git-remote is always available
Mark Levedahl [Tue, 13 Feb 2024 05:13:45 +0000 (00:13 -0500)] 
git-gui: git-remote is always available

git-gui checks for git version >= 1.6.6 before enabling the remotes
menu. But git-gui requires git v2.36 or later, so git-remote is always
available.  Delete this check and always enable the menu.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: git merge understands --strategy=recursive
Mark Levedahl [Tue, 13 Feb 2024 05:13:10 +0000 (00:13 -0500)] 
git-gui: git merge understands --strategy=recursive

git-gui's merge driver includes code to invoke the recursive strategy
for merging prior to git v2.5 that added a simpler syntax. As git-gui
requires git v2.36 or later, let's delete the code targeting earlier
git.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: git-diff knows submodules and textconv
Mark Levedahl [Tue, 13 Feb 2024 05:11:32 +0000 (00:11 -0500)] 
git-gui: git-diff knows submodules and textconv

git-gui's diff functions avoid using textconv filters on git < 1.6.1, or
asking about submodules on version before 1.7.2, but git-gui requires
git >= v2.36.  So, remove this now obsolete code.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: git-blame understands -w and textconv
Mark Levedahl [Tue, 13 Feb 2024 05:09:02 +0000 (00:09 -0500)] 
git-gui: git-blame understands -w and textconv

git-gui uses alternate code paths for git versions < 1.7.2, avoiding use
of --ignore-all-space and textconv. git-gui requires git v2.36 or later,
so this alternate code is obsolete. Remove it.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: git rev-parse knows show_toplevel
Mark Levedahl [Tue, 13 Feb 2024 03:03:30 +0000 (22:03 -0500)] 
git-gui: git rev-parse knows show_toplevel

git-gui has its own code to determine the worktree root for git-versions
earlier than 1.7.0, where git rev-parse learned this function.  git-gui
requires git v2.36 or later, so delete the now obsolete alternate code.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
13 days agogit-gui: use git-branch --show-current
Mark Levedahl [Mon, 12 Feb 2024 19:42:05 +0000 (14:42 -0500)] 
git-gui: use git-branch --show-current

git-gui relies upon the files back-end to determine the current branch.
This does not support the newer reftables backend.  But, git-branch has
long supported --show-current to get this same information regardless of
backend cahnged.  So teach git-gui to use git-branch --show-current.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogit-gui: git-diff-index always knows submodules
Mark Levedahl [Sat, 5 Apr 2025 14:19:48 +0000 (10:19 -0400)] 
git-gui: git-diff-index always knows submodules

git-gui asks for submodule info only on git-versions >=1.72, which
introduced such capability. But, git-gui requires git version >= 2.36,
so this alternate code path is obsolete. Remove it.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogit-gui: git ls-files knows --exclude-standard
Mark Levedahl [Sat, 5 Apr 2025 14:18:06 +0000 (10:18 -0400)] 
git-gui: git ls-files knows --exclude-standard

git-gui includes code to implement ls-files for git versions prior to
1.63 that did not know --exclude-standard. But, git-gui now requires git
version >= 2.36, so remove the obsolete code.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogit-gui: Make TclTk 8.6 the minimum, allow 8.7
Mark Levedahl [Sat, 17 May 2025 02:25:17 +0000 (22:25 -0400)] 
git-gui: Make TclTk 8.6 the minimum, allow 8.7

git-gui requires that Tcl and Tk are 8.5, though the check using
'package require' allows 8.6. As git-gui runs under wish, both Tcl and
Tk are always available and of the same version, so only one need be
checked.

The 8.5 requirement is very outdated as the earliest Tcl currently
shipping on any supported OS is 8.6. 8.7 is in alpha test and is
generally compatible with 8.6, so should also be allowed.  Tcl 9.0 has
planned compatibility breaking changes so cannot be allowed.

Let's update the requirements to be 8.6 or 8.7, and check only on Tcl as
Tk will be the same version.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogit-gui: require git >= 2.36
Mark Levedahl [Tue, 13 Feb 2024 04:32:44 +0000 (23:32 -0500)] 
git-gui: require git >= 2.36

git-gui since commit d6967022 explicitly requires version >= 1.5.0, and
this coded requirement has never been changed. But, since 0730a5a3a
git-gui actually requires git 2.36, providing 'git hook run.' git-gui
throws an error if that command is not supported.

So, let's update the requirement checking code to 2.36, and throw a more
useful error if this is not met.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: choosefont - remove a stray debugging line
Johannes Sixt [Thu, 17 Jul 2025 11:11:55 +0000 (13:11 +0200)] 
gitk: choosefont - remove a stray debugging line

This output was added in d93f1713b0 ("gitk: Use themed tk widgets",
2009-04-17), we can assume, by accident.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2 weeks agogitk: allow horizontal commit-graph scrolling
Mark Levedahl [Tue, 27 May 2025 03:47:39 +0000 (23:47 -0400)] 
gitk: allow horizontal commit-graph scrolling

gitk commit 5fdcbb1390 ("gitk: Fixes for Mac OS X TkAqua", 2009-03-23),
adds horizontal scrolling of the commit graph pane on aqua, but not on
x11 or win32. Also, the horizontal scrolling is triggered by MouseWheel
events attached to any of the three panes, not just the commit graph
that is the only one that scrolls. It is unusual to scroll a widget that
is not under the mouse, many would consider this a bug. No horizontal
scrollbar is provided for this, so there is no real cue for the user
that horizontal scrolling is available. We removed this aqua only
feature by transitioning aqua to use the common MouseWheel bindings set.

Let's add this as a feature on all platforms, and use the same approach
for scaling scroll motion as we do elsewhere.  For horizontal scrolling,
honor only events received by the commit graph in conformance with
normal GUI design.  Vertical scrolling is unchanged, and events received
by any of the 3 panes continue to scroll all 3 in unison.

Per the ancient and long ignored CUA standards, we should add a
horizontal scrollbar to the commit-graph, but gitk's interface is
already very cluttered: adding a scrollbar to only one of these three
panes is difficult while maintaining common pane vertical size,
especially so considering the movable sash separating panes 1 & 2, and
will consume yet more space. So, leave this as a hidden feature, now
available on all platforms.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: update aqua scrolling for TclTk 8.6 / TIP171
Mark Levedahl [Tue, 3 Jun 2025 19:04:27 +0000 (15:04 -0400)] 
gitk: update aqua scrolling for TclTk 8.6 / TIP171

Tk provides MouseWheel events to aqua, similar to win32. But, these
events on aqua have a nominal motion value (%D) of 1, not 120 as on
win32. gitk on aqua provides specific bindings only for the top 3 panes,
giving a nominal scrolling amount of +/- 1 for all events. gitk includes
a hidden feature providing horizontal scrolling of the commit graph,
added in 5fdcbb1390 ("gitk: Fixes for Mac OS X TkAqua", 2009-03-23).
This horizontal scrolling is triggered by mouse events in any of the top
3 panes, and thus violates normal gui design where the object under the
mouse cursor scrolls.

Let's update this using the common bindings in 'proc bind_mousewheel',
allowing user preferences on motion scaling to apply to all windows.
The commit graph scrolling feature is removed by this, and will be added
back for all platforms in a later commit.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: update x11 scrolling for TclTk 8.6 / TIP 171
Mark Levedahl [Fri, 6 Jun 2025 04:03:33 +0000 (00:03 -0400)] 
gitk: update x11 scrolling for TclTk 8.6 / TIP 171

gitk has x11 mouse bindings that receive button presses, not MouseWheel
events, as this is the Tk implementation through Tk 8.6. On x11, gitk
translates each button event to a scrolling value of +/- 5 for the upper
three panes that scroll vertically as one unit. gitk applies similar
scaling for horizontal scaling of the lower-left commit details pane
(ctext), but not for vertical scrolling of either of the bottom panes.
Rather, the Tk default scrolling actions are used for vertical
scrolling.

Let's make X11 behave similarly to the just modified win32 platform. Do
so by connecting vertical and horizontal scrolling events for the same
items bound in 'proc bind_mousewheel' and using the same user preference
values.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: update win32 scrolling for Tk 8.6 / TIP 171
Mark Levedahl [Sat, 6 Jul 2024 15:08:32 +0000 (11:08 -0400)] 
gitk: update win32 scrolling for Tk 8.6 / TIP 171

gitk on win32 binds windows_mousewheel_redirector to all MouseWheel
events in the main window. This proc determines the widget under the
cursor, then determines what scroll command to give, possibly none, and
issues scroll commands to the widget. The top panes get only vertical
scroll events, as does the lower right Patch/Tree pane. All others get
both vertical and horizontal events. These are all hard coded at +/-
five lines.

We now have common MouseWheel event bindings that follow user
preferences for the scrolling amount, bind for only the five main
display widgets, and leave the other gui elements untouched. Let's use
this instead. With the scrolling preference set at 5, the users should
not notice much, if any, difference.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: mousewheel scrolling functions for Tk 8.6
Mark Levedahl [Fri, 6 Jun 2025 01:45:22 +0000 (21:45 -0400)] 
gitk: mousewheel scrolling functions for Tk 8.6

gitk supports scrolling of 5 windows, but does this differently on the
aqua, x11, and win32 platforms as Tk provides different events on each.
TIP 171 removes some differences on win32 while altering the required
bindings on x11. TIP 474, which is in Tk 8.7 and later, finally unifies
all platforms on using common MouseWheel bindings. Importantly for now,
TIP 171 causes delivery of MouseWheel events to the widget under the
mouse cursor on win32, eliminating the need for completely different
bindings on win32.

Let's make some common functions to unify as much as we can in Tk 8.6.
Examining the platforms shows that the default platform scrolling is
overridden differently on the 3 platforms, and the nominal amount of
motion achieved per mouse wheel "click" is different. win32 nominally
makes everything move 5 lines per click, aqua 1 line per click, and x11
is a mixture. Part of this is due to win32 overriding all scroll events,
while x11 and aqua override smaller sets. Also, note that the text
widgets (the lower two panes) always scroll by 2-3 lines when given a
smaller scroll amount, while the upper three canvas objects follow the
requested scrolling value more accurately.

First, let's have a common routine to calculate the scroll value to give
to a widget in an event. This accounts for the user preference, the
scale of the %D (delta) value given by the event (120 on win32, 1 on
aqua, assumed 1 on x11), and must always be integer. Include negation as
by convention the screen moves opposite to the MouseWheel delta. Allow
setting an offset value to account for the larger minimum scrolling of
text widgets.

Second, let's have a common declaration of MouseWheel event bindings, as
those are shared by all in Tcl9, and by aqua/win32 earlier. Bind all
five display windows here. Note that the Patch/Tree widget (cflist)
cannot scroll horizontally.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: wheel scrolling multiplier preference
Mark Levedahl [Tue, 3 Jun 2025 11:36:44 +0000 (07:36 -0400)] 
gitk: wheel scrolling multiplier preference

gitk provides scrolling of several windows, uses hard-coded values for
the amount of scrolling, and these values differ across platforms and
widgets. The nominal value used is either 1 text line per mouse /
touchpad / button event, or 5 lines. Furthermore, Tk does not scroll
text widgets by 1 line when told to, this usually gets 2-3 lines of
motion. The upper canvas objects holding the commit graph do scroll as
defined. But, clearly no value is universally preferred, so let's give
the user some control over this. Provide a single multiplier to be
applied for all scroll bindings, with a value of 3 to mean the default
nominal value of 3 line. This is selected both as a compromise between
the various defaults across platforms, and because it is the smallest
value honored by the two text widgets on the bottom of the screen.

Later commits will connect this variable for actual scrolling events.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: separate x11 / win32 / aqua Mouse bindings
Mark Levedahl [Sat, 6 Jul 2024 17:12:01 +0000 (13:12 -0400)] 
gitk: separate x11 / win32 / aqua Mouse bindings

Tk through 8.6 has different approaches for handling mouse wheel /
touchpad scrolling events on the different platforms, and gitk has
separate code for these. But, some x11 bindings are applied on aqua as
we do not have these in a clean if / then / else tree based upon
platform.  Let's split these bindings apart.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: remove non-ttk support code
Mark Levedahl [Sun, 8 Jun 2025 12:53:49 +0000 (08:53 -0400)] 
gitk: remove non-ttk support code

gitk has code and variables to use the earlier non-themed widget set,
but this code is now irrelevant as gitk now always uses ttk.  Clean this
up.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: replace ${NS} with ttk
Mark Levedahl [Sun, 8 Jun 2025 12:45:30 +0000 (08:45 -0400)] 
gitk: replace ${NS} with ttk

gitk uses ${NS} to select between the original Tk widgets and the newer
themed widgets in ttk.  As gitk uses only themed widgets from ttk::,
this indirection now serves no purpose, so let's switch to explicit use
of ttk:: via global search/replace. More simplification, including
removal of the NS variable, is kept for a later patch to keep this one
smaller.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: always use themed Tk (ttk)
Mark Levedahl [Sun, 8 Jun 2025 12:16:34 +0000 (08:16 -0400)] 
gitk: always use themed Tk (ttk)

gitk added the option to used themed Tk (ttk) in 0cc08ff7dd ("gitk: Add
a user preference to enable/disable use of themed widgets", 2009-09-05).
Using ttk had to be optional as Tk 8.4, then in common use, does not
have ttk. ttk is the default when available, so the ttk code paths are
by now very well tested. gitk also has code paths for the older default
widgets, increasing the maintenance burden. Let's make ttk non-optional
to reduce code complexity in later commits.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: use $config_variables as list for save/restore
Mark Levedahl [Tue, 3 Jun 2025 20:17:15 +0000 (16:17 -0400)] 
gitk: use $config_variables as list for save/restore

gitk includes many user defined configuration variables, has all of
these are listed in $config_variables. But this list is not used to
define the variables to be loaded, saved, or restored when cancelling
the configuration dialog, and developers must maintain separate lists of
variables for these purposes. This leads to unnecessary errors and merge
conflicts. Let's replace those separate lists with $config_variables to
make maintenance easier.

While we are on topic, sort the list of names in $config_variables.
This makes it simpler to scan and has fewer chances of conflicts
when new names are introduced.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogit-gui: Add support of SHA256 repo
Takashi Iwai [Wed, 16 Jul 2025 07:32:25 +0000 (09:32 +0200)] 
git-gui: Add support of SHA256 repo

This patch adds the basic support of SHA256 Git repositories.
Most of changes are idiomatic replacement of the hard-coded hash ID
length, but there are subtle things:

* The hash length is determined on startup, and stored in $hashlength
  global variable (either 40 or 64).
* The hard-coded "40" are replaced with $hashlength;
  for regexp patterns, the ugly string map is used.
* Some code have the fixed numbers like 39 and 45, and those are
  replaced with the $hashlength and the offset correction.
* $nullid and $nullid2 are generated for the hash length.

A caveat is that repository picker dialog is performed before
evaluating the repo type, hence $hashlength isn't set there yet.
So the code dealing with the hard-coded "40" are handled differently;
namely, the regexp range is expanded, and the null id is generated
from the HEAD id length locally.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2 weeks agoThe eleventh batch
Junio C Hamano [Wed, 16 Jul 2025 16:42:12 +0000 (09:42 -0700)] 
The eleventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'ag/doc-send-email'
Junio C Hamano [Wed, 16 Jul 2025 16:42:28 +0000 (09:42 -0700)] 
Merge branch 'ag/doc-send-email'

Documentation updates for "git send-email".

* ag/doc-send-email:
  docs: mention possible options for Proton Mail users
  docs: add a paragraph explaining the `sendmailCmd` option of sendemail
  docs: add an OAuth2.0 credential helper for AOL accounts
  docs: add outlookidfix config option to sendemail documentation
  docs: link OpenSSL's verify(1) manual page to know about -CAfile and -CApath options

2 weeks agoMerge branch 'rs/parse-options-precision'
Junio C Hamano [Wed, 16 Jul 2025 16:42:28 +0000 (09:42 -0700)] 
Merge branch 'rs/parse-options-precision'

Define .precision to more canned parse-options type to avoid bugs
coming from using a variable with a wrong type to capture the
parsed values.

* rs/parse-options-precision:
  parse-options: add precision handling for OPTION_COUNTUP
  parse-options: add precision handling for OPTION_BITOP
  parse-options: add precision handling for OPTION_NEGBIT
  parse-options: add precision handling for OPTION_BIT
  parse-options: add precision handling for OPTION_SET_INT
  parse-options: add precision handling for PARSE_OPT_CMDMODE
  parse-options: require PARSE_OPT_NOARG for OPTION_BITOP

2 weeks agoMerge branch 'ps/doc-pack-refs-auto-with-files-backend-fix'
Junio C Hamano [Wed, 16 Jul 2025 16:42:28 +0000 (09:42 -0700)] 
Merge branch 'ps/doc-pack-refs-auto-with-files-backend-fix'

Doc update.

* ps/doc-pack-refs-auto-with-files-backend-fix:
  docs/git-pack-refs: document heuristic used for packing loose refs

2 weeks agoMerge branch 'ps/refs-files-remove-empty-parent'
Junio C Hamano [Wed, 16 Jul 2025 16:42:27 +0000 (09:42 -0700)] 
Merge branch 'ps/refs-files-remove-empty-parent'

When a ref creation at refs/heads/foo/bar fails, the files backend
now removes refs/heads/foo/ if the directory is otherwise not used.

* ps/refs-files-remove-empty-parent:
  refs/files: remove empty parent dirs when ref creation fails

2 weeks agoMerge branch 'ps/t1006-tap-fix'
Junio C Hamano [Wed, 16 Jul 2025 16:42:27 +0000 (09:42 -0700)] 
Merge branch 'ps/t1006-tap-fix'

Test fix.

* ps/t1006-tap-fix:
  t1006: fix broken TAP format

2 weeks agoMerge branch 'ph/fetch-prune-optim'
Junio C Hamano [Wed, 16 Jul 2025 16:42:26 +0000 (09:42 -0700)] 
Merge branch 'ph/fetch-prune-optim'

"git fetch --prune" used to be O(n^2) expensive when there are many
refs, which has been corrected.

* ph/fetch-prune-optim:
  clean up interface for refs_warn_dangling_symrefs
  refs: remove old refs_warn_dangling_symref
  fetch-prune: optimize dangling-ref reporting

2 weeks agogit-gui: Replace null_sha1 with nullid
Takashi Iwai [Wed, 16 Jul 2025 07:32:24 +0000 (09:32 +0200)] 
git-gui: Replace null_sha1 with nullid

Both $nullid and $null_sha1 point to the same content.
Use only $nullid consistently.

This is a preliminary cleanup for adding the support of SHA256 repo.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2 weeks agogitk: remove implementations for Tcl/Tk < 8.6
Mark Levedahl [Mon, 19 May 2025 16:54:32 +0000 (12:54 -0400)] 
gitk: remove implementations for Tcl/Tk < 8.6

gitk includes code specifically for Tcl 8.4 and 8.5, but the requirement
is now for at least 8.6. Remove the now unusable code targeting earlier
Tcl.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: Make TclTk 8.6 the minimum, allow 8.7
Mark Levedahl [Sun, 13 Jul 2025 20:10:33 +0000 (16:10 -0400)] 
gitk: Make TclTk 8.6 the minimum, allow 8.7

gitk runs under wish so naturally has Tcl and Tk available and of the
same version. gitk sets a requirement on Tk version >= 8.4: this is very
outdated, and the earliest Tcl currently shipping on any supported OS is
8.6. As 8.7 is in alpha test and is generally compatible with 8.6, we
should allow 8.7. Tcl 9.0 has planned compatibility breaking changes so
is not yet supported.

Let's change the requirements to 8.6-8.7, but not 9.0. Place this at the
top of file so the requirements are obvious.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: remove code targeting git <= 1.7.2
Mark Levedahl [Thu, 5 Jun 2025 21:18:19 +0000 (17:18 -0400)] 
gitk: remove code targeting git <= 1.7.2

gitk has a few code fragments that are used only for git versions <=
1.7.2 that do not support submodules, notes, word differences, or
textconv filters. We just set the minimum git version higher than 1.7.2
so these code fragments have no effect. Delete them.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agogitk: require git >= 2.20
Mark Levedahl [Thu, 5 Jun 2025 21:09:02 +0000 (17:09 -0400)] 
gitk: require git >= 2.20

gitk has alternate code paths for early git up to 1.72, and has no
defined minimum version. Setting any version > 1.72 as minimum will
allow removing those code paths.

The recent set of advisories published for git, gitk, and git-gui add
updates for v2.43 and later, but Debian has buster withgit 2.20 still
available.  While Debian would be responsible for backporting any fixes
to such an early version, we have no good reason preclude it.
So, make 2.20 the minimum required git version.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
2 weeks agoThe tenth batch
Junio C Hamano [Tue, 15 Jul 2025 22:17:58 +0000 (15:17 -0700)] 
The tenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'ly/load-bitmap-leakfix'
Junio C Hamano [Tue, 15 Jul 2025 22:18:18 +0000 (15:18 -0700)] 
Merge branch 'ly/load-bitmap-leakfix'

Leakfix with a new and a bit invasive test.

* ly/load-bitmap-leakfix:
  pack-bitmap: add load corrupt bitmap test
  pack-bitmap: reword comments in test_bitmap_commits()
  pack-bitmap: fix memory leak if load_bitmap() failed

2 weeks agoMerge branch 'ps/object-store'
Junio C Hamano [Tue, 15 Jul 2025 22:18:17 +0000 (15:18 -0700)] 
Merge branch 'ps/object-store'

Code clean-up around object access API.

* ps/object-store:
  odb: rename `read_object_with_reference()`
  odb: rename `pretend_object_file()`
  odb: rename `has_object()`
  odb: rename `repo_read_object_file()`
  odb: rename `oid_object_info()`
  odb: trivial refactorings to get rid of `the_repository`
  odb: get rid of `the_repository` when handling submodule sources
  odb: get rid of `the_repository` when handling the primary source
  odb: get rid of `the_repository` in `for_each()` functions
  odb: get rid of `the_repository` when handling alternates
  odb: get rid of `the_repository` in `odb_mkstemp()`
  odb: get rid of `the_repository` in `assert_oid_type()`
  odb: get rid of `the_repository` in `find_odb()`
  odb: introduce parent pointers
  object-store: rename files to "odb.{c,h}"
  object-store: rename `object_directory` to `odb_source`
  object-store: rename `raw_object_store` to `object_database`

2 weeks agobloom: optimize multiple pathspec items in revision
Lidong Yan [Tue, 15 Jul 2025 02:56:22 +0000 (10:56 +0800)] 
bloom: optimize multiple pathspec items in revision

To enable optimize multiple pathspec items in revision traversal,
return 0 if all pathspec item is literal in forbid_bloom_filters().
Add for loops to initialize and check each pathspec item's bloom_keyvec
when optimization is possible.

Add new test cases in t/t4216-log-bloom.sh to ensure
 - consistent results between the optimization for multiple pathspec
   items using bloom filter and the case without bloom filter
   optimization.
 - does not use bloom filter if any pathspec item is not literal.

With these optimizations, we get some improvements for multi-pathspec runs
of 'git log'. First, in the Git repository we see these modest results:

Benchmark 1: old
 Time (mean ± σ):      73.1 ms ±   2.9 ms
 Range (min … max):    69.9 ms …  84.5 ms    42 runs

Benchmark 2: new
 Time (mean ± σ):      55.1 ms ±   2.9 ms
 Range (min … max):    51.1 ms …  61.2 ms    52 runs

Summary
 'new' ran
   1.33 ± 0.09 times faster than 'old'

But in a larger repo, such as the LLVM project repo below, we get even
better results:

Benchmark 1: old
 Time (mean ± σ):      1.974 s ±  0.006 s
 Range (min … max):    1.960 s …  1.983 s    10 runs

Benchmark 2: new
 Time (mean ± σ):     262.9 ms ±   2.4 ms
 Range (min … max):   257.7 ms … 266.2 ms    11 runs

Summary
 'new' ran
   7.51 ± 0.07 times faster than 'old'

Signed-off-by: Derrick Stolee <stolee@gmail.com>
[ly: rename convert_pathspec_to_filter() to convert_pathspec_to_bloom_keyvec()]
Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoThe ninth batch
Junio C Hamano [Mon, 14 Jul 2025 18:18:42 +0000 (11:18 -0700)] 
The ninth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'rp/apply-intent-to-add-fix'
Junio C Hamano [Mon, 14 Jul 2025 18:19:29 +0000 (11:19 -0700)] 
Merge branch 'rp/apply-intent-to-add-fix'

"git apply -N" should start from the current index and register
only new files, but it instead started from an empty index, which
has been corrected.

* rp/apply-intent-to-add-fix:
  apply docs: clarify wording for --intent-to-add
  t4140: test apply --intent-to-add interactions
  apply: only write intents to add for new files
  apply: read in the index in --intent-to-add mode

2 weeks agoMerge branch 'sj/string-list'
Junio C Hamano [Mon, 14 Jul 2025 18:19:28 +0000 (11:19 -0700)] 
Merge branch 'sj/string-list'

Code and test clean-up around string-list API.

* sj/string-list:
  u-string-list: move "remove duplicates" test to "u-string-list.c"
  u-string-list: move "filter string" test to "u-string-list.c"
  u-string-list: move "test_split_in_place" to "u-string-list.c"
  u-string-list: move "test_split" into "u-string-list.c"
  string-list: enable sign compare warnings check
  string-list: return index directly when inserting an existing element
  string-list: remove unused "insert_at" parameter from add_entry
  string-list: fix sign compare warnings for loop iterator

2 weeks agoMerge branch 'rj/freebsd-sysinfo-build-fix'
Junio C Hamano [Mon, 14 Jul 2025 18:19:28 +0000 (11:19 -0700)] 
Merge branch 'rj/freebsd-sysinfo-build-fix'

Build fix for FreeBSD.

* rj/freebsd-sysinfo-build-fix:
  build: fix FreeBSD build when sysinfo compat library installed

2 weeks agoMerge branch 'ts/merge-orig-head-doc-fix'
Junio C Hamano [Mon, 14 Jul 2025 18:19:27 +0000 (11:19 -0700)] 
Merge branch 'ts/merge-orig-head-doc-fix'

Doc fix.

* ts/merge-orig-head-doc-fix:
  docs: correct ORIG_HEAD example in "git merge" documentation

2 weeks agoMerge branch 'ps/perlless-test-fixes'
Junio C Hamano [Mon, 14 Jul 2025 18:19:27 +0000 (11:19 -0700)] 
Merge branch 'ps/perlless-test-fixes'

Test fixes.

* ps/perlless-test-fixes:
  t5333: fix missing terminator for sed(1) 's' command
  t4150: fix warning printed by awk due to escaped '\@'

2 weeks agoMerge branch 're/ssh-sign-buffer-fix'
Junio C Hamano [Mon, 14 Jul 2025 18:19:26 +0000 (11:19 -0700)] 
Merge branch 're/ssh-sign-buffer-fix'

Tempfile removal fix in the codepath to sign commits with SSH keys.

* re/ssh-sign-buffer-fix:
  ssh signing: don't detach the filename strbuf from key_file tempfile

2 weeks agoMerge branch 'hy/read-cache-lock-error-fix'
Junio C Hamano [Mon, 14 Jul 2025 18:19:26 +0000 (11:19 -0700)] 
Merge branch 'hy/read-cache-lock-error-fix'

A failure to open the index file for writing due to conflicting
access did not state what went wrong, which has been corrected.

* hy/read-cache-lock-error-fix:
  read-cache: report lock error when refreshing index

2 weeks agoMerge branch 'kn/clang-format-updates'
Junio C Hamano [Mon, 14 Jul 2025 18:19:26 +0000 (11:19 -0700)] 
Merge branch 'kn/clang-format-updates'

Update ".clang-format" and ".editorconfig" to match our style guide
a bit better.

* kn/clang-format-updates:
  meson: add rule to run 'git clang-format'
  clang-format: add 'RemoveBracesLLVM' to the main config
  clang-format: set 'ColumnLimit' to 0

2 weeks agoMerge branch 'kh/doc-config-subcommands'
Junio C Hamano [Mon, 14 Jul 2025 18:19:25 +0000 (11:19 -0700)] 
Merge branch 'kh/doc-config-subcommands'

Documentation updates.

* kh/doc-config-subcommands:
  config: mention --url in the synopsis
  config: use --value instead of value-pattern
  config: document --[no-]value
  config: use --value=<pattern> consistently
  config: document --[no-]show-names

2 weeks agoMerge branch 'mc/netrc-service-names'
Junio C Hamano [Mon, 14 Jul 2025 18:19:25 +0000 (11:19 -0700)] 
Merge branch 'mc/netrc-service-names'

"netrc" credential helper has been improved to understand textual
service names (like smtp) in addition to the numeric port numbers
(like 25).

* mc/netrc-service-names:
  contrib: better support symbolic port names in git-credential-netrc
  contrib: warn for invalid netrc file ports in git-credential-netrc
  contrib: use a more portable shebang for git-credential-netrc

2 weeks agoMerge branch 'jc/coccicheck-fails-make-when-it-fails'
Junio C Hamano [Mon, 14 Jul 2025 18:19:24 +0000 (11:19 -0700)] 
Merge branch 'jc/coccicheck-fails-make-when-it-fails'

"make coccicheck" succeeds even when spatch made suggestions, which
has been updated to fail in such a case.

* jc/coccicheck-fails-make-when-it-fails:
  coccicheck: fail "make" when it fails

2 weeks agoMerge branch 'ps/use-reftable-as-default-in-3.0'
Junio C Hamano [Mon, 14 Jul 2025 18:19:24 +0000 (11:19 -0700)] 
Merge branch 'ps/use-reftable-as-default-in-3.0'

The reftable ref backend has matured enough; Git 3.0 will make it
the default format in a newly created repositories by default.

* ps/use-reftable-as-default-in-3.0:
  setup: use "reftable" format when experimental features are enabled
  BreakingChanges: announce switch to "reftable" format

2 weeks agoMerge branch 'jk/all-negative-diff-filter-fix'
Junio C Hamano [Mon, 14 Jul 2025 18:19:24 +0000 (11:19 -0700)] 
Merge branch 'jk/all-negative-diff-filter-fix'

A diff-filter with negative-only specification like "git log
--diff-filter=d" did not trigger correctly, which has been fixed.

* jk/all-negative-diff-filter-fix:
  setup_revisions(): turn on diffs for all-negative diff filter

2 weeks agoMerge branch 'ac/prune-wo-the-repository'
Junio C Hamano [Mon, 14 Jul 2025 18:19:23 +0000 (11:19 -0700)] 
Merge branch 'ac/prune-wo-the-repository'

Some code paths in the "git prune" used to ignore passed in
repository object and used the_repository singleton instance
instead, which has been corrected.

* ac/prune-wo-the-repository:
  builtin/prune: stop depending on 'the_repository'
  repository: move 'repository_format_precious_objects' to repo scope

2 weeks agoMerge branch 'bs/config-mak-freebsd'
Junio C Hamano [Mon, 14 Jul 2025 18:19:23 +0000 (11:19 -0700)] 
Merge branch 'bs/config-mak-freebsd'

Drop FreeBSD 4 support and assume we are at least at FreeBSD 6 with
memmem() supported.

* bs/config-mak-freebsd:
  build: retire NO_UINTMAX_T
  config.mak.uname: set NO_MEMMEM only for functional version

2 weeks agoMerge branch 'cb/total-ram-bsd-fix'
Junio C Hamano [Mon, 14 Jul 2025 18:19:22 +0000 (11:19 -0700)] 
Merge branch 'cb/total-ram-bsd-fix'

Use of sysctl() system call to learn the total RAM size used on
BSDs has been corrected.

* cb/total-ram-bsd-fix:
  builtin/gc: correct total_ram calculation with HAVE_BSD_SYSCTL

2 weeks agoMerge branch 'bs/remote-helpers-doc-markup-fix'
Junio C Hamano [Mon, 14 Jul 2025 18:19:22 +0000 (11:19 -0700)] 
Merge branch 'bs/remote-helpers-doc-markup-fix'

Docfix.

* bs/remote-helpers-doc-markup-fix:
  gitremote-helpers.adoc: fix formatting

2 weeks agogpg-interface: expand gpg.program as a path
Jonas Brandstötter [Fri, 11 Jul 2025 23:23:47 +0000 (01:23 +0200)] 
gpg-interface: expand gpg.program as a path

This allows using a custom gpg program under the user's home directory
by specifying a path starting with '~'

[gpg]
        program = "~/.local/bin/mygpg"

Signed-off-by: Jonas Brandstötter <jonas.brandstoetter@gmx.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agorevision: make helper for pathspec to bloom keyvec
Lidong Yan [Sat, 12 Jul 2025 09:35:16 +0000 (17:35 +0800)] 
revision: make helper for pathspec to bloom keyvec

When preparing to use bloom filters in a revision walk, Git populates a
boom_keyvec with an array of bloom keys for the components of a path.
Before we create the ability to map multiple pathspecs to multiple
bloom_keyvecs, extract the conversion from a pathspec to a bloom_keyvec
into its own helper method. This simplifies the state that persists in
prepare_to_use_bloom_filter() as well as makes the future change much
simpler.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agobloom: replace struct bloom_key * with struct bloom_keyvec
Lidong Yan [Sat, 12 Jul 2025 09:35:15 +0000 (17:35 +0800)] 
bloom: replace struct bloom_key * with struct bloom_keyvec

Previously, we stored bloom keys in a flat array and marked a commit
as NOT TREESAME if any key reported "definitely not changed".

To support multiple pathspec items, we now require that for each
pathspec item, there exists a bloom key reporting "definitely not
changed".

This "for every" condition makes a flat array insufficient, so we
introduce a new structure to group keys by a single pathspec item.
`struct bloom_keyvec` is introduced to replace `struct bloom_key *`
and `bloom_key_nr`. And because we want to support multiple pathspec
items, we added a bloom_keyvec * and a bloom_keyvec_nr field to
`struct rev_info` to represent an array of bloom_keyvecs. This commit
still optimize only one pathspec item, thus bloom_keyvec_nr can only
be 0 or 1.

New bloom_keyvec_* functions are added to create and destroy a keyvec.
bloom_filter_contains_vec() is added to check if all key in keyvec is
contained in a bloom filter.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agobloom: rename function operates on bloom_key
Lidong Yan [Sat, 12 Jul 2025 09:35:14 +0000 (17:35 +0800)] 
bloom: rename function operates on bloom_key

git code style requires that functions operating on a struct S
should be named in the form S_verb. However, the functions operating
on struct bloom_key do not follow this convention. Therefore,
fill_bloom_key() and clear_bloom_key() are renamed to bloom_key_fill()
and bloom_key_clear(), respectively.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agobloom: add test helper to return murmur3 hash
Lidong Yan [Sat, 12 Jul 2025 09:35:13 +0000 (17:35 +0800)] 
bloom: add test helper to return murmur3 hash

In bloom.h, murmur3_seeded_v2() is exported for the use of test murmur3
hash. To clarify that murmur3_seeded_v2() is exported solely for testing
purposes, a new helper function test_murmur3_seeded() was added instead
of exporting murmur3_seeded_v2() directly.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agogitk: Add support of SHA256 repositories
Takashi Iwai [Tue, 17 Jun 2025 05:59:54 +0000 (07:59 +0200)] 
gitk: Add support of SHA256 repositories

This patch adds a basic support of SHA256 Git repository to Gitk, so
that Gitk can show and operate on both SHA1 and SHA256 repos
gracefully.  Since SHA256 has a longer ID length (64 char) than SHA1
(40 char), many field widths are adjusted to fit with it.

A caveat is that the configuration of auto selection length is shared
between SHA1 and SHA256 repos.  That is, once when this value is saved
and read, it's applied to both repo types, which may result in shorter
selection than the full SHA256 ID.  We may introduce another
individual config for sha256 (actually I did write in the first
version), but for simplicity, the common config is used as of writing
this.

Many lines still refer "sha1" although they may point to both SHA1 and
SHA256.  They are left untouched for making the changes simpler.

This patch is based on the early work by Rostislav Krasny:
  https://patchwork.kernel.org/project/git/patch/pull.979.git.1623687519832.gitgitgadget@gmail.com
I refreshed, revised and extended to the latest state.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
3 weeks agoci: use Meson's new `--slice` option
Patrick Steinhardt [Wed, 9 Jul 2025 06:23:42 +0000 (08:23 +0200)] 
ci: use Meson's new `--slice` option

As executing our test suite is notoriously slow on Windows we use matrix
jobs in our CI systems to slice up tests and run them via multiple jobs.
On Meson this is done with a comparatively complex PowerShell invocation
as Meson didn't yet have a native way to slice tests like this.

I have upstreamed a new `--slice` option [1] that addresses this use
case though, which has been merged and released with Meson 1.8. Both
GitLab and GitHub CI have Meson 1.8.2 available by now, so let's update
the jobs to use that new option.

[1]: https://github.com/mesonbuild/meson/pull/14092

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agomeson: update subproject wrappers
Patrick Steinhardt [Wed, 9 Jul 2025 06:23:41 +0000 (08:23 +0200)] 
meson: update subproject wrappers

Update subproject wrappers to newer versions by executing `meson wrap
update` in the project's root directory

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agodoc: correct doc for glob pathspec
Russell Hanneken [Tue, 8 Jul 2025 02:45:07 +0000 (22:45 -0400)] 
doc: correct doc for glob pathspec

gitglossary documents Git pathspecs. One type of pathspec is the "glob"
pathspec, prefixed with the magic word "glob".

Regarding glob pathspecs, gitglossary says, '"**/foo" matches file or
directory "foo" anywhere, the same as pattern "foo".' That last phrase
('the same as pattern "foo") is incorrect. "**/foo" and "foo" are not
equivalent. "**/foo" matches foo anywhere, but "foo" does not.

This change removes the incorrect phrase from the glob pathspec doc.

Signed-off-by: Russell Hanneken <rhanneken@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>