Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e8239f3
Merge branch 'kh/doc-patch-id-markup-fix' into kh/doc-patch-id-1
gitster Oct 10, 2025
8f487db
doc: patch-id: convert to the modern synopsis style
LemmingAvalanche Oct 13, 2025
8bca1c5
Merge branch 'tb/incremental-midx-part-3.1' into ps/maintenance-geome…
gitster Oct 21, 2025
134ec33
commit-reach: avoid commit_list_insert_by_date()
rscharfe Oct 24, 2025
a7f01ac
Merge branch 'ly/diff-name-only-with-diff-from-content' into jk/diff-…
gitster Oct 24, 2025
57c2b6c
diff: send external diff output to diff_options.file
peff Oct 24, 2025
0152831
diff: drop save/restore of color_moved in dry-run mode
peff Oct 24, 2025
b2b5ad5
diff: replace diff_options.dry_run flag with NULL file
peff Oct 24, 2025
1ad2760
diff: drop dry-run redirection to /dev/null
peff Oct 24, 2025
2ecb885
diff: simplify run_external_diff() quiet logic
peff Oct 24, 2025
0ea94b0
builtin/gc: remove global `repack` variable
pks-t Oct 24, 2025
60c0af8
builtin/gc: make `too_many_loose_objects()` reusable without GC config
pks-t Oct 24, 2025
9bc1518
builtin/maintenance: introduce "geometric-repack" task
pks-t Oct 24, 2025
5c2ad50
builtin/maintenance: make the geometric factor configurable
pks-t Oct 24, 2025
d465be2
builtin/maintenance: don't silently ignore invalid strategy
pks-t Oct 24, 2025
e83e92e
builtin/maintenance: improve readability of strategies
pks-t Oct 24, 2025
6a7d3ee
builtin/maintenance: run maintenance tasks depending on type
pks-t Oct 24, 2025
0e994d9
builtin/maintenance: extend "maintenance.strategy" to manual maintenance
pks-t Oct 24, 2025
40a7415
builtin/maintenance: make "gc" strategy accessible
pks-t Oct 24, 2025
d9bccf2
builtin/maintenance: introduce "geometric" strategy
pks-t Oct 24, 2025
1376811
add-patch: quit without skipping undecided hunks
rscharfe Oct 25, 2025
9d6c580
match_pathname(): reorder prefix-match check
peff Oct 26, 2025
1940a02
match_pathname(): give fnmatch one char of prefix context
peff Oct 26, 2025
e56f6dc
add-patch: quit on EOF
rscharfe Oct 25, 2025
a426557
t7900: fix a flaky test due to git-repack always regenerating MIDX
pks-t Oct 27, 2025
18a7988
Merge branch 'rs/add-patch-quit'
gitster Nov 3, 2025
ecf2f52
Merge branch 'kh/doc-patch-id-1'
gitster Nov 3, 2025
5236467
Merge branch 'jk/match-pathname-fix'
gitster Nov 3, 2025
3cf3369
Merge branch 'ps/maintenance-geometric'
gitster Nov 3, 2025
249b0d3
Merge branch 'jk/diff-patch-dry-run-cleanup'
gitster Nov 3, 2025
a4b1a14
Merge branch 'rs/merge-base-optim'
gitster Nov 3, 2025
7f278e9
Git 2.52-rc0
gitster Nov 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Documentation/RelNotes/2.52.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ UI, Workflows & Features
* "Symlink symref" has been added to the list of things that will
disappear at Git 3.0 boundary.

* "git maintenance" command learns the "geometric" strategy where it
avoids doing maintenance tasks that rebuilds everything from
scratch.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -158,6 +162,9 @@ Performance, Internal Implementation, Development Support etc.
* Two slightly different ways to get at "all the packfiles" in API
has been cleaned up.

* The code to walk revision graph to compute merge base has been
optimized.


Fixes since v2.51
-----------------
Expand Down Expand Up @@ -382,6 +389,14 @@ including security updates, are included in this release.
and "git bisect unknown", which has been corrected.
(merge 2bb3a012f3 rz/bisect-help-unknown later to maint).

