]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
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

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

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>
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 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 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 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 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>
3 weeks agodaemon: use sigaction() to install child_handler()
Carlo Marcelo Arenas Belón [Thu, 10 Jul 2025 19:45:43 +0000 (19:45 +0000)] 
daemon: use sigaction() to install child_handler()

Replace signal() with an equivalent invocation of sigaction(), but
make sure to NOT set SA_RESTART so the original code that expects
to be interrupted when children complete still works as designed.

This change has the added benefit of using BSD signal semantics reliably
and therefore not needing the rearming call in the signal handler.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agocompat/mingw: allow sigaction(SIGCHLD)
Carlo Marcelo Arenas Belón [Thu, 10 Jul 2025 19:45:42 +0000 (19:45 +0000)] 
compat/mingw: allow sigaction(SIGCHLD)

A future change will start using sigaction to setup a SIGCHLD signal
handler.

The current code uses signal(), which returns SIG_ERR (but doesn't
seem to set errno) so instruct sigaction() to do the same.

A new SA flag will be needed, so copy the one from Cygwin; note that
the sigaction() implementation that is provided won't use it, so
its value is otherwise irrelevant.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoparse-options: add precision handling for OPTION_COUNTUP
René Scharfe [Wed, 9 Jul 2025 09:46:28 +0000 (11:46 +0200)] 
parse-options: add precision handling for OPTION_COUNTUP

Similar to 09705696f7 (parse-options: introduce precision handling for
`OPTION_INTEGER`, 2025-04-17) support value variables of different sizes
for OPTION_COUNTUP.  Do that by requiring their "precision" to be set,
casting their "value" pointer accordingly and checking whether the value
fits.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoparse-options: add precision handling for OPTION_BITOP
René Scharfe [Wed, 9 Jul 2025 09:46:20 +0000 (11:46 +0200)] 
parse-options: add precision handling for OPTION_BITOP

Similar to 09705696f7 (parse-options: introduce precision handling for
`OPTION_INTEGER`, 2025-04-17) support value variables of different sizes
for OPTION_BITOP.  Do that by requiring their "precision" to be set,
casting their "value" pointer accordingly and checking whether the value
fits.

Check if "devfal" fits into an integer variable with the given
"precision", but don't check "extra", as its value is only used to clear
bits, so cannot lead to an overflow.  Not checking continues to allow
e.g., using -1 to clear all bits even if the value variable has a
narrower type than intptr_t.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoparse-options: add precision handling for OPTION_NEGBIT
René Scharfe [Wed, 9 Jul 2025 09:45:53 +0000 (11:45 +0200)] 
parse-options: add precision handling for OPTION_NEGBIT

Similar to 09705696f7 (parse-options: introduce precision handling for
`OPTION_INTEGER`, 2025-04-17) support value variables of different sizes
for OPTION_NEGBIT.  Do that by requiring their "precision" to be set,
casting their "value" pointer accordingly and checking whether the value
fits.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoparse-options: add precision handling for OPTION_BIT
René Scharfe [Wed, 9 Jul 2025 09:45:33 +0000 (11:45 +0200)] 
parse-options: add precision handling for OPTION_BIT

Similar to 09705696f7 (parse-options: introduce precision handling for
`OPTION_INTEGER`, 2025-04-17) support value variables of different sizes
for OPTION_BIT.  Do that by requiring their "precision" to be set,
casting their "value" pointer accordingly and checking whether the value
fits.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoparse-options: add precision handling for OPTION_SET_INT
René Scharfe [Wed, 9 Jul 2025 09:45:24 +0000 (11:45 +0200)] 
parse-options: add precision handling for OPTION_SET_INT

Similar to 09705696f7 (parse-options: introduce precision handling for
`OPTION_INTEGER`, 2025-04-17) support value variables of different sizes
for OPTION_SET_INT.  Do that by requiring their "precision" to be set,
casting their "value" pointer accordingly and checking whether the value
fits.

Factor out the casting code from the part of do_get_value() that handles
OPTION_INTEGER to avoid code duplication.  We're going to use it in the
next patches as well.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoparse-options: add precision handling for PARSE_OPT_CMDMODE
René Scharfe [Wed, 9 Jul 2025 09:45:14 +0000 (11:45 +0200)] 
parse-options: add precision handling for PARSE_OPT_CMDMODE

Build on 09705696f7 (parse-options: introduce precision handling for
`OPTION_INTEGER`, 2025-04-17) to support value variables of different
sizes for PARSE_OPT_CMDMODE options.  Do that by requiring their
"precision" to be set and casting their "value" pointer accordingly.

