Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
819d3a5
coccicheck: fail "make" when it fails
gitster Jun 23, 2025
3570fba
contrib: use a more portable shebang for git-credential-netrc
Jun 25, 2025
53ca382
contrib: warn for invalid netrc file ports in git-credential-netrc
Jun 25, 2025
1926d9b
contrib: better support symbolic port names in git-credential-netrc
Jun 25, 2025
88a4ed4
config: document --[no-]show-names
LemmingAvalanche Jul 1, 2025
f322f86
config: use --value=<pattern> consistently
LemmingAvalanche Jul 1, 2025
5ba6e6c
config: document --[no-]value
LemmingAvalanche Jul 1, 2025
d46f698
config: use --value instead of value-pattern
LemmingAvalanche Jul 1, 2025
c4e9775
config: mention --url in the synopsis
LemmingAvalanche Jul 1, 2025
9e45fc6
clang-format: set 'ColumnLimit' to 0
KarthikNayak Jul 2, 2025
73d8380
clang-format: add 'RemoveBracesLLVM' to the main config
KarthikNayak Jul 2, 2025
3f7e447
meson: add rule to run 'git clang-format'
KarthikNayak Jul 2, 2025
46a3ab7
config.mak.uname: set NO_MEMMEM only for functional version
carenas Jul 2, 2025
0392f97
build: retire NO_UINTMAX_T
carenas Jul 2, 2025
f3a9558
gitremote-helpers.adoc: fix formatting
brettsheffield Jul 2, 2025
d0b9457
BreakingChanges: announce switch to "reftable" format
pks-t Jul 4, 2025
793b14e
setup: use "reftable" format when experimental features are enabled
pks-t Jul 4, 2025
375ac08
setup_revisions(): turn on diffs for all-negative diff filter
peff Jul 3, 2025
57391a9
apply: read in the index in --intent-to-add mode
juped Jul 7, 2025
7c6e61f
apply: only write intents to add for new files
juped Jul 7, 2025
a4c969a
t4140: test apply --intent-to-add interactions
juped Jul 7, 2025
2b49d97
apply docs: clarify wording for --intent-to-add
juped Jul 7, 2025
9455397
read-cache: report lock error when refreshing index
hanyang-tony Jul 3, 2025
ba472ab
string-list: fix sign compare warnings for loop iterator
shejialuo Jun 29, 2025
394e063
string-list: remove unused "insert_at" parameter from add_entry
shejialuo Jun 29, 2025
885becd
string-list: return index directly when inserting an existing element
shejialuo Jun 29, 2025
67cfd29
string-list: enable sign compare warnings check
shejialuo Jun 29, 2025
07d90fd
u-string-list: move "test_split" into "u-string-list.c"
shejialuo Jun 29, 2025
62c514a
u-string-list: move "test_split_in_place" to "u-string-list.c"
shejialuo Jun 29, 2025
7e7ce78
u-string-list: move "filter string" test to "u-string-list.c"
shejialuo Jun 29, 2025
6e5b26c
u-string-list: move "remove duplicates" test to "u-string-list.c"
shejialuo Jun 29, 2025
44e300a
repository: move 'repository_format_precious_objects' to repo scope
ayu-ch Jul 4, 2025
7cd03a5
builtin/prune: stop depending on 'the_repository'
ayu-ch Jul 4, 2025
0c83bbc
build: fix FreeBSD build when sysinfo compat library installed
ramsay-jones Jul 4, 2025
953049e
docs: correct ORIG_HEAD example in "git merge" documentation
strowk Jul 5, 2025
385e175
t4150: fix warning printed by awk due to escaped '\@'
pks-t Jul 7, 2025
de40424
t5333: fix missing terminator for sed(1) 's' command
pks-t Jul 7, 2025
781c1cf
builtin/gc: correct total_ram calculation with HAVE_BSD_SYSCTL
carenas Jul 7, 2025
4498127
ssh signing: don't detach the filename strbuf from key_file tempfile
redoste Jul 7, 2025
cc876f2
Merge branch 'bs/remote-helpers-doc-markup-fix'
gitster Jul 14, 2025
e02d718
Merge branch 'cb/total-ram-bsd-fix'
gitster Jul 14, 2025
45c50a1
Merge branch 'bs/config-mak-freebsd'
gitster Jul 14, 2025
f96878e
Merge branch 'ac/prune-wo-the-repository'
gitster Jul 14, 2025
50d9c34
Merge branch 'jk/all-negative-diff-filter-fix'
gitster Jul 14, 2025
5e458c1
Merge branch 'ps/use-reftable-as-default-in-3.0'
gitster Jul 14, 2025
0d046cb
Merge branch 'jc/coccicheck-fails-make-when-it-fails'
gitster Jul 14, 2025
db4a912
Merge branch 'mc/netrc-service-names'
gitster Jul 14, 2025
a35b8c8
Merge branch 'kh/doc-config-subcommands'
gitster Jul 14, 2025
38349d1
Merge branch 'kn/clang-format-updates'
gitster Jul 14, 2025
69ea767
Merge branch 'hy/read-cache-lock-error-fix'
gitster Jul 14, 2025
f4fd906
Merge branch 're/ssh-sign-buffer-fix'
gitster Jul 14, 2025
18cd756
Merge branch 'ps/perlless-test-fixes'
gitster Jul 14, 2025
8c5f7db
Merge branch 'ts/merge-orig-head-doc-fix'
gitster Jul 14, 2025
e78bca2
Merge branch 'rj/freebsd-sysinfo-build-fix'
gitster Jul 14, 2025
2b5bf70
Merge branch 'sj/string-list'
gitster Jul 14, 2025
f5b69ee
Merge branch 'rp/apply-intent-to-add-fix'
gitster Jul 14, 2025
d30e120
The ninth batch
gitster Jul 14, 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
27 changes: 15 additions & 12 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ UseTab: Always
TabWidth: 8
IndentWidth: 8
ContinuationIndentWidth: 8
ColumnLimit: 80

