Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2fb444a
Merge branch 'ps/setup-wo-the-repository' into ps/setup-centralize-od…
gitster May 21, 2026
4018dc2
doc: document and test `@` prefix for raw timestamps
lunagl Jun 2, 2026
66ebad2
SubmittingPatches: separate typofixes section
gitster Jun 2, 2026
bc58f1c
SubmittingPatches: describe cover letter
gitster Jun 2, 2026
1868428
environment: move "trust_ctime" into `struct repo_config_values`
cloobTech Jun 2, 2026
88505ed
environment: move "check_stat" into `struct repo_config_values`
cloobTech Jun 2, 2026
e0f8654
environment: move `zlib_compression_level` into `struct repo_config_v…
cloobTech Jun 2, 2026
8cd7402
environment: move "pack_compression_level" into `struct repo_config_v…
cloobTech Jun 2, 2026
6f00fc0
environment: move "precomposed_unicode" into `struct repo_config_values`
cloobTech Jun 2, 2026
dfa01ce
environment: move "core_sparse_checkout_cone" into `struct repo_confi…
cloobTech Jun 2, 2026
c8a3214
environment: move "sparse_expect_files_outside_of_patterns" into `str…
cloobTech Jun 2, 2026
8407abf
environment: move "warn_on_object_refname_ambiguity" into `struct rep…
cloobTech Jun 2, 2026
9b03e27
config: add git_config_key_is_valid() for quiet validation
HaraldNordgren Jun 2, 2026
03c29e2
config: improve diagnostic for "set" with missing value
HaraldNordgren Jun 2, 2026
027e3b3
t0001: plug test gaps for git-init(1) with GIT_OBJECT_DIRECTORY
pks-t Jun 4, 2026
452ad8d
setup: drop `setup_git_env()`
pks-t Jun 4, 2026
3d884b0
setup: deduplicate logic to apply repository format
pks-t Jun 4, 2026
6a2fbab
repository: stop initializing the object database in `repo_set_gitdir()`
pks-t Jun 4, 2026
aae4ebc
setup: stop creating the object database in `setup_git_env()`
pks-t Jun 4, 2026
d87de31
setup: stop initializing object database without repository
pks-t Jun 4, 2026
a84a9d4
repository: stop reading loose object map twice on repo init
pks-t Jun 4, 2026
42b9d3d
setup: construct object database in `apply_repository_format()`
pks-t Jun 4, 2026
4a1eb93
Documentation: remove redundant 'instead' in --subject-prefix
lucasoshiro Jun 4, 2026
d1b72b2
doc: fix typo in GIT_ALTERNATE_OBJECT_DIRECTORIES
amonakov Jun 5, 2026
014c454
doc: fix typos via codespell
algonell May 31, 2026
a4a1cbc
Merge branch 'jc/submitting-patches-cover-letter'
gitster Jun 15, 2026
8b0f02b
Merge branch 'ls/doc-raw-timestamp-prefix'
gitster Jun 15, 2026
cfe6682
Merge branch 'hn/config-typo-advice'
gitster Jun 15, 2026
4d1d7b9
Merge branch 'ps/setup-centralize-odb-creation'
gitster Jun 15, 2026
f5e1cff
Merge branch 'lo/doc-format-patch-subject-prefix'
gitster Jun 15, 2026
06c2bdd
Merge branch 'am/doc-tech-hash-typofix'
gitster Jun 15, 2026
883a47e
Merge branch 'ob/more-repo-config-values'
gitster Jun 15, 2026
ff17842
Merge branch 'ak/typofixes'
gitster Jun 15, 2026
700432b
topic flush before -rc1 (batch 1)
gitster Jun 15, 2026
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
28 changes: 28 additions & 0 deletions Documentation/RelNotes/2.55.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ UI, Workflows & Features
* The documentation for "--word-diff" has been extended with a bit of
implementation detail of where these different words come from.

* "git config foo.bar=baz" is not likely to be a request to read the
value of such a variable with '=' in its name; rather it is plausible
that the user meant "git config set foo.bar baz". Give advice when
giving an error message.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -171,6 +176,18 @@ Performance, Internal Implementation, Development Support etc.
* The loose object source has been refactored into a proper `struct
odb_source`.

* Guidelines on how to write a cover letter for a multi-patch series
have been added to SubmittingPatches, which also got a new marker
to separate the section for typofixes.

* The setup logic to discover and configure repositories has been
refactored, and the initialization of the object database has been
centralized.

* Many core configuration variables have been migrated from global
variables into 'repo_config_values' to tie them to a specific
repository instance, avoiding cross-repository state leakage.


Fixes since v2.54
-----------------
Expand Down Expand Up @@ -322,6 +339,15 @@ Fixes since v2.54
sufficiently new linker is detected.
(merge 5cd4d0d850 hn/macos-linker-warning later to maint).

* Documentation and tests have been added to clarify that Git's internal
raw timestamp format requires a `@` prefix for values less than
100,000,000 to prevent ambiguity with other formats like YYYYMMDD.
(merge 4018dc29ee ls/doc-raw-timestamp-prefix later to maint).

* Wording used in "format-patch --subject-prefix" documentation
has been improved.
(merge 4a1eb9304a lo/doc-format-patch-subject-prefix later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 80f4b802e9 ja/doc-difftool-synopsis-style later to maint).
(merge b96490241e jc/doc-timestamps-in-stat later to maint).
Expand All @@ -344,3 +370,5 @@ Fixes since v2.54
(merge 1740cc35d0 ed/check-connected-close-err-fd later to maint).
(merge f4d7eb3d1c sp/doc-range-diff-takes-notes later to maint).
(merge 83e7f3bd2b kh/free-commit-list later to maint).
(merge d1b72b29e9 am/doc-tech-hash-typofix later to maint).
(merge 014c454799 ak/typofixes later to maint).
27 changes: 26 additions & 1 deletion Documentation/SubmittingPatches
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ input and avoids unnecessary churn from many rapid iterations.
topic are appropriate, so such an incremental updates are limited to
small corrections and polishing. After a topic cooks for some time
(like 7 calendar days) in 'next' without needing further tweaks on
top, it gets merged to the 'master' branch and wait to become part
top, it gets merged to the 'master' branch and waits to become part
of the next major release.

In the following sections, many techniques and conventions are listed
Expand Down Expand Up @@ -237,6 +237,7 @@ Do not forget to update the documentation to describe the updated
behavior and make sure that the resulting documentation set formats
well (try the Documentation/doc-diff script).

[[typofixes]]
We currently have a liberal mixture of US and UK English norms for
spelling and grammar, which is somewhat unfortunate. A huge patch that
touches the files all over the place only to correct the inconsistency
Expand Down Expand Up @@ -471,6 +472,30 @@ highlighted above.
Only capitalize the very first letter of the trailer, i.e. favor
"Signed-off-by" over "Signed-Off-By" and "Acked-by:" over "Acked-By".

[[cover-letter]]
=== Cover Letter

The purpose of your cover letter is to sell your changes, explain what
they are about, and get your target audience interested enough to read
the patches.

. Every code change comes with risk of regression and maintenance cost.
The cover letter should clearly communicate why the value of your
proposed change is worth applying. You can also describe how the risk
is reduced by the design choices you made while writing the patches.

. Make sure your target audience can understand what the patches are
about and why they are needed without prior context.

. For a second or subsequent iteration of the same topic, make sure
people who missed the earlier discussion can still understand what
the patches are about, so they can judge if the topic is worth their
time to read and comment on.

. To help those who are familiar with earlier iterations, give a
summary of changes since the previous rounds.


[[ai]]
=== Use of Artificial Intelligence (AI)

Expand Down
5 changes: 5 additions & 0 deletions Documentation/date-formats.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Git internal format::
`<unix-timestamp>` is the number of seconds since the UNIX epoch.
`<time-zone-offset>` is a positive or negative offset from UTC.
For example CET (which is 1 hour ahead of UTC) is `+0100`.
+
It is safer to prepend the `<unix-timestamp>` with `@` (e.g.,
`@0 +0000`), which forces Git to interpret it as a raw timestamp. This
is required for values less than 100,000,000 (which have fewer than 9
digits) to avoid confusion with other date formats like `YYYYMMDD`.

RFC 2822::
The standard date format as described by RFC 2822, for example
Expand Down
7 changes: 3 additions & 4 deletions Documentation/git-format-patch.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,9 @@ populated with placeholder text.
for generating the cover letter.

--subject-prefix=<subject-prefix>::
Instead of the standard '[PATCH]' prefix in the subject
line, instead use '[<subject-prefix>]'. This can be used
to name a patch series, and can be combined with the
`--numbered` option.
Use '[<subject-prefix>]' instead of the standard '[PATCH]'
prefix in the subject line. This can be used to name a patch
series, and can be combined with the `--numbered` option.
+
The configuration variable `format.subjectPrefix` may also be used
to configure a subject prefix to apply to a given repository for
Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-sparse-checkout.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ the `clean.requireForce` config option is set to `false`.
+
The `--dry-run` option will list the directories that would be removed
without deleting them. Running in this mode can be helpful to predict the
behavior of the clean comand or to determine which kinds of files are left
behavior of the clean command or to determine which kinds of files are left
in the sparse directories.
+
The `--verbose` option will list every file within the directories that
Expand Down
6 changes: 3 additions & 3 deletions Documentation/technical/build-systems.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Auto-detection of the following items is considered to be important:

- Check for the existence of headers.
- Check for the existence of libraries.
- Check for the existence of exectuables.
- Check for the existence of executables.
- Check for the runtime behavior of specific functions.
- Check for specific link order requirements when multiple libraries are
involved.
Expand Down Expand Up @@ -106,7 +106,7 @@ by the build system:

- C: the primary compiled language used by Git, must be supported. Relevant
toolchains are GCC, Clang and MSVC.
- Rust: candidate as a second compiled lanugage, should be supported. Relevant
- Rust: candidate as a second compiled language, should be supported. Relevant
toolchains is the LLVM-based rustc.

Built-in support for the respective languages is preferred over support that
Expand Down Expand Up @@ -142,7 +142,7 @@ The following list of build systems are considered:

=== GNU Make

- Platform support: ubitquitous on all platforms, but not well-integrated into Windows.
- Platform support: ubiquitous on all platforms, but not well-integrated into Windows.
- Auto-detection: no built-in support for auto-detection of features.
- Ease of use: easy to use, but discovering available options is hard. Makefile
rules can quickly get out of hand once reaching a certain scope.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/technical/hash-function-transition.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ Alternates
~~~~~~~~~~
For the same reason, a SHA-256 repository cannot borrow objects from a
SHA-1 repository using objects/info/alternates or
$GIT_ALTERNATE_OBJECT_REPOSITORIES.
$GIT_ALTERNATE_OBJECT_DIRECTORIES.

git notes
~~~~~~~~~
Expand Down
7 changes: 4 additions & 3 deletions builtin/cat-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ static int batch_objects(struct batch_options *opt)
struct strbuf input = STRBUF_INIT;
struct strbuf output = STRBUF_INIT;
struct expand_data data = EXPAND_DATA_INIT;
struct repo_config_values *cfg = repo_config_values(the_repository);
int save_warning;
int retval = 0;

Expand Down Expand Up @@ -1002,8 +1003,8 @@ static int batch_objects(struct batch_options *opt)
* warn) ends up dwarfing the actual cost of the object lookups
* themselves. We can work around it by just turning off the warning.
*/
save_warning = warn_on_object_refname_ambiguity;
warn_on_object_refname_ambiguity = 0;
save_warning = cfg->warn_on_object_refname_ambiguity;
cfg->warn_on_object_refname_ambiguity = 0;

if (opt->batch_mode == BATCH_MODE_QUEUE_AND_DISPATCH) {
batch_objects_command(opt, &output, &data);
Expand Down Expand Up @@ -1031,7 +1032,7 @@ static int batch_objects(struct batch_options *opt)
cleanup:
strbuf_release(&input);
strbuf_release(&output);
warn_on_object_refname_ambiguity = save_warning;
cfg->warn_on_object_refname_ambiguity = save_warning;
return retval;
}

Expand Down
32 changes: 31 additions & 1 deletion builtin/config.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "advice.h"
#include "config.h"
#include "color.h"
#include "date.h"
Expand Down Expand Up @@ -210,6 +211,26 @@ static void check_argc(int argc, int min, int max)
exit(129);
}

static NORETURN void die_missing_set_value(const char *arg)
{
const char *last_dot = strrchr(arg, '.');
const char *eq = last_dot ? strchr(last_dot + 1, '=') : NULL;
char *prefix = eq ? xstrndup(arg, eq - arg) : NULL;

if (prefix && git_config_key_is_valid(prefix)) {
error(_("missing value to set to the variable '%s'"), arg);
advise(_("did you mean \"git config set %s %s\"?"),
prefix, eq + 1);
} else if (git_config_key_is_valid(arg)) {
error(_("missing value to set to the variable '%s'"), arg);
} else {
error(_("missing value to set to a variable with an invalid name '%s'"),
arg);
}
free(prefix);
exit(129);
}

static void show_config_origin(const struct config_display_options *opts,
const struct key_value_info *kvi,
struct strbuf *buf)
Expand Down Expand Up @@ -1133,6 +1154,8 @@ static int cmd_config_set(int argc, const char **argv, const char *prefix,

argc = parse_options(argc, argv, prefix, opts, builtin_config_set_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
if (argc == 1)
die_missing_set_value(argv[0]);
check_argc(argc, 2, 2);

if ((flags & CONFIG_FLAGS_FIXED_VALUE) && !value_pattern)
Expand Down Expand Up @@ -1371,6 +1394,7 @@ static int cmd_config_actions(int argc, const char **argv, const char *prefix)
};
char *value = NULL, *comment = NULL;
int ret = 0;
int actions_implicit;
struct key_value_info default_kvi = KVI_INIT;

argc = parse_options(argc, argv, prefix, opts,
Expand All @@ -1385,7 +1409,8 @@ static int cmd_config_actions(int argc, const char **argv, const char *prefix)
exit(129);
}

if (actions == 0)
actions_implicit = (actions == 0);
if (actions_implicit)
switch (argc) {
case 1: actions = ACTION_GET; break;
case 2: actions = ACTION_SET; break;
Expand All @@ -1394,6 +1419,11 @@ static int cmd_config_actions(int argc, const char **argv, const char *prefix)
error(_("no action specified"));
exit(129);
}
if (actions_implicit && argc == 1) {
const char *last_dot = strrchr(argv[0], '.');
if (last_dot && strchr(last_dot + 1, '='))
die_missing_set_value(argv[0]);
}
if (display_opts.omit_values &&
!(actions == ACTION_LIST || actions == ACTION_GET_REGEXP)) {
error(_("--name-only is only applicable to --list or --get-regexp"));
Expand Down
8 changes: 5 additions & 3 deletions builtin/fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ static int store_object(
unsigned long hdrlen, deltalen;
struct git_hash_ctx c;
git_zstream s;
struct repo_config_values *cfg = repo_config_values(the_repository);

hdrlen = format_object_header((char *)hdr, sizeof(hdr), type,
dat->len);
Expand Down Expand Up @@ -1005,7 +1006,7 @@ static int store_object(
} else
delta = NULL;

git_deflate_init(&s, pack_compression_level);
git_deflate_init(&s, cfg->pack_compression_level);
if (delta) {
s.next_in = delta;
s.avail_in = deltalen;
Expand All @@ -1032,7 +1033,7 @@ static int store_object(
if (delta) {
FREE_AND_NULL(delta);

git_deflate_init(&s, pack_compression_level);
git_deflate_init(&s, cfg->pack_compression_level);
s.next_in = (void *)dat->buf;
s.avail_in = dat->len;
s.avail_out = git_deflate_bound(&s, s.avail_in);
Expand Down Expand Up @@ -1115,6 +1116,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)
struct git_hash_ctx c;
git_zstream s;
struct hashfile_checkpoint checkpoint;
struct repo_config_values *cfg = repo_config_values(the_repository);
int status = Z_OK;

/* Determine if we should auto-checkpoint. */
Expand All @@ -1134,7 +1136,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)

crc32_begin(pack_file);

git_deflate_init(&s, pack_compression_level);
git_deflate_init(&s, cfg->pack_compression_level);

hdrlen = encode_in_pack_object_header(out_buf, out_sz, OBJ_BLOB, len);

Expand Down
3 changes: 2 additions & 1 deletion builtin/index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,8 +1417,9 @@ static int write_compressed(struct hashfile *f, void *in, unsigned int size)
git_zstream stream;
int status;
unsigned char outbuf[4096];
struct repo_config_values *cfg = repo_config_values(the_repository);

git_deflate_init(&stream, zlib_compression_level);
git_deflate_init(&stream, cfg->zlib_compression_level);
stream.next_in = in;
stream.avail_in = size;

Expand Down
2 changes: 1 addition & 1 deletion builtin/mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ int cmd_mv(int argc,

if (ignore_sparse &&
cfg->apply_sparse_checkout &&
core_sparse_checkout_cone) {
cfg->core_sparse_checkout_cone) {
/*
* NEEDSWORK: we are *not* paying attention to
* "out-to-out" move (<source> is out-of-cone and
Expand Down
Loading