Call the function that does the raw casting do_get_int_value() to
reserve the name get_int_value() for a more friendly wrapper we're
going to introduce in one of the next patches.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoparse-options: require PARSE_OPT_NOARG for OPTION_BITOP
René Scharfe [Wed, 9 Jul 2025 09:44:09 +0000 (11:44 +0200)] 
parse-options: require PARSE_OPT_NOARG for OPTION_BITOP

OPTION_BITOP options don't take arguments.  Make sure they are declared
that way using the flag PARSE_OPT_NOARG.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agomeson: fix lookup of shell on MINGW64
Patrick Steinhardt [Wed, 9 Jul 2025 06:23:39 +0000 (08:23 +0200)] 
meson: fix lookup of shell on MINGW64

In 4cba20fbdc6 (meson: prefer shell at "/bin/sh", 2025-04-25) we have
addressed an issue where the shell path embedded into Git was looked up
via PATH, which easily led to unportable shell paths other than the
usual "/bin/sh" location. The fix was to simply add '/bin' to the search
path explicitly, which made us prefer that directory over the PATH-based
lookup.

This fix causes issues on MINGW64 though, which uses Windows-style
paths. "/bin" is not an absolute Windows-style path, but Meson expects
the directories to be absolute. This leads to the following error:

    meson.build:248:15: ERROR: Search directory /bin is not an absolute path.

Fix this by instead searching for both '/bin/sh' and 'sh', which also
causes us to prefer '/bin/sh' over a PATH-based lookup. Meson does
accept that path alright on MINGW64, even though it's not an absolute
Windows-style path, either.

Furthermore, this continues to work alright with cross-files, as well,
in case one wants to explicitly override the shell path:

    $ meson setup build
    ...
      Runtime executable paths
        perl       : /nix/store/gy10hw004rl2xfbfq41vnw0yb1w8rvbl-perl-5.40.0/bin/perl
        python     : /nix/store/sd81bvmch7njdpwx3lkjslixcbj5mivz-python3-3.13.4/bin/python3
        shell      : /bin/sh

    $ cat >cross.ini <<-EOF
    [binaries]
    sh = '/nix/store/94lg0shvsfc845zy8gnflvpqxxiyijbz-bash-interactive-5.2p37/bin/bash'
    EOF

    $ meson setup build --cross-file=cross.ini --wipe
    ...
      Runtime executable paths
        perl       : /nix/store/gy10hw004rl2xfbfq41vnw0yb1w8rvbl-perl-5.40.0/bin/perl
        python     : /nix/store/sd81bvmch7njdpwx3lkjslixcbj5mivz-python3-3.13.4/bin/python3
        shell      : /nix/store/94lg0shvsfc845zy8gnflvpqxxiyijbz-bash-interactive-5.2p37/bin/bash

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

The `manpage_target` variable isn't used at all, and the `manpage_path`
variable is only used in a single location. Remove the former variable
and inline the latter.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agomeson: improve summary of auto-detected features
Patrick Steinhardt [Wed, 9 Jul 2025 06:23:37 +0000 (08:23 +0200)] 
meson: improve summary of auto-detected features

The summary of auto-detected features prints a boolean for every option
to tell the user whether or not the feature has been auto-enabled or
not. This summary can be improved though, as in some cases this boolean
is derived from a dependency. So if we pass in the dependency directly,
then Meson knows to both print a boolean and, if the dependency was
found, it also prints a version number.

Adapt the code accordingly and enable `bool_yn` so that actual booleans
are formatted similarly to dependencies. Before this change:

  Auto-detected features
    benchmarks      : true
    curl            : true
    expat           : true
    gettext         : true
    gitweb          : true
    iconv           : true
    pcre2           : true
    perl            : true
    python          : true

And after this change, we now see the version numbers as expected:

  Auto-detected features
    benchmarks      : YES
    curl            : YES 8.14.1
    expat           : YES 2.7.1
    gettext         : YES
    gitweb          : YES
    iconv           : YES
    pcre2           : YES 10.44
    perl            : YES
    python          : YES

Note that this change also enables colorization of the boolean options,
green for "YES" and red for "NO".

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agomeson: stop printing 'https' option twice in our summaries
Patrick Steinhardt [Wed, 9 Jul 2025 06:23:36 +0000 (08:23 +0200)] 
meson: stop printing 'https' option twice in our summaries

The value for the 'https' backend option is printed twice: once via the
summary of auto-detected features and once via our summary of backends.
Drop it from the former summary.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agomeson: stop discovering native version of Python
Patrick Steinhardt [Wed, 9 Jul 2025 06:23:35 +0000 (08:23 +0200)] 
meson: stop discovering native version of Python