# While we do want to enforce a character limit of 80 characters, we often
# allow lines to overflow that limit to prioritize readability. Setting a
# character limit here with penalties has been finicky and creates too many
# false positives.
#
# NEEDSWORK: It would be nice if we can find optimal settings to ensure we
# can re-enable the limit here.
ColumnLimit: 0

# C Language specifics
Language: Cpp
Expand Down Expand Up @@ -210,16 +218,11 @@ MaxEmptyLinesToKeep: 1
# No empty line at the start of a block.
KeepEmptyLinesAtTheStartOfBlocks: false

# Penalties
# This decides what order things should be done if a line is too long
PenaltyBreakAssignment: 5
PenaltyBreakBeforeFirstCallParameter: 5
PenaltyBreakComment: 5
PenaltyBreakFirstLessLess: 0
PenaltyBreakOpenParenthesis: 300
PenaltyBreakString: 5
PenaltyExcessCharacter: 10
PenaltyReturnTypeOnItsOwnLine: 300

# Don't sort #include's
SortIncludes: false

# Remove optional braces of control statements (if, else, for, and while)
# according to the LLVM coding style. This avoids braces on simple
# single-statement bodies of statements but keeps braces if one side of
# if/else if/.../else cascade has multi-statement body.
RemoveBracesLLVM: true
47 changes: 47 additions & 0 deletions Documentation/BreakingChanges.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,53 @@ Cf. <2f5de416-04ba-c23d-1e0b-83bb655829a7@zombino.com>,
<20170223155046.e7nxivfwqqoprsqj@LykOS.localdomain>,
<CA+EOSBncr=4a4d8n9xS4FNehyebpmX8JiUwCsXD47EQDE+DiUQ@mail.gmail.com>.

* The default storage format for references in newly created repositories will
be changed from "files" to "reftable". The "reftable" format provides
multiple advantages over the "files" format:
+
** It is impossible to store two references that only differ in casing on
case-insensitive filesystems with the "files" format. This issue is common
on Windows and macOS platforms. As the "reftable" backend does not use
filesystem paths to encode reference names this problem goes away.
** Similarly, macOS normalizes path names that contain unicode characters,
which has the consequence that you cannot store two names with unicode
characters that are encoded differently with the "files" backend. Again,
this is not an issue with the "reftable" backend.
** Deleting references with the "files" backend requires Git to rewrite the
complete "packed-refs" file. In large repositories with many references
this file can easily be dozens of megabytes in size, in extreme cases it
may be gigabytes. The "reftable" backend uses tombstone markers for
deleted references and thus does not have to rewrite all of its data.
** Repository housekeeping with the "files" backend typically performs
all-into-one repacks of references. This can be quite expensive, and
consequently housekeeping is a tradeoff between the number of loose
references that accumulate and slow down operations that read references,
and compressing those loose references into the "packed-refs" file. The
"reftable" backend uses geometric compaction after every write, which
amortizes costs and ensures that the backend is always in a
well-maintained state.
** Operations that write multiple references at once are not atomic with the
"files" backend. Consequently, Git may see in-between states when it reads
references while a reference transaction is in the process of being
committed to disk.
** Writing many references at once is slow with the "files" backend because
every reference is created as a separate file. The "reftable" backend
significantly outperforms the "files" backend by multiple orders of
magnitude.
** The reftable backend uses a binary format with prefix compression for
reference names. As a result, the format uses less space compared to the
"packed-refs" file.
+
Users that get immediate benefit from the "reftable" backend could continue to
opt-in to the "reftable" format manually by setting the "init.defaultRefFormat"
config. But defaults matter, and we think that overall users will have a better
experience with less platform-specific quirks when they use the new backend by
default.
+
A prerequisite for this change is that the ecosystem is ready to support the
"reftable" format. Most importantly, alternative implementations of Git like
JGit, libgit2 and Gitoxide need to support it.