* The 'q'(uit) command in "git add -p" has been improved to quit
without doing any meaningless work before leaving, and giving EOF
(typically control-D) to the prompt is made to behave the same way.

* The wildmatch code had a corner case bug that mistakenly makes
"foo**/bar" match with "foobar", which has been corrected.
(merge 1940a02dc1 jk/match-pathname-fix later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 529a60a885 ua/t1517-short-help-tests later to maint).
(merge 22d421fed9 ac/deglobal-fmt-merge-log-config later to maint).
Expand All @@ -393,3 +408,4 @@ including security updates, are included in this release.
(merge a66fc22bf9 rs/get-oid-with-flags-cleanup later to maint).
(merge 15b8abde07 js/mingw-includes-cleanup later to maint).
(merge 2cebca0582 tb/cat-file-objectmode-update later to maint).
(merge 8f487db07a kh/doc-patch-id-1 later to maint).
49 changes: 41 additions & 8 deletions Documentation/config/maintenance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,36 @@ detach.

maintenance.strategy::
This string config option provides a way to specify one of a few
recommended schedules for background maintenance. This only affects
which tasks are run during `git maintenance run --schedule=X`
commands, provided no `--task=<task>` arguments are provided.
Further, if a `maintenance.<task>.schedule` config value is set,
then that value is used instead of the one provided by
`maintenance.strategy`. The possible strategy strings are:
recommended strategies for repository maintenance. This affects
which tasks are run during `git maintenance run`, provided no
`--task=<task>` arguments are provided. This setting impacts manual
maintenance, auto-maintenance as well as scheduled maintenance. The
tasks that run may be different depending on the maintenance type.
+
* `none`: This default setting implies no tasks are run at any schedule.
The maintenance strategy can be further tweaked by setting
`maintenance.<task>.enabled` and `maintenance.<task>.schedule`. If set, these
values are used instead of the defaults provided by `maintenance.strategy`.
+
The possible strategies are:
+
* `none`: This strategy implies no tasks are run at all. This is the default
strategy for scheduled maintenance.
* `gc`: This strategy runs the `gc` task. This is the default strategy for
manual maintenance.
* `geometric`: This strategy performs geometric repacking of packfiles and
keeps auxiliary data structures up-to-date. The strategy expires data in the
reflog and removes worktrees that cannot be located anymore. When the
geometric repacking strategy would decide to do an all-into-one repack, then
the strategy generates a cruft pack for all unreachable objects. Objects that
are already part of a cruft pack will be expired.
+
This repacking strategy is a full replacement for the `gc` strategy and is
recommended for large repositories.
* `incremental`: This setting optimizes for performing small maintenance
activities that do not delete any data. This does not schedule the `gc`
task, but runs the `prefetch` and `commit-graph` tasks hourly, the
`loose-objects` and `incremental-repack` tasks daily, and the `pack-refs`
task weekly.
task weekly. Manual repository maintenance uses the `gc` task.

maintenance.<task>.enabled::
This boolean config option controls whether the maintenance task
Expand Down Expand Up @@ -75,6 +92,22 @@ maintenance.incremental-repack.auto::
number of pack-files not in the multi-pack-index is at least the value
of `maintenance.incremental-repack.auto`. The default value is 10.

maintenance.geometric-repack.auto::
This integer config option controls how often the `geometric-repack`
task should be run as part of `git maintenance run --auto`. If zero,
then the `geometric-repack` task will not run with the `--auto`
option. A negative value will force the task to run every time.
Otherwise, a positive value implies the command should run either when
there are packfiles that need to be merged together to retain the
geometric progression, or when there are at least this many loose
objects that would be written into a new packfile. The default value is
100.

maintenance.geometric-repack.splitFactor::
This integer config option controls the factor used for the geometric
sequence. See the `--geometric=` option in linkgit:git-repack[1] for
more details. Defaults to `2`.

