Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
084681b
Merge branch 'ps/config-wo-the-repository' into pw/3.0-commentchar-au…
gitster Jul 31, 2025
04133f5
send-email: add ability to send a copy of sent emails to an IMAP folder
AdityaGarg8 Aug 12, 2025
f33b220
send-email: enable copying emails to an IMAP folder without actually …
AdityaGarg8 Aug 12, 2025
8655908
abbrev: allow extending beyond 32 chars to disambiguate
gitster Aug 14, 2025
ab60c69
line-log: fix assertion error
szeder Aug 18, 2025
e310699
line-log: show all line ranges touched by the same diff range
szeder Aug 18, 2025
ac70967
config: document includeIf conditions consistently
gitster Aug 21, 2025
fdae411
breaking-changes: deprecate support for core.commentString=auto
phillipwood Aug 26, 2025
a0e6aae
config: warn on core.commentString=auto
phillipwood Aug 26, 2025
ace1bb7
commit: print advice when core.commentString=auto
phillipwood Aug 26, 2025
fafc9b0
docs: update sendmail docs to use more secure SMTP server for Gmail
AdityaGarg8 Aug 26, 2025
929b1d0
Documentation: note styling for bit fields
KarthikNayak Aug 26, 2025
1b5a6bf
curl: add support for curl_global_trace() components
peff Aug 27, 2025
0072724
range-diff: add configurable memory limit for cost matrix
pcasaretto Aug 29, 2025
5e2feb5
alloc: fix dangling pointer in alloc_state cleanup
nouraellm Sep 4, 2025
31397bc
doc: fast-import: replace literal block with paragraph
LemmingAvalanche Sep 8, 2025
f0d71c3
Merge branch 'kh/doc-fast-import-markup-fix'
gitster Sep 18, 2025
1fbfabf
Merge branch 'pw/3.0-commentchar-auto-deprecation'
gitster Sep 18, 2025
1c385d1
Merge branch 'ag/send-email-imap-sent'
gitster Sep 18, 2025
d680fe4
Merge branch 'jc/doc-includeif-hasconfig-remote-url-fix'
gitster Sep 18, 2025
cf47560
Merge branch 'sg/line-log-boundary-fixes'
gitster Sep 18, 2025
d29cbbb
Merge branch 'jc/longer-disambiguation-fix'
gitster Sep 18, 2025
c6fa656
Merge branch 'kn/clang-format-bitfields'
gitster Sep 18, 2025
9827e07
Merge branch 'ag/doc-sendmail-gmail-example-update'
gitster Sep 18, 2025
bf781d9
Merge branch 'jk/curl-global-trace-components'
gitster Sep 18, 2025
44c0d06
Merge branch 'ne/alloc-free-and-null'
gitster Sep 18, 2025
7b776bc
Merge branch 'pc/range-diff-memory-limit'
gitster Sep 18, 2025
ca2559c
The tenth batch
gitster Sep 18, 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
5 changes: 5 additions & 0 deletions Documentation/BreakingChanges.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ These features will be removed.
+
The command will be removed.

* Support for `core.commentString=auto` has been deprecated and will
be removed in Git 3.0.
+
cf. <xmqqa59i45wc.fsf@gitster.g>

== Superseded features that will not be deprecated

Some features have gained newer replacements that aim to improve the design in
Expand Down
6 changes: 6 additions & 0 deletions Documentation/CodingGuidelines
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,12 @@ For C programs:
cases. However, it is recommended to find a more descriptive name wherever
possible to improve the readability and maintainability of the code.

- Bit fields should be defined without a space around the colon. E.g.

unsigned my_field:1;
unsigned other_field:1;
unsigned field_with_longer_name:1;

For Perl programs:

- Most of the C guidelines above apply.
Expand Down
31 changes: 31 additions & 0 deletions Documentation/RelNotes/2.52.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ UI, Workflows & Features
"--format=nul", and learns to report the objects format used in the
repository.

* "core.commentChar=auto" that attempts to dynamically pick a
suitable comment character is non-workable, as it is too much
trouble to support for little benefit, and is marked as deprecated.

* "git send-email" learned to drive "git imap-send" to store already
sent e-mails in an IMAP folder.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -63,6 +70,19 @@ Performance, Internal Implementation, Development Support etc.
singleton variable, which has been updated to pass an instance
throughout the callchain.

* CodingGuidelines now spells out how bitfields are to be written.

