Commit Graph

80347 Commits

Author SHA1 Message Date
Junio C Hamano
5cd91b9cc4 Merge branch 'gi/doc-boolean-config-typofix' into jch
Doc typofix.

* gi/doc-boolean-config-typofix:
  doc: add missing space on git-config page
2026-03-25 13:03:22 -07:00
Junio C Hamano
456304070f Merge branch 'mr/merge-file-object-id-worktree-fix' into jch
merge-file --object-id used to trigger a BUG when run in a linked
worktree, which has been fixed.

* mr/merge-file-object-id-worktree-fix:
  merge-file: fix BUG when --object-id is used in a worktree
2026-03-25 13:03:22 -07:00
Junio C Hamano
726e91e3c8 Merge branch 'rs/prio-queue-to-commit-stack' into jch
Uses of prio_queue as a LIFO stack of commits have been written
with commit_stack.

* rs/prio-queue-to-commit-stack:
  use commit_stack instead of prio_queue in LIFO mode
2026-03-25 13:03:21 -07:00
Junio C Hamano
b3964a5c9f Merge branch 'ps/build-tweaks' into jch
Tweak the build infrastructure by moving tools around.

* ps/build-tweaks:
  meson: precompile "git-compat-util.h"
  meson: compile compatibility sources separately
  git-compat-util.h: move warning infra to prepare for PCHs
  builds: move build scripts into "tools/"
  contrib: move "update-unicode.sh" script into "tools/"
  contrib: move "coverage-diff.sh" script into "tools/"
  contrib: move "coccinelle/" directory into "tools/"
  Introduce new "tools/" directory
2026-03-25 13:03:21 -07:00
Junio C Hamano
fc98b4f8c5 Merge branch 'jk/diff-highlight-identical-pairs' into jch
The handling of the incomplete lines at the end by "git
diff-highlight" has been fixed.

* jk/diff-highlight-identical-pairs:
  contrib/diff-highlight: do not highlight identical pairs
2026-03-25 13:03:21 -07:00
Junio C Hamano
41688c1a23 The 21st batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-25 12:58:05 -07:00
Junio C Hamano
8e2964dc89 Merge branch 'ps/object-counting'
The logic to count objects has been cleaned up.

* ps/object-counting:
  odb: introduce generic object counting
  odb/source: introduce generic object counting
  object-file: generalize counting objects
  object-file: extract logic to approximate object count
  packfile: extract logic to count number of objects
  odb: stop including "odb/source.h"
2026-03-25 12:58:05 -07:00
Junio C Hamano
105a22cf69 Merge branch 'tb/incremental-midx-part-3.2'
Further work on incremental repacking using MIDX/bitmap

* tb/incremental-midx-part-3.2:
  midx: enable reachability bitmaps during MIDX compaction
  midx: implement MIDX compaction
  t/helper/test-read-midx.c: plug memory leak when selecting layer
  midx-write.c: factor fanout layering from `compute_sorted_entries()`
  midx-write.c: enumerate `pack_int_id` values directly
  midx-write.c: extract `fill_pack_from_midx()`
  midx-write.c: introduce `midx_pack_perm()` helper
  midx: do not require packs to be sorted in lexicographic order
  midx-write.c: introduce `struct write_midx_opts`
  midx-write.c: don't use `pack_perm` when assigning `bitmap_pos`
  t/t5319-multi-pack-index.sh: fix copy-and-paste error in t5319.39
  git-multi-pack-index(1): align SYNOPSIS with 'git multi-pack-index -h'
  git-multi-pack-index(1): remove non-existent incompatibility
  builtin/multi-pack-index.c: make '--progress' a common option
  midx: introduce `midx_get_checksum_hex()`
  midx: rename `get_midx_checksum()` to `midx_get_checksum_hash()`
  midx: mark `get_midx_checksum()` arguments as const
2026-03-25 12:58:04 -07:00
Junio C Hamano
ce74208c2f The 20th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-24 12:31:34 -07:00
Junio C Hamano
253ddb6016 Merge branch 'dd/cocci-do-not-pass-strbuf-by-value'
Add a coccinelle rule to break the build when "struct strbuf" gets
passed by value.