=== Removals

* Support for grafting commits has long been superseded by git-replace(1).
Expand Down
51 changes: 49 additions & 2 deletions Documentation/RelNotes/2.51.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ UI, Workflows & Features
client, instead of retrying, it skipped it by mistake, which has
been corrected.

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

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


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand All @@ -65,6 +72,16 @@ Performance, Internal Implementation, Development Support etc.
* "git push" and "git fetch" are taught to update refs in batches to
gain performance.

* 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.

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

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


Fixes since v2.50
-----------------
Expand Down Expand Up @@ -117,8 +134,32 @@ including security updates, are included in this release.
* Remove unnecessary check from "git daemon" code.
(merge 0c856224d2 cb/daemon-fd-check-fix later to maint).

* Leakfix.
(merge b0e9d25865 jk/fix-leak-send-pack later to maint).
* Use of sysctl() system call to learn the total RAM size used on
BSDs has been corrected.
(merge 781c1cf571 cb/total-ram-bsd-fix later to maint).

* Drop FreeBSD 4 support and declare that we support only FreeBSD 12
or later, which has memmem() supported.
(merge 0392f976a7 bs/config-mak-freebsd later to maint).

* A diff-filter with negative-only specification like "git log
--diff-filter=d" did not trigger correctly, which has been fixed.
(merge 375ac087c5 jk/all-negative-diff-filter-fix later to maint).

* A failure to open the index file for writing due to conflicting
access did not state what went wrong, which has been corrected.
(merge 9455397a5c hy/read-cache-lock-error-fix later to maint).

* Tempfile removal fix in the codepath to sign commits with SSH keys.
(merge 4498127b04 re/ssh-sign-buffer-fix later to maint).

* Code and test clean-up around string-list API.
(merge 6e5b26c3ff sj/string-list later to maint).

* "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.
(merge 2b49d97fcb rp/apply-intent-to-add-fix later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge b257adb571 lo/my-first-ow-doc-update later to maint).
Expand All @@ -136,3 +177,9 @@ including security updates, are included in this release.
(merge ff73f375bb jg/mailinfo-leakfix later to maint).
(merge 996f14c02b jj/doc-branch-markup-fix later to maint).
(merge 1e77de1864 cb/ci-freebsd-update-to-14.3 later to maint).
(merge b0e9d25865 jk/fix-leak-send-pack later to maint).
(merge f3a9558c8c bs/remote-helpers-doc-markup-fix later to maint).
(merge c4e9775c60 kh/doc-config-subcommands later to maint).
(merge de404249ab ps/perlless-test-fixes later to maint).
(merge 953049eed8 ts/merge-orig-head-doc-fix later to maint).
(merge 0c83bbc704 rj/freebsd-sysinfo-build-fix later to maint).
6 changes: 6 additions & 0 deletions Documentation/config/feature.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ reusing objects from multiple packs instead of just one.
* `pack.usePathWalk` may speed up packfile creation and make the packfiles be
significantly smaller in the presence of certain filename collisions with Git's
default name-hash.
+
* `init.defaultRefFormat=reftable` causes newly initialized repositories to use
the reftable format for storing references. This new format solves issues with
case-insensitive filesystems, compresses better and performs significantly
better with many use cases. Refer to Documentation/technical/reftable.adoc for
more information on this new storage format.

feature.manyFiles::
Enable config options that optimize for repos with many files in the
Expand Down
9 changes: 5 additions & 4 deletions Documentation/git-apply.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ OPTIONS
tree. If `--check` is in effect, merely check that it would
apply cleanly to the index entry.