* Adjust to the way newer versions of cURL selectivel enables tracing
options, so that our tests can continue to work.
(merge 1b5a6bfff3 jk/curl-global-trace-components later to maint).

* The clear_alloc_state() API function was not fully clearing the
structure for reuse, but since nobody reuses it, replace it with a
variant that frees the structure as well, making the callers simpler.

* "git range-diff" learned a way to limit the memory consumed by
O(N*N) cost matrix.


Fixes since v2.51
-----------------
Expand Down Expand Up @@ -177,6 +197,14 @@ including security updates, are included in this release.
exhaust memory storing them redundantly, which has been corrected.
(merge 88a2dc68c8 ps/upload-pack-oom-protection later to maint).

* A corner case bug in "git log -L..." has been corrected.
(merge e3106998ff sg/line-log-boundary-fixes later to maint).

* "git rev-parse --short" and friends failed to disambiguate two
objects with object names that share common prefix longer than 32
characters, which has been fixed.
(merge 8655908b9e jc/longer-disambiguation-fix later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 823d537fa7 kh/doc-git-log-markup-fix later to maint).
(merge cf7efa4f33 rj/t6137-cygwin-fix later to maint).
Expand All @@ -198,3 +226,6 @@ including security updates, are included in this release.
(merge c25651aefd ds/midx-write-fixes later to maint).
(merge 069c15d256 rs/object-name-extend-abbrev-len-update later to maint).
(merge bf5c224537 mm/worktree-doc-typofix later to maint).
(merge 31397bc4f7 kh/doc-fast-import-markup-fix later to maint).
(merge ac7096723b jc/doc-includeif-hasconfig-remote-url-fix later to maint).
(merge fafc9b08b8 ag/doc-sendmail-gmail-example-update later to maint).
9 changes: 4 additions & 5 deletions Documentation/config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ whose format and meaning depends on the keyword. Supported keywords
are:

`gitdir`::

The data that follows the keyword `gitdir:` is used as a glob
The data that follows the keyword `gitdir` and a colon is used as a glob
pattern. If the location of the .git directory matches the
pattern, the include condition is met.
+
Expand Down Expand Up @@ -148,7 +147,7 @@ refer to linkgit:gitignore[5] for details. For convenience:
case-insensitively (e.g. on case-insensitive file systems)

`onbranch`::
The data that follows the keyword `onbranch:` is taken to be a
The data that follows the keyword `onbranch` and a colon is taken to be a
pattern with standard globbing wildcards and two additional
ones, `**/` and `/**`, that can match multiple path components.
If we are in a worktree where the name of the branch that is
Expand All @@ -161,8 +160,8 @@ all branches that begin with `foo/`. This is useful if your branches are
organized hierarchically and you would like to apply a configuration to
all the branches in that hierarchy.

`hasconfig:remote.*.url:`::
The data that follows this keyword is taken to
`hasconfig:remote.*.url`::
The data that follows this keyword and a colon is taken to
be a pattern with standard globbing wildcards and two
additional ones, `**/` and `/**`, that can match multiple
components. The first time this keyword is seen, the rest of
Expand Down
20 changes: 18 additions & 2 deletions Documentation/config/core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,25 @@ core.commentString::
commented, and removes them after the editor returns
(default '#').
+
If set to "auto", `git-commit` would select a character that is not
ifndef::with-breaking-changes[]
If set to "auto", `git-commit` will select a character that is not
the beginning character of any line in existing commit messages.
+
Support for this value is deprecated and will be removed in Git 3.0
due to the following limitations:
+
--
* It is incompatible with adding comments in a commit message
template. This includes the conflicts comments added to
the commit message by `cherry-pick`, `merge`, `rebase` and
`revert`.
* It is incompatible with adding comments to the commit message
in the `prepare-commit-msg` hook.
* It is incompatible with the `fixup` and `squash` commands when
rebasing,
* It is not respected by `git notes`
--
+
endif::with-breaking-changes[]
Note that these two variables are aliases of each other, and in modern
versions of Git you are free to use a string (e.g., `//` or `⁑⁕⁑`) with
`commentChar`. Versions of Git prior to v2.45.0 will ignore
Expand Down
2 changes: 2 additions & 0 deletions Documentation/config/sendemail.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ sendemail.smtpServer::
sendemail.smtpServerPort::
sendemail.smtpServerOption::
sendemail.smtpUser::
sendemail.imapSentFolder::
sendemail.useImapOnly::
sendemail.thread::
sendemail.transferEncoding::
sendemail.validate::
Expand Down
8 changes: 4 additions & 4 deletions Documentation/git-fast-import.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ OPTIONS
currently impacts only the `export-marks`, `import-marks`, and
`import-marks-if-exists` feature commands.
+
Only enable this option if you trust the program generating the
fast-import stream! This option is enabled automatically for
remote-helpers that use the `import` capability, as they are
already trusted to run their own code.
Only enable this option if you trust the program generating the
fast-import stream! This option is enabled automatically for
remote-helpers that use the `import` capability, as they are
already trusted to run their own code.