* dd/cocci-do-not-pass-strbuf-by-value:
  stash: do not pass strbuf by value
  coccinelle: detect struct strbuf passed by value
2026-03-24 12:31:34 -07:00
Junio C Hamano
c006399b73 Merge branch 'ty/doc-diff-u-wo-number'
"git diff -U<num>" was too lenient in its command line parsing and
took an empty string as a valid <num>.

* ty/doc-diff-u-wo-number:
  diff: document -U without <n> as using default context
2026-03-24 12:31:34 -07:00
Junio C Hamano
8023abc632 Merge branch 'ps/upload-pack-buffer-more-writes'
Reduce system overhead "git upload-pack" spends on relaying "git
pack-objects" output to the "git fetch" running on the other end of
the connection.

* ps/upload-pack-buffer-more-writes:
  builtin/pack-objects: reduce lock contention when writing packfile data
  csum-file: drop `hashfd_throughput()`
  csum-file: introduce `hashfd_ext()`
  sideband: use writev(3p) to send pktlines
  wrapper: introduce writev(3p) wrappers
  compat/posix: introduce writev(3p) wrapper
  upload-pack: reduce lock contention when writing packfile data
  upload-pack: prefer flushing data over sending keepalive
  upload-pack: adapt keepalives based on buffering
  upload-pack: fix debug statement when flushing packfile data
2026-03-24 12:31:34 -07:00
Junio C Hamano
231f8100c4 Merge branch 'yc/histogram-hunk-shift-fix'
The final clean-up phase of the diff output could turn the result of
histogram diff algorithm suboptimal, which has been corrected.

* yc/histogram-hunk-shift-fix:
  xdiff: re-diff shifted change groups when using histogram algorithm
2026-03-24 12:31:34 -07:00
Junio C Hamano
7f13e5c8c7 Merge branch 'mf/t0008-cleanup'
Test clean-up.

* mf/t0008-cleanup:
  t0008: improve test cleanup to fix failing test
2026-03-24 12:31:33 -07:00
Junio C Hamano
448cea8de0 Merge branch 'pb/t4200-test-path-is-helpers'
Test clean-up.

* pb/t4200-test-path-is-helpers:
  t4200: convert test -[df] checks to test_path_* helpers
2026-03-24 12:31:33 -07:00
Junio C Hamano
067ee91920 Merge branch 'jk/transport-color-leakfix'
Leakfix.

* jk/transport-color-leakfix:
  transport: plug leaks in transport_color_config()
2026-03-24 12:31:33 -07:00
Junio C Hamano
b9c55cff8a Merge branch 'rj/pack-refs-tests-path-is-helpers'
Test updates.

* rj/pack-refs-tests-path-is-helpers:
  t/pack-refs-tests: use test_path_is_missing
2026-03-24 12:31:33 -07:00
Junio C Hamano
9d9cd3830f Merge branch 'ps/clar-wo-path-max'
Clar (unit testing framework) update from the upstream.

* ps/clar-wo-path-max:
  clar: update to fix compilation on platforms without PATH_MAX
2026-03-24 12:31:32 -07:00
Junio C Hamano
04a7124af0 Merge branch 'gj/user-manual-fix-grep-example'
Fix an example in the user-manual.

* gj/user-manual-fix-grep-example:
  doc: fix git grep args order in Quick Reference
2026-03-24 12:31:32 -07:00
Junio C Hamano
49e6a7cd63 Merge branch 'ps/history-split'
"git history" learned the "split" subcommand.

* ps/history-split:
  builtin/history: implement "split" subcommand
  builtin/history: split out extended function to create commits
  cache-tree: allow writing in-memory index as tree
  add-patch: allow disabling editing of hunks
  add-patch: add support for in-memory index patching
  add-patch: remove dependency on "add-interactive" subsystem
  add-patch: split out `struct interactive_options`
  add-patch: split out header from "add-interactive.h"
2026-03-24 12:31:32 -07:00
Junio C Hamano
dd33e738a4 Merge branch 'ss/t0410-delete-object-cleanup'
Test clean-up.

* ss/t0410-delete-object-cleanup:
  t0410: modernize delete_object helper