When Python features are enabled we search both for a native and
non-native version of Python. This is wrong though: we don't use Python
in our build process, so there is no need to search for it in the first
place.

There is one location where we use the native version of Python, namely
when deciding whether or not we want to wire up git-p4(1). This check is
invalid though, as we shouldn't check for the build host to have Python,
but for the target host.

Fix this invalid check to use the non-native version of Python and stop
searching for a native version of Python altogether.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoremote: detect collisions in remote names
Jeff King [Tue, 8 Jul 2025 22:59:46 +0000 (18:59 -0400)] 
remote: detect collisions in remote names

When two remotes collide in the destinations of their fetch refspecs,
the results can be confusing. For example, in this silly example:

  git config remote.one.url [...]
  git config remote.one.fetch +refs/heads/*:refs/remotes/collide/*
  git config remote.two.url [...]
  git config remote.two.fetch +refs/heads/*:refs/remotes/collide/*
  git fetch --all

we may try to write to the same ref twice (once for each remote we're
fetching). There's also a more subtle version of this. If you have
remotes "outer/inner" and "outer", then the ref "inner/branch" on the
second remote will conflict with just "branch" on the former (they both
want to write to "refs/remotes/outer/inner/branch").

We probably don't want to forbid this kind of overlap completely. While
the results can be confusing, there are legitimate reasons to have
multiple refs write into the same namespace (e.g., if one is a "backup"
of the other that is rarely fetched from).

But it may be worth limiting the porcelain "git remote" command to avoid
this confusion. The example above cannot be done with "git remote",
because it always[1] matches the refspecs to the remote name, and you
can only have one instance of each remote name. But you can still
trigger the more subtle variant like this:

  git remote add outer [...]
  git remote add outer/inner [...]

So let's detect that kind of name collision (in both directions) and
forbid it. You can still do whatever you like by manipulating the config
directly, but this should prevent the most obvious foot-gun.

[1] Almost always. With the --mirror option, the resulting refspec will
    just write into "refs/*"; the remote name does not appear in the ref
    namespace at all.

    Our new "names must not overlap" rule is not necessary for that
    case, but it seems reasonable to enforce it consistently. We already
    require all remote names to be valid in the ref namespace, even
    though we won't ever use them in that context for --mirror remotes.

    Likewise, our new rule doesn't help with overlap here. Any two
    mirror remotes will always overlap (in fact, any mirror remote along
    with any other single one, since refs/remotes/ is a subset of the
    mirrored refs). I'm not sure this is worth worrying about, but if it
    is, we'd want an additional rule like "mirror remotes must be the
    only remote".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoThe eighth batch
Junio C Hamano [Tue, 8 Jul 2025 22:51:23 +0000 (15:51 -0700)] 
The eighth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoMerge branch 'kn/fetch-push-bulk-ref-update'
Junio C Hamano [Tue, 8 Jul 2025 22:49:19 +0000 (15:49 -0700)] 
Merge branch 'kn/fetch-push-bulk-ref-update'

"git push" and "git fetch" are taught to update refs in batches to
gain performance.

* kn/fetch-push-bulk-ref-update:
  receive-pack: handle reference deletions separately
  refs/files: skip updates with errors in batched updates
  receive-pack: use batched reference updates
  send-pack: fix memory leak around duplicate refs
  fetch: use batched reference updates
  refs: add function to translate errors to strings

3 weeks agoMerge branch 'maint-2.50'
Junio C Hamano [Tue, 8 Jul 2025 22:43:31 +0000 (15:43 -0700)] 
Merge branch 'maint-2.50'

* maint-2.50:
  t: avoid git config syntax from newer releases
  Documentation/RelNotes: use .adoc extension for new security releases

3 weeks agoMerge branch 'maint-2.49' into maint-2.50 maint
Junio C Hamano [Tue, 8 Jul 2025 22:42:33 +0000 (15:42 -0700)] 
Merge branch 'maint-2.49' into maint-2.50

* maint-2.49:
  t: avoid git config syntax from newer releases

3 weeks agoMerge branch 'maint-2.48' into maint-2.49
Junio C Hamano [Tue, 8 Jul 2025 22:42:14 +0000 (15:42 -0700)] 
Merge branch 'maint-2.48' into maint-2.49

* maint-2.48:
  t: avoid git config syntax from newer releases

3 weeks agoMerge branch 'maint-2.47' into maint-2.48
Junio C Hamano [Tue, 8 Jul 2025 22:42:02 +0000 (15:42 -0700)] 
Merge branch 'maint-2.47' into maint-2.48

* maint-2.47:
  t: avoid git config syntax from newer releases

3 weeks agoMerge branch 'maint-2.46' into maint-2.47
Junio C Hamano [Tue, 8 Jul 2025 22:41:51 +0000 (15:41 -0700)] 
Merge branch 'maint-2.46' into maint-2.47

* maint-2.46:
  t: avoid git config syntax from newer releases

3 weeks agoMerge branch 'maint-2.45' into maint-2.46
Junio C Hamano [Tue, 8 Jul 2025 22:40:52 +0000 (15:40 -0700)] 
Merge branch 'maint-2.45' into maint-2.46

This turns into a no-op merge, since more recent versions of Git
newer than 2.46 track do support the newer "git config" syntax.

* maint-2.45:
  t: avoid git config syntax from newer releases

3 weeks agoMerge branch 'maint-2.44' into maint-2.45
Junio C Hamano [Tue, 8 Jul 2025 22:35:35 +0000 (15:35 -0700)] 
Merge branch 'maint-2.44' into maint-2.45

* maint-2.44:
  t: avoid git config syntax from newer releases

3 weeks agoMerge branch 'maint-2.43' into maint-2.44
Junio C Hamano [Tue, 8 Jul 2025 22:33:02 +0000 (15:33 -0700)] 
Merge branch 'maint-2.43' into maint-2.44

* maint-2.43:
  t: avoid git config syntax from newer releases

3 weeks agoMerge branch 'tz/avoid-newer-config-syntax-in-older-maint-tracks' into maint-2.43
Junio C Hamano [Tue, 8 Jul 2025 22:31:56 +0000 (15:31 -0700)] 
Merge branch 'tz/avoid-newer-config-syntax-in-older-maint-tracks' into maint-2.43

* tz/avoid-newer-config-syntax-in-older-maint-tracks:
  t: avoid git config syntax from newer releases

3 weeks agot: avoid git config syntax from newer releases
Todd Zullinger [Tue, 8 Jul 2025 21:05:27 +0000 (17:05 -0400)] 
t: avoid git config syntax from newer releases

In a recent security release, 05e9cd64ee (config: quote values
containing CR character, 2025-05-19) added calls to `git config get`,
`git config set`, and `git config unset` which are not present on the
maint-2.43 branch.

These subcommands were added in the following commits, released in
git-2.46.0:

  4e51389000 (builtin/config: introduce "get" subcommand, 2024-05-06),
  00bbdde141 (builtin/config: introduce "set" subcommand, 2024-05-06),
  95ea69c67b (builtin/config: introduce "unset" subcommand, 2024-05-06)

Revert to the previous `git config` syntax for older maintenance
branches.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agot1006: fix broken TAP format
Patrick Steinhardt [Tue, 8 Jul 2025 10:18:58 +0000 (12:18 +0200)] 
t1006: fix broken TAP format

When running t1006 via Meson we receive an error about invalid TAP
format:

    $ meson test t1006-cat-file
    1/1 t1006-cat-file        OK              3.86s   420 subtests passed

    stdout: 147: UNKNOWN: c308ae01840d8e620ad554ee5d77fe114dc2d912:path with spaces
    stdout: 159: UNKNOWN: 3625298bf5e7c464a7d0e38ea80c2a5b5904d9a3e5b2b025b67f360e09b68dc7:path with spaces
    ERROR: Unknown TAP output lines for a supported TAP version.
    This is probably a bug in the test; if they are not TAP syntax, prefix them with a #

    Ok:                1
    Fail:              0

While Meson copes with it alright, it's still annoying to see these
errors on every test run.

The root cause of the broken format is a call to grep(1) that gets
executed outside of a test case, which has been added recently via
9fd38038b9c (t1006: update 'run_tests' to test generic object
specifiers, 2025-06-02). This call is done to determine whether a
subsequent test case is expected to succeed or fail, so it makes sense
to have it execute outside of a test case. But whenever we do that, we
must be extra careful to not generate any output that breaks the TAP
format.

Fix the issue by adding '-q' to the command so that it doesn't print
any matching lines.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agorefs/files: remove empty parent dirs when ref creation fails
Patrick Steinhardt [Tue, 8 Jul 2025 10:19:54 +0000 (12:19 +0200)] 
refs/files: remove empty parent dirs when ref creation fails

When creating a new reference in the "files" backend we first create the
directory hierarchy for that reference, then create the lockfile for
that reference, and finally rename the lockfile into place. When the
transaction gets aborted we prune the lockfile, but we don't clean up
the directory hierarchy that we may have created for the lockfile.

In some egde cases this can lead to lots of empty directories being
cluttered in the ".git/refs" directory that really serve no purpose at
all. We know to prune such empty directories when packing refs, but that
only patches over the issue.

Improve this by removing empty parents when cleaning up still-locked
references in `files_transaction_cleanup()`. This function is also
called when preparing or committing the transaction, so this change also
helps when not explicitly aborting the transaction.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agodocs/git-pack-refs: document heuristic used for packing loose refs
Patrick Steinhardt [Tue, 8 Jul 2025 11:23:56 +0000 (13:23 +0200)] 
docs/git-pack-refs: document heuristic used for packing loose refs

The `git pack-refs --auto` flag asks the ref backend to decide for
itself whether or not references need to be repacked. This is done to
ensure that we don't repack in cases where the backend is already in a
good-enough state, which is typically the case for the "reftable"
backend that performs auto-compaction on writes.

As such, we initially only had heuristics in place for the "reftable"
backend. The "files" backend didn't have any heuristics, so we'd repack
loose references every time `git pack-refs --auto` was executed. This
caused excessive repacking with that backend though, which is why we
eventually implemented a heuristic via c3459ae9ef2 (refs/files: use
heuristic to decide whether to repack with `--auto`, 2024-09-04).

The documentation for the `--auto` flag hasn't been updated accordingly
and still claims that we don't have any metrics for the "files" backend.
Update it to reflect the new reality.

Reported-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoMerge branch 'maint-2.49' into maint-2.50
Junio C Hamano [Tue, 8 Jul 2025 20:04:39 +0000 (13:04 -0700)] 
Merge branch 'maint-2.49' into maint-2.50

* maint-2.49:
  Documentation/RelNotes: use .adoc extension for new security releases

3 weeks agoDocumentation/RelNotes: use .adoc extension for new security releases
Taylor Blau [Tue, 8 Jul 2025 18:47:50 +0000 (14:47 -0400)] 
Documentation/RelNotes: use .adoc extension for new security releases

When preparing the latest round of security fixes, we wrote release
notes in v2.43.7, and then successively merged those up through to the
various 'maint' branches.

However, the 2.49 release series is the first to have commit 1f010d6bdf
(doc: use .adoc extension for AsciiDoc files, 2025-01-20). This means
that we should have renamed the new-but-historical release notes from
*.txt to *.adoc during the merge into the 'maint-2.49' branch, but
neglected to do so.

Rename them accordingly to match the convention introduced by
1f010d6bdf. Since the release materials in question here were prepared
before v2.50.0 was tagged, the 'maint' track for that release series is
OK as is.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoMerge branch 'js/fix-open-exec'
Johannes Sixt [Tue, 8 Jul 2025 19:00:34 +0000 (21:00 +0200)] 
Merge branch 'js/fix-open-exec'

This addresses CVE-2025-27613, Gitk can create and truncate a user's
files:

When a user clones an untrusted repository and runs gitk without
additional command arguments, files for which the user has write
permission can be created and truncated. The option "Support per-file
encoding" must have been enabled before in Gitk's Preferences.  This
option is disabled by default.

The same happens when "Show origin of this line" is used in the main
window (regardless of whether "Support per-file encoding" is enabled or
not).

* js/fix-open-exec:
  gitk: sanitize 'open' arguments: revisit recently updated 'open' calls
  gitk: sanitize 'open' arguments: command pipeline
  gitk: collect construction of blameargs into a single conditional
  gitk: sanitize 'open' arguments: simple commands, readable and writable
  gitk: sanitize 'open' arguments: simple commands with redirections
  gitk: sanitize 'open' arguments: simple commands
  gitk: sanitize 'exec' arguments: redirect to process
  gitk: sanitize 'exec' arguments: redirections and background
  gitk: sanitize 'exec' arguments: redirections
  gitk: sanitize 'exec' arguments: 'eval exec'
  gitk: sanitize 'exec' arguments: simple cases
  gitk: have callers of diffcmd supply pipe symbol when necessary
  gitk: treat file names beginning with "|" as relative paths

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
3 weeks agoMerge branch 'ah/fix-open-with-stdin'
Johannes Sixt [Tue, 8 Jul 2025 18:46:24 +0000 (20:46 +0200)] 
Merge branch 'ah/fix-open-with-stdin'

This addresses CVE-2025-27614, Arbitrary command execution with Gitk:

A Git repository can be crafted in such a way that with some social
engineering a user who has cloned the repository can be tricked into
running any script (e.g., Bourne shell, Perl, Python, ...) supplied by
the attacker by invoking `gitk filename`, where `filename` has a
particular structure. The script is run with the privileges of the user.

* ah/fix-open-with-stdin:
  gitk: encode arguments correctly with "open"

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