-N::
--intent-to-add::
When applying the patch only to the working tree, mark new
files to be added to the index later (see `--intent-to-add`
option in linkgit:git-add[1]). This option is ignored unless
running in a Git repository and `--index` is not specified.
Note that `--index` could be implied by other options such
as `--cached` or `--3way`.
option in linkgit:git-add[1]). This option is ignored if
`--index` or `--cached` are used, and has no effect outside a Git
repository. Note that `--index` could be implied by other options
such as `--3way`.

-3::
--3way::
Expand Down
28 changes: 21 additions & 7 deletions Documentation/git-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ SYNOPSIS
--------
[verse]
'git config list' [<file-option>] [<display-option>] [--includes]
'git config get' [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>
'git config set' [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>
'git config unset' [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>
'git config get' [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<pattern>] [--fixed-value] [--default=<default>] [--url=<url>] <name>
'git config set' [<file-option>] [--type=<type>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>
'git config unset' [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>
'git config rename-section' [<file-option>] <old-name> <new-name>
'git config remove-section' [<file-option>] <name>
'git config edit' [<file-option>]
Expand All @@ -26,7 +26,7 @@ escaped.

Multiple lines can be added to an option by using the `--append` option.
If you want to update or unset an option which can occur on multiple
lines, a `value-pattern` (which is an extended regular expression,
lines, `--value=<pattern>` (which is an extended regular expression,
unless the `--fixed-value` option is given) needs to be given. Only the
existing values that match the pattern are updated or unset. If
you want to handle the lines that do *not* match the pattern, just
Expand Down Expand Up @@ -109,7 +109,7 @@ OPTIONS

--replace-all::
Default behavior is to replace at most one line. This replaces
all lines matching the key (and optionally the `value-pattern`).
all lines matching the key (and optionally `--value=<pattern>`).

--append::
Adds a new line to the option without altering any existing
Expand Down Expand Up @@ -200,11 +200,19 @@ See also <<FILES>>.
section in linkgit:gitrevisions[7] for a more complete list of
ways to spell blob names.

`--value=<pattern>`::
`--no-value`::
With `get`, `set`, and `unset`, match only against
_<pattern>_. The pattern is an extended regular expression unless
`--fixed-value` is given.
+
Use `--no-value` to unset _<pattern>_.

--fixed-value::
When used with the `value-pattern` argument, treat `value-pattern` as
When used with `--value=<pattern>`, treat _<pattern>_ as
an exact string instead of a regular expression. This will restrict
the name/value pairs that are matched to only those where the value
is exactly equal to the `value-pattern`.
is exactly equal to _<pattern>_.

--type <type>::
'git config' will ensure that any input or output is valid under the given
Expand Down Expand Up @@ -259,6 +267,12 @@ Valid `<type>`'s include:
Output only the names of config variables for `list` or
`get`.

`--show-names`::
`--no-show-names`::
With `get`, show config keys in addition to their values. The
default is `--no-show-names` unless `--url` is given and there
are no subsections in _<name>_.

--show-origin::
Augment the output of all queried config options with the
origin type (file, standard input, blob, command line) and
Expand Down
10 changes: 5 additions & 5 deletions Documentation/git-merge.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Assume the following history exists and the current branch is
`master`:

------------
A---B---C topic
/
A---B---C topic
/
D---E---F---G master
------------

Expand All @@ -38,11 +38,11 @@ Then `git merge topic` will replay the changes made on the
its current commit (`C`) on top of `master`, and record the result
in a new commit along with the names of the two parent commits and
a log message from the user describing the changes. Before the operation,
`ORIG_HEAD` is set to the tip of the current branch (`C`).
`ORIG_HEAD` is set to the tip of the current branch (`G`).

------------
A---B---C topic
/ \
A---B---C topic
/ \
D---E---F---G---H master
------------

Expand Down
2 changes: 1 addition & 1 deletion Documentation/gitremote-helpers.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ set by Git if the remote helper has the 'option' capability.
ask for the tag specifically. Some helpers may be able to
use this option to avoid a second network connection.

'option dry-run' {'true'|'false'}:
'option dry-run' {'true'|'false'}::
If true, pretend the operation completed successfully,
but don't actually change any repository data. For most
helpers this only applies to the 'push', if supported.
Expand Down
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ include shared.mak
#
# Define NO_INTPTR_T if you don't have intptr_t or uintptr_t.
#
# Define NO_UINTMAX_T if you don't have uintmax_t.
#
# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
# Patrick Mauritz).
#
Expand Down Expand Up @@ -1367,6 +1365,7 @@ CLAR_TEST_SUITES += u-prio-queue
CLAR_TEST_SUITES += u-reftable-tree
CLAR_TEST_SUITES += u-strbuf
CLAR_TEST_SUITES += u-strcmp-offset
CLAR_TEST_SUITES += u-string-list
CLAR_TEST_SUITES += u-strvec
CLAR_TEST_SUITES += u-trailer
CLAR_TEST_SUITES += u-urlmatch-normalization
Expand Down Expand Up @@ -1918,9 +1917,6 @@ endif
ifdef NO_INTPTR_T
COMPAT_CFLAGS += -DNO_INTPTR_T
endif
ifdef NO_UINTMAX_T
BASIC_CFLAGS += -Duintmax_t=uint32_t
endif
ifdef NO_SOCKADDR_STORAGE
ifdef NO_IPV6
BASIC_CFLAGS += -Dsockaddr_storage=sockaddr_in
Expand Down Expand Up @@ -3473,11 +3469,14 @@ endif
coccicheck-test: $(COCCI_TEST_RES_GEN)

coccicheck: coccicheck-test

ifdef SPATCH_CONCAT_COCCI
coccicheck: contrib/coccinelle/ALL.cocci.patch
COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = contrib/coccinelle/ALL.cocci.patch
else
coccicheck: $(COCCICHECK_PATCHES_INTREE)
COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = $(COCCICHECK_PATCHES_INTREE)
endif
coccicheck: $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES)
! grep -q ^ $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES) /dev/null

# See contrib/coccinelle/README
coccicheck-pending: coccicheck-test
Expand Down
4 changes: 2 additions & 2 deletions apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -4565,7 +4565,7 @@ static int create_file(struct apply_state *state, struct patch *patch)

if (patch->conflicted_threeway)
return add_conflicted_stages_file(state, patch);
else if (state->update_index)
else if (state->check_index || (state->ita_only && patch->is_new > 0))
return add_index_file(state, path, mode, buf, size);
return 0;
}
Expand Down Expand Up @@ -4833,7 +4833,7 @@ static int apply_patch(struct apply_state *state,
LOCK_DIE_ON_ERROR);
}

if (state->check_index && read_apply_cache(state) < 0) {
if ((state->check_index || state->update_index) && read_apply_cache(state) < 0) {
error(_("unable to read index file"));
res = -128;
goto end;
Expand Down
12 changes: 6 additions & 6 deletions builtin/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

static const char *const builtin_config_usage[] = {
N_("git config list [<file-option>] [<display-option>] [--includes]"),
N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<value>] [--fixed-value] [--default=<default>] <name>"),
N_("git config set [<file-option>] [--type=<type>] [--all] [--value=<value>] [--fixed-value] <name> <value>"),
N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>"),
N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp] [--value=<pattern>] [--fixed-value] [--default=<default>] [--url=<url>] <name>"),
N_("git config set [<file-option>] [--type=<type>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>"),
N_("git config unset [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>"),
N_("git config rename-section [<file-option>] <old-name> <new-name>"),
N_("git config remove-section [<file-option>] <name>"),
N_("git config edit [<file-option>]"),
Expand All @@ -33,17 +33,17 @@ static const char *const builtin_config_list_usage[] = {
};

static const char *const builtin_config_get_usage[] = {
N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp=<regexp>] [--value=<value>] [--fixed-value] [--default=<default>] <name>"),
N_("git config get [<file-option>] [<display-option>] [--includes] [--all] [--regexp=<regexp>] [--value=<pattern>] [--fixed-value] [--default=<default>] <name>"),
NULL
};

static const char *const builtin_config_set_usage[] = {
N_("git config set [<file-option>] [--type=<type>] [--comment=<message>] [--all] [--value=<value>] [--fixed-value] <name> <value>"),
N_("git config set [<file-option>] [--type=<type>] [--comment=<message>] [--all] [--value=<pattern>] [--fixed-value] <name> <value>"),
NULL
};

static const char *const builtin_config_unset_usage[] = {
N_("git config unset [<file-option>] [--all] [--value=<value>] [--fixed-value] <name>"),
N_("git config unset [<file-option>] [--all] [--value=<pattern>] [--fixed-value] <name>"),
NULL
};

Expand Down
Loading