2026-03-24 12:31:32 -07:00
Junio C Hamano
410ab9a257 Merge branch 'jt/fast-import-sign-again'
"git fast-import" learned to optionally replace signature on
commits whose signatures get invalidated due to replaying by
signing afresh.

* jt/fast-import-sign-again:
  fast-import: add mode to sign commits with invalid signatures
  gpg-interface: allow sign_buffer() to use default signing key
  commit: remove unused forward declaration
2026-03-24 12:31:31 -07:00
Junio C Hamano
1080981ddb The 19th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-23 09:20:31 -07:00
Junio C Hamano
04b3115bd8 Merge branch 'ty/mktree-wo-the-repository'
Code clean-up.

* ty/mktree-wo-the-repository:
  builtin/mktree: remove USE_THE_REPOSITORY_VARIABLE
2026-03-23 09:20:31 -07:00
Junio C Hamano
74137b733e Merge branch 'bb/imap-send-openssl-4.0-prep'
"imap-send" used to use functions whose use is going to be removed
with OpenSSL 4.0; rewrite them using public API that has been
available since OpenSSL 1.1 since 2016 or so.

* bb/imap-send-openssl-4.0-prep:
  imap-send: move common code into function host_matches()
  imap-send: use the OpenSSL API to access the subject common name
  imap-send: use the OpenSSL API to access the subject alternative names
2026-03-23 09:20:31 -07:00
Junio C Hamano
133a880df6 Merge branch 'ac/help-sort-correctly'
The code in "git help" that shows configuration items in sorted
order was awkwardly organized and prone to bugs.

* ac/help-sort-correctly:
  help: cleanup the contruction of keys_uniq
2026-03-23 09:20:30 -07:00
Junio C Hamano
05f91df704 Merge branch 'jc/test-allow-sed-with-ere'
Adjust test-lint to allow "sed -E" to use ERE in the patterns.

* jc/test-allow-sed-with-ere:
  t: allow use of "sed -E"
2026-03-23 09:20:30 -07:00
Junio C Hamano
859132edb9 Merge branch 'ng/submodule-default-remote'
Instead of hardcoded 'origin', use the configured default remote
when fetching from submodules.

* ng/submodule-default-remote:
  submodule: fetch missing objects from default remote
2026-03-23 09:20:30 -07:00
Junio C Hamano
d10d042656 Merge branch 'ms/t7605-test-path-is-helpers'
Test updates.

* ms/t7605-test-path-is-helpers:
  t7605: use test_path_is_file instead of test -f
2026-03-23 09:20:30 -07:00
Junio C Hamano
651847f5bc Merge branch 'cf/constness-fixes'
Small code clean-up around the constness area.

* cf/constness-fixes:
  dir: avoid -Wdiscarded-qualifiers in remove_path()
  bloom: remove a misleading const qualifier
2026-03-23 09:20:29 -07:00
Junio C Hamano
6e8d538aab Merge branch 'master' of https://github.com/j6t/git-gui
* 'master' of https://github.com/j6t/git-gui:
  git-gui: grey out comment lines in commit message
  git-gui: wire up "git-gui--askyesno" with Meson
  git-gui: massage "git-gui--askyesno" with "generate-script.sh"
  git-gui: prefer shell at "/bin/sh" with Meson
  git-gui: fix use of GIT_CEILING_DIRECTORIES
  git-gui: shift tabstops to account for the first column of patch text
2026-03-21 09:25:58 -07:00
Junio C Hamano
b70a02dcc9 Merge branch 'master' of https://github.com/j6t/gitk
* 'master' of https://github.com/j6t/gitk:
  gitk: l10n: make PO headers identify the Gitk project
  gitk: ignore generated POT file
  gitk: i18n: use "Gitk" as package name in POT file
  gitk: commit translation files without file information
  gitk: support link color in the Preferences dialog
  gitk: use config settings for head/tag colors
2026-03-21 09:25:10 -07:00
Johannes Sixt
c8c5df79df Merge branch 'jx/i18n-fix' of github.com:jiangxin/gitk
* 'jx/i18n-fix' of github.com:jiangxin/gitk:
  gitk: l10n: make PO headers identify the Gitk project
  gitk: ignore generated POT file
  gitk: i18n: use "Gitk" as package name in POT file

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2026-03-20 09:23:32 +01:00
Johannes Sixt
056fb617f6 Merge branch 'js/i18n-no-location'
* js/i18n-no-location:
  gitk: commit translation files without file information