Options for Frontends
~~~~~~~~~~~~~~~~~~~~~
Expand Down
34 changes: 30 additions & 4 deletions Documentation/git-send-email.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,32 @@ must be used for each option.
commands and replies will be printed. Useful to debug TLS
connection and authentication problems.

--imap-sent-folder=<folder>::
Some email providers (e.g. iCloud) do not send a copy of the emails sent
using SMTP to the `Sent` folder or similar in your mailbox. Use this option
to use `git imap-send` to send a copy of the emails to the folder specified
using this option. You can run `git imap-send --list` to get a list of
valid folder names, including the correct name of the `Sent` folder in
your mailbox. You can also use this option to send emails to a dedicated
IMAP folder of your choice.
+
This feature requires setting up `git imap-send`. See linkgit:git-imap-send[1]
for instructions.

--use-imap-only::
--no-use-imap-only::
If this is set, all emails will only be copied to the IMAP folder specified
with `--imap-sent-folder` or `sendemail.imapSentFolder` and will not be sent
to the recipients. Useful if you just want to create a draft of the emails
and use another email client to send them.
If disabled with `--no-use-imap-only`, the emails will be sent like usual.
Disabled by default, but the `sendemail.useImapOnly` configuration
variable can be used to enable it.

+
This feature requires setting up `git imap-send`. See linkgit:git-imap-send[1]
for instructions.

--batch-size=<num>::
Some email servers (e.g. 'smtp.163.com') limit the number of emails to be
sent per session (connection) and this will lead to a failure when
Expand Down Expand Up @@ -531,10 +557,10 @@ edit `~/.gitconfig` to specify your account settings:

----
[sendemail]
smtpEncryption = tls
smtpEncryption = ssl
smtpServer = smtp.gmail.com
smtpUser = yourname@gmail.com
smtpServerPort = 587
smtpServerPort = 465
----

Gmail does not allow using your regular password for `git send-email`.
Expand All @@ -552,10 +578,10 @@ if you want to use `OAUTHBEARER`, edit your `~/.gitconfig` file and add

----
[sendemail]
smtpEncryption = tls
smtpEncryption = ssl
smtpServer = smtp.gmail.com
smtpUser = yourname@gmail.com
smtpServerPort = 587
smtpServerPort = 465
smtpAuth = OAUTHBEARER
----

Expand Down
10 changes: 8 additions & 2 deletions alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,25 @@ struct alloc_state {
int slab_nr, slab_alloc;
};

struct alloc_state *allocate_alloc_state(void)
struct alloc_state *alloc_state_alloc(void)
{
return xcalloc(1, sizeof(struct alloc_state));
}

void clear_alloc_state(struct alloc_state *s)
void alloc_state_free_and_null(struct alloc_state **s_)
{
struct alloc_state *s = *s_;

if (!s)
return;

while (s->slab_nr > 0) {
s->slab_nr--;
free(s->slabs[s->slab_nr]);
}

FREE_AND_NULL(s->slabs);
FREE_AND_NULL(*s_);
}

static inline void *alloc_node(struct alloc_state *s, size_t node_size)
Expand Down
4 changes: 2 additions & 2 deletions alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void *alloc_commit_node(struct repository *r);
void *alloc_tag_node(struct repository *r);
void *alloc_object_node(struct repository *r);

struct alloc_state *allocate_alloc_state(void);
void clear_alloc_state(struct alloc_state *s);
struct alloc_state *alloc_state_alloc(void);
void alloc_state_free_and_null(struct alloc_state **s_);

#endif
7 changes: 7 additions & 0 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ static int author_date_is_interesting(void)
return author_message || force_date;
}