maintenance.reflog-expire.auto::
This integer config option controls how often the `reflog-expire` task
should be run as part of `git maintenance run --auto`. If zero, then
Expand Down
22 changes: 11 additions & 11 deletions Documentation/git-patch-id.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ git-patch-id - Compute unique ID for a patch

SYNOPSIS
--------
[verse]
'git patch-id' [--stable | --unstable | --verbatim]
[synopsis]
git patch-id [--stable | --unstable | --verbatim]

DESCRIPTION
-----------
Expand All @@ -21,7 +21,7 @@ the same time also reasonably unique, i.e., two patches that have the same

The main usecase for this command is to look for likely duplicate commits.

When dealing with 'git diff-tree' output, it takes advantage of
When dealing with `git diff-tree` output, it takes advantage of
the fact that the patch is prefixed with the object name of the
commit, and outputs two 40-byte hexadecimal strings. The first
string is the patch ID, and the second string is the commit ID.
Expand All @@ -30,35 +30,35 @@ This can be used to make a mapping from patch ID to commit ID.
OPTIONS
-------

--verbatim::
`--verbatim`::
Calculate the patch-id of the input as it is given, do not strip
any whitespace.
+
This is the default if patchid.verbatim is true.
This is the default if `patchid.verbatim` is `true`.

--stable::
`--stable`::
Use a "stable" sum of hashes as the patch ID. With this option:
+
--
- Reordering file diffs that make up a patch does not affect the ID.
In particular, two patches produced by comparing the same two trees
with two different settings for "-O<orderfile>" result in the same
with two different settings for `-O<orderfile>` result in the same
patch ID signature, thereby allowing the computed result to be used
as a key to index some meta-information about the change between
the two trees;

- Result is different from the value produced by git 1.9 and older
or produced when an "unstable" hash (see --unstable below) is
or produced when an "unstable" hash (see `--unstable` below) is
configured - even when used on a diff output taken without any use
of "-O<orderfile>", thereby making existing databases storing such
of `-O<orderfile>`, thereby making existing databases storing such
"unstable" or historical patch-ids unusable.

- All whitespace within the patch is ignored and does not affect the id.
--
+
This is the default if patchid.stable is set to true.
This is the default if `patchid.stable` is set to `true`.

--unstable::
`--unstable`::
Use an "unstable" hash as the patch ID. With this option,
the result produced is compatible with the patch-id value produced
by git 1.9 and older and whitespace is ignored. Users with pre-existing
Expand Down
2 changes: 1 addition & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

DEF_VER=v2.51.GIT
DEF_VER=v2.52.0-rc0

LF='
'
Expand Down
13 changes: 7 additions & 6 deletions add-patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1569,8 +1569,10 @@ static int patch_update_file(struct add_p_state *s,
if (*s->s.reset_color_interactive)
fputs(s->s.reset_color_interactive, stdout);
fflush(stdout);
if (read_single_character(s) == EOF)
if (read_single_character(s) == EOF) {
quit = 1;
break;
}

if (!s->answer.len)
continue;
Expand Down Expand Up @@ -1601,7 +1603,7 @@ static int patch_update_file(struct add_p_state *s,
} else if (hunk->use == UNDECIDED_HUNK) {
hunk->use = USE_HUNK;
}
} else if (ch == 'd' || ch == 'q') {
} else if (ch == 'd') {
if (file_diff->hunk_nr) {
for (; hunk_index < file_diff->hunk_nr; hunk_index++) {
hunk = file_diff->hunk + hunk_index;
Expand All @@ -1613,10 +1615,9 @@ static int patch_update_file(struct add_p_state *s,
} else if (hunk->use == UNDECIDED_HUNK) {
hunk->use = SKIP_HUNK;
}
if (ch == 'q') {
quit = 1;
break;
}
} else if (ch == 'q') {
quit = 1;
break;
} else if (s->answer.buf[0] == 'K') {
if (permitted & ALLOW_GOTO_PREVIOUS_HUNK)
hunk_index = dec_mod(hunk_index,
Expand Down
Loading