2026-03-20 09:20:29 +01:00
Johannes Sixt
696e001e12 Merge branch 'sb/heed-ref-decoration-settings'
* sb/heed-ref-decoration-settings:
  gitk: use config settings for head/tag colors
2026-03-20 09:07:09 +01:00
Jeff King
598f40c4b3 contrib/diff-highlight: do not highlight identical pairs
We pair lines for highlighting based on their position in the hunk. So
we should never see two identical lines paired, like:

  -one
  -two
  +one
  +something else

which would pair -one/+one, because that implies that the diff could
easily be shrunk by turning line "one" into context.

But there is (at least) one exception: removing a newline at the end of
a file will produce a diff like:

  -foo
  +foo
  \No newline at end of file

And we will pair those two lines. As a result, we end up marking the
whole line, including the newline, as the shared prefix. And there's an
empty suffix.

The most obvious bug here is that when we try to print the highlighted
lines, we remove the trailing newline from the suffix, but do not bother
with the prefix (under the assumption that there had to be a difference
_somewhere_ in the line, and thus the prefix would not eat all the way
up to the newline). And so you get an extra line like:

  -foo

  +foo

  \No newline at end of file

This is obviously ugly, but also causes interactive.diffFilter to
(rightly) complain that the input and output do not match their lines
1-to-1.

This could easily be fixed by chomping the prefix, too, but I think the
problem is deeper. For one, I suspect some of the other logic gets
confused by forming an array with zero-indexed element "3" in a
3-element array. But more importantly, we try not to highlight whole
lines, as there's nothing interesting to show there. So let's catch this
early in is_pair_interesting() and bail to our usual passthrough
strategy.

Reported-by: Scott Baker <scott@perturb.org>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-19 22:29:14 -07:00
Jiang Xin
e0f3d08b9b gitk: l10n: make PO headers identify the Gitk project
Commit f697d08 (gitk: i18n: use "Gitk" as package name in POT file,
2026-03-19) updated the generated POT template to use "Gitk" in its
Project-Id-Version header. Several existing PO files still carry older
header values such as "git" or "git-gui", so they do not consistently
identify themselves as Gitk translations.

Update the Project-Id-Version field in all Gitk PO files so that they
identify the Gitk project consistently.

The "Project-Id-Version" field in the PO header helps tools identify
which project a PO file belongs to. For example, Git's
"git-po-helper" uses it to choose project-specific checks and POT
handling rules. Without this change, some Gitk PO files are
misidentified because their headers still refer to other projects.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-03-20 09:42:03 +08:00
Jiang Xin
cc10508b18 gitk: ignore generated POT file
"po/gitk.pot" is generated from the source for translation maintenance.
Ignore it in the working tree so regenerating the template does not
introduce unnecessary noise in `git status`.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-03-20 09:31:04 +08:00
Jiang Xin
f697d08df7 gitk: i18n: use "Gitk" as package name in POT file
Use "Gitk" instead of the placeholder "PACKAGE" in the header of the
generated po/gitk.pot file. In particular, the "Project-Id-Version"
field in the header entry should be set to:

    "Project-Id-Version: Gitk\n"

New PO files generated from this POT file will inherit that package
name.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-03-20 09:31:04 +08:00
Junio C Hamano
7ff1e8dc1e The 18th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-19 09:54:57 -07:00
Junio C Hamano
39267c8a7e Merge branch 'ss/submodule--helper-use-xmalloc'
Code clean-up.

* ss/submodule--helper-use-xmalloc:
  submodule--helper: replace malloc with xmalloc
2026-03-19 09:54:57 -07:00
Junio C Hamano
80595ab08e Merge branch 'ps/unit-test-c-escape-names.txt'
The unit test helper function was taught to use backslash +
mnemonic notation for certain control characters like "\t", instead
of octal notation like "\011".

* ps/unit-test-c-escape-names.txt:
  test-lib: print escape sequence names
2026-03-19 09:54:56 -07:00
Junio C Hamano
5a0ee6f793 Merge branch 'jc/doc-wholesale-replace-before-next'
Doc update.