#ifndef WITH_BREAKING_CHANGES
static void adjust_comment_line_char(const struct strbuf *sb)
{
char candidates[] = "#;@!$%^&|:";
Expand Down Expand Up @@ -732,6 +733,7 @@ static void adjust_comment_line_char(const struct strbuf *sb)
free(comment_line_str_to_free);
comment_line_str = comment_line_str_to_free = xstrfmt("%c", *p);
}
#endif /* !WITH_BREAKING_CHANGES */

static void prepare_amend_commit(struct commit *commit, struct strbuf *sb,
struct pretty_print_context *ctx)
Expand Down Expand Up @@ -928,8 +930,10 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
if (fwrite(sb.buf, 1, sb.len, s->fp) < sb.len)
die_errno(_("could not write commit template"));

#ifndef WITH_BREAKING_CHANGES
if (auto_comment_line_char)
adjust_comment_line_char(&sb);
#endif /* !WITH_BREAKING_CHANGES */
strbuf_release(&sb);

/* This checks if committer ident is explicitly given */
Expand Down Expand Up @@ -1793,6 +1797,9 @@ int cmd_commit(int argc,
show_usage_with_options_if_asked(argc, argv,
builtin_commit_usage, builtin_commit_options);

#ifndef WITH_BREAKING_CHANGES
warn_on_auto_comment_char = true;
#endif /* !WITH_BREAKING_CHANGES */
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;

Expand Down
1 change: 1 addition & 0 deletions builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
struct range_diff_options range_diff_opts = {
.creation_factor = rev->creation_factor,
.dual_color = 1,
.max_memory = RANGE_DIFF_MAX_MEMORY_DEFAULT,
.diffopt = &opts,
.other_arg = &other_arg
};
Expand Down
3 changes: 3 additions & 0 deletions builtin/merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,9 @@ int cmd_merge(int argc,
show_usage_with_options_if_asked(argc, argv,
builtin_merge_usage, builtin_merge_options);

#ifndef WITH_BREAKING_CHANGES
warn_on_auto_comment_char = true;
#endif /* !WITH_BREAKING_CHANGES */
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;

Expand Down
21 changes: 21 additions & 0 deletions builtin/range-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "parse-options.h"
#include "range-diff.h"
#include "config.h"
#include "parse.h"


static const char * const builtin_range_diff_usage[] = {
Expand All @@ -15,6 +16,21 @@ N_("git range-diff [<options>] <base> <old-tip> <new-tip>"),
NULL
};

static int parse_max_memory(const struct option *opt, const char *arg, int unset)
{
size_t *max_memory = opt->value;
uintmax_t val;

if (unset)
return 0;

if (!git_parse_unsigned(arg, &val, SIZE_MAX))
return error(_("invalid max-memory value: %s"), arg);

*max_memory = (size_t)val;
return 0;
}

int cmd_range_diff(int argc,
const char **argv,
const char *prefix,
Expand All @@ -25,6 +41,7 @@ int cmd_range_diff(int argc,
struct strvec diff_merges_arg = STRVEC_INIT;
struct range_diff_options range_diff_opts = {
.creation_factor = RANGE_DIFF_CREATION_FACTOR_DEFAULT,
.max_memory = RANGE_DIFF_MAX_MEMORY_DEFAULT,
.diffopt = &diffopt,
.other_arg = &other_arg
};
Expand All @@ -40,6 +57,10 @@ int cmd_range_diff(int argc,
PARSE_OPT_OPTARG),
OPT_PASSTHRU_ARGV(0, "diff-merges", &diff_merges_arg,
N_("style"), N_("passed to 'git log'"), 0),
OPT_CALLBACK(0, "max-memory", &range_diff_opts.max_memory,
N_("size"),
N_("maximum memory for cost matrix (default 4G)"),
parse_max_memory),
OPT_PASSTHRU_ARGV(0, "remerge-diff", &diff_merges_arg, NULL,
N_("passed to 'git log'"), PARSE_OPT_NOARG),
OPT_BOOL(0, "left-only", &left_only,
Expand Down
3 changes: 3 additions & 0 deletions builtin/rebase.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,9 @@ int cmd_rebase(int argc,
builtin_rebase_usage,
builtin_rebase_options);

#ifndef WITH_BREAKING_CHANGES
warn_on_auto_comment_char = true;
#endif /* !WITH_BREAKING_CHANGES */
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;

Expand Down
Loading