* jc/doc-wholesale-replace-before-next:
  SubmittingPatches: spell out "replace fully to pretend to be perfect"
2026-03-19 09:54:56 -07:00
Junio C Hamano
accd0e107b Merge branch 'lc/rebase-trailer'
"git rebase" learns "--trailer" command to drive the
interpret-trailers machinery.

* lc/rebase-trailer:
  rebase: support --trailer
  commit, tag: parse --trailer with OPT_STRVEC
  trailer: append trailers without fork/exec
  trailer: libify a couple of functions
  interpret-trailers: refactor create_in_place_tempfile()
  interpret-trailers: factor trailer rewriting
2026-03-19 09:54:56 -07:00
Junio C Hamano
a7a079c2c4 Merge branch 'bk/run-command-wo-the-repository'
The run_command() API lost its implicit dependencyon the singleton
`the_repository` instance.

* bk/run-command-wo-the-repository:
  run-command: wean auto_maintenance() functions off the_repository
  run-command: wean start_command() off the_repository
2026-03-19 09:54:56 -07:00
Junio C Hamano
2ca397fa7c Merge branch 'ps/editorconfig-unanchor'
Editorconfig filename patterns were specified incorrectly, making
many source files inside subdirectories unaffected, which has been
corrected.

* ps/editorconfig-unanchor:
  editorconfig: fix style not applying to subdirs anymore
2026-03-19 09:54:55 -07:00
Junio C Hamano
432282f9cb Merge branch 'ss/t3200-test-zero-oid'
A test now uses the symbolic constant $ZERO_OID instead of 40 "0" to
work better with SHA-256 as well as SHA-1.

* ss/t3200-test-zero-oid:
  t3200: replace hardcoded null OID with $ZERO_OID
2026-03-19 09:54:55 -07:00
Junio C Hamano
17b9c759bd Merge branch 'dd/list-objects-filter-options-wo-strbuf-split'
The way combined list-object filter options are parsed has been
revamped.

* dd/list-objects-filter-options-wo-strbuf-split:
  list-objects-filter-options: avoid strbuf_split_str()
  worktree: do not pass strbuf by value
2026-03-19 09:54:55 -07:00
Junio C Hamano
2d576325c3 Merge branch 'ps/t9200-test-path-is-helpers'
Test update.

* ps/t9200-test-path-is-helpers:
  t9200: replace test -f with modern path helper
  t9200: handle missing CVS with skip_all
2026-03-19 09:54:55 -07:00
Patrick Steinhardt
671df48df8 meson: precompile "git-compat-util.h"
Every compilation unit in Git is expected to include "git-compat-util.h"
first, either directly or indirectly via "builtin.h". This header papers
over differences between platforms so that we can expect the typical
POSIX functions to exist. Furthermore, it provides functionality that we
end up using everywhere.

This header is thus quite heavy as a consequence. Preprocessing it as a
standalone unit via `clang -E git-compat-util.h` yields over 23,000
lines of code overall. Naturally, it takes quite some time to compile
all of this.

Luckily, this is exactly the kind of use case that precompiled headers
aim to solve: instead of recompiling it every single time, we compile it
once and then link the result into the executable. If include guards are
set up properly it means that the file won't need to be reprocessed.

Set up such a precompiled header for "git-compat-util.h" and wire it up
via Meson. This causes Meson to implicitly include the precompiled
header in all compilation units. With GCC and Clang for example this is
done via the "-include" statement [1].

This leads to a significant speedup when performing full builds:

  Benchmark 1: ninja (rev = HEAD~)
  Time (mean ± σ):     14.467 s ±  0.126 s    [User: 248.133 s, System: 31.298 s]
  Range (min … max):   14.195 s … 14.633 s    10 runs

  Benchmark 2: ninja (rev = HEAD)
    Time (mean ± σ):     10.307 s ±  0.111 s    [User: 173.290 s, System: 23.998 s]
    Range (min … max):   10.030 s … 10.433 s    10 runs

  Summary
    ninja (rev = HEAD) ran
      1.40 ± 0.02 times faster than ninja (rev = HEAD~)

[1]: https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-19 06:40:09 -07:00