Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
339d95f
ci: allow github-actions print test failures again
gitster Jul 16, 2025
8c3add5
meson: work around broken system PCRE2 dependency in macOS
carenas Jul 18, 2025
54b1826
revision: drop early output option
peff Jul 19, 2025
e337860
pull: add pull.autoStash config option
brandb97 Jul 20, 2025
9b5c002
rev-list: make "struct rev_list_info" static to the only user
gitster Jul 18, 2025
f31abb4
rev-list: update a NEEDSWORK comment
gitster Jul 21, 2025
0b86937
docs: explain how to use `git imap-send --list` command to get a list…
AdityaGarg8 Jul 22, 2025
26552cb
reflog: close leak of reflog expire entry
jacob-keller Jul 22, 2025
9b2527c
CodingGuidelines: document test balloons in flight
gitster Jul 23, 2025
5dd5c4e
t/unit-tests: implement clar specific reftable test helper functions
Seyi007 Jul 24, 2025
ed5dcbf
t/unit-tests: convert reftable basics test to use clar test framework
Seyi007 Jul 24, 2025
a83bf04
t/unit-tests: convert reftable block test to use clar
Seyi007 Jul 24, 2025
c7784ba
t/unit-tests: convert reftable merged test to use clar
Seyi007 Jul 24, 2025
a0aaa85
t/unit-tests: convert reftable pq test to use clar
Seyi007 Jul 24, 2025
18a992b
t/unit-tests: convert reftable table test to use clar
Seyi007 Jul 24, 2025
ee0a88d
t/unit-tests: convert reftable readwrite test to use clar
Seyi007 Jul 24, 2025
2596bef
t/unit-tests: convert reftable record test to use clar
Seyi007 Jul 24, 2025
1cfd187
t/unit-tests: convert reftable stack test to use clar
Seyi007 Jul 24, 2025
9bbc981
t/unit-tests: finalize migration of reftable-related tests
Seyi007 Jul 24, 2025
6741b9b
Merge branch 'jc/rev-list-info-cleanup'
gitster Aug 1, 2025
2346617
Merge branch 'jk/revision-no-early-output'
gitster Aug 1, 2025
152871b
Merge branch 'jc/do-not-scan-argv-without-parsing'
gitster Aug 1, 2025
a2384a7
Merge branch 'jk/unleak-reflog-expire-entry'
gitster Aug 1, 2025
4f5b161
Merge branch 'jc/ci-print-test-failures-fix'
gitster Aug 1, 2025
557c494
Merge branch 'cb/meson-avoid-broken-macos-pcre2'
gitster Aug 1, 2025
8ad370f
Merge branch 'ag/imap-send-list-folders-doc'
gitster Aug 1, 2025
cbcde15
Merge branch 'jc/document-test-balloons-in-flight'
gitster Aug 1, 2025
6fe666b
Merge branch 'ly/pull-autostash'
gitster Aug 1, 2025
80b8016
Merge branch 'sk/reftable-clarify-tests'
gitster Aug 1, 2025
866e6a3
The sixteenth batch
gitster Aug 1, 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
8 changes: 8 additions & 0 deletions Documentation/CodingGuidelines
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ For C programs:
. since late 2023 with 8277dbe987 we have been using the bool type
from <stdbool.h>.

C99 features we have test balloons for:

. since late 2024 with v2.48.0-rc0~20, we have test balloons for
compound literal syntax, e.g., (struct foo){ .member = value };
our hope is that no platforms we care about have trouble using
them, and officially adopt its wider use in mid 2026. Do not add
more use of the syntax until that happens.

New C99 features that we cannot use yet:

. %z and %zu as a printf() argument for a size_t (the %z being for
Expand Down
22 changes: 22 additions & 0 deletions Documentation/RelNotes/2.51.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ UI, Workflows & Features
* Clean up the way how signature on commit objects are exported to
and imported from fast-import stream.

* Remove unsupported, unused, and unsupportable old option from "git
log".

* Document recently added "git imap-send --list" with an example.

* "git pull" learned to pay attention to pull.autostash configuration
variable, which overrides rebase/merge.autostash.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -107,6 +115,16 @@ Performance, Internal Implementation, Development Support etc.
worst case performance characteristics, which has been optimized by
using prio-queue data structure.

* Move structure definition from unrelated header file to where it
belongs.

* To help our developers, document what C99 language features are
being considered for adoption, in addition to what past experiments
have already decided.

* The reftable unit tests are now ported to the "clar" unit testing
framework.


Fixes since v2.50
-----------------
Expand Down Expand Up @@ -260,3 +278,7 @@ including security updates, are included in this release.
(merge f4fa8a3687 rh/doc-glob-pathspec-fix later to maint).
(merge b27be108c8 ja/doc-git-log-markup later to maint).
(merge 14d7583beb pw/config-kvi-remove-path later to maint).
(merge f31abb421d jc/do-not-scan-argv-without-parsing later to maint).
(merge 26552cb62a jk/unleak-reflog-expire-entry later to maint).
(merge 339d95fda9 jc/ci-print-test-failures-fix later to maint).
(merge 8c3add51a8 cb/meson-avoid-broken-macos-pcre2 later to maint).
16 changes: 16 additions & 0 deletions Documentation/config/pull.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,21 @@ pull.octopus::
The default merge strategy to use when pulling multiple branches
at once.

pull.autoStash::
When set to true, automatically create a temporary stash entry
to record the local changes before the operation begins, and
restore them after the operation completes. When your "git
pull" rebases (instead of merges), this may be convenient, since
unlike merging pull that tolerates local changes that do not
interfere with the merge, rebasing pull refuses to work with any
local changes.
+
If `pull.autostash` is set (either to true or false),
`merge.autostash` and `rebase.autostash` are ignored. If
`pull.autostash` is not set at all, depending on the value of
`pull.rebase`, `merge.autostash` or `rebase.autostash` is used
instead. Can be overridden by the `--[no-]autostash` command line
option.

pull.twohead::
The default merge strategy to use when pulling a single branch.
28 changes: 28 additions & 0 deletions Documentation/git-imap-send.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,34 @@ include::includes/cmd-config-section-rest.adoc[]

include::config/imap.adoc[]

GETTING A LIST OF AVAILABLE FOLDERS
-----------------------------------

In order to send an email to a specific folder, you need to know the correct name of
intended folder in your mailbox. The names like "Junk", "Trash" etc. displayed by
various email clients need not be the actual names of the folders stored in the mail
server of your email provider.

In order to get the correct folder name to be used with `git imap-send`, you can run
`git imap-send --list`. This will display a list of valid folder names. An example
of such an output when run on a Gmail account is:

.........................
* LIST (\HasNoChildren) "/" "INBOX"
* LIST (\HasChildren \Noselect) "/" "[Gmail]"
* LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
* LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
* LIST (\HasNoChildren \Important) "/" "[Gmail]/Important"
* LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
* LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
* LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
* LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash"
.........................

Here, you can observe that the correct name for the "Junk" folder is `[Gmail]/Spam`
and for the "Trash" folder is `[Gmail]/Trash`. Similar logic can be used to determine
other folders as well.

EXAMPLES
--------
Using tunnel mode:
Expand Down
20 changes: 9 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,13 @@ CLAR_TEST_SUITES += u-oid-array
CLAR_TEST_SUITES += u-oidmap
CLAR_TEST_SUITES += u-oidtree
CLAR_TEST_SUITES += u-prio-queue
CLAR_TEST_SUITES += u-reftable-basics
CLAR_TEST_SUITES += u-reftable-block
CLAR_TEST_SUITES += u-reftable-merged
CLAR_TEST_SUITES += u-reftable-pq
CLAR_TEST_SUITES += u-reftable-readwrite
CLAR_TEST_SUITES += u-reftable-stack
CLAR_TEST_SUITES += u-reftable-table
CLAR_TEST_SUITES += u-reftable-tree
CLAR_TEST_SUITES += u-strbuf
CLAR_TEST_SUITES += u-strcmp-offset
Expand All @@ -1372,20 +1379,11 @@ CLAR_TEST_SUITES += u-urlmatch-normalization
CLAR_TEST_PROG = $(UNIT_TEST_BIN)/unit-tests$(X)
CLAR_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(CLAR_TEST_SUITES))
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/clar/clar.o
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/lib-oid.o
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/lib-reftable.o
CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o

UNIT_TEST_PROGRAMS += t-reftable-basics
UNIT_TEST_PROGRAMS += t-reftable-block
UNIT_TEST_PROGRAMS += t-reftable-merged
UNIT_TEST_PROGRAMS += t-reftable-pq
UNIT_TEST_PROGRAMS += t-reftable-readwrite
UNIT_TEST_PROGRAMS += t-reftable-record
UNIT_TEST_PROGRAMS += t-reftable-stack
UNIT_TEST_PROGRAMS += t-reftable-table
UNIT_TEST_PROGS = $(patsubst %,$(UNIT_TEST_BIN)/%$X,$(UNIT_TEST_PROGRAMS))
UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o
UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/lib-reftable.o

# xdiff and reftable libs may in turn depend on what is in libgit.a
GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE)
Expand Down
8 changes: 0 additions & 8 deletions bisect.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ struct commit_list *filter_skipped(struct commit_list *list,
#define FIND_BISECTION_ALL (1u<<0)
#define FIND_BISECTION_FIRST_PARENT_ONLY (1u<<1)

struct rev_list_info {
struct rev_info *revs;
int flags;
int show_timestamp;
int hdr_termination;
const char *header_prefix;
};

/*
* enum bisect_error represents the following return codes:
* BISECT_OK: success code. Internally, it means that next
Expand Down
1 change: 1 addition & 0 deletions builtin/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ static int reflog_expire_condition(struct gc_config *cfg UNUSED)
count_reflog_entries, &data);

reflog_expiry_cleanup(&data.policy);
reflog_clear_expire_config(&data.policy.opts);
return data.count >= data.limit;
}

Expand Down
129 changes: 0 additions & 129 deletions builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,145 +391,16 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
cmd_log_init_finish(argc, argv, prefix, rev, opt, cfg);
}

/*
* This gives a rough estimate for how many commits we
* will print out in the list.
*/
static int estimate_commit_count(struct commit_list *list)
{
int n = 0;

while (list) {
struct commit *commit = list->item;
unsigned int flags = commit->object.flags;
list = list->next;
if (!(flags & (TREESAME | UNINTERESTING)))
n++;
}
return n;
}

static void show_early_header(struct rev_info *rev, const char *stage, int nr)
{
if (rev->shown_one) {
rev->shown_one = 0;
if (rev->commit_format != CMIT_FMT_ONELINE)
putchar(rev->diffopt.line_termination);
}
fprintf(rev->diffopt.file, _("Final output: %d %s\n"), nr, stage);
}

static struct itimerval early_output_timer;

static void log_show_early(struct rev_info *revs, struct commit_list *list)
{
int i = revs->early_output;
int show_header = 1;
int no_free = revs->diffopt.no_free;

revs->diffopt.no_free = 0;
sort_in_topological_order(&list, revs->sort_order);
while (list && i) {
struct commit *commit = list->item;
switch (simplify_commit(revs, commit)) {
case commit_show:
if (show_header) {
int n = estimate_commit_count(list);
show_early_header(revs, "incomplete", n);
show_header = 0;
}
log_tree_commit(revs, commit);
i--;
break;
case commit_ignore:
break;
case commit_error:
revs->diffopt.no_free = no_free;
diff_free(&revs->diffopt);
return;
}
list = list->next;
}

/* Did we already get enough commits for the early output? */
if (!i) {
revs->diffopt.no_free = 0;
diff_free(&revs->diffopt);
return;
}

/*
* ..if no, then repeat it twice a second until we
* do.
*
* NOTE! We don't use "it_interval", because if the
* reader isn't listening, we want our output to be
* throttled by the writing, and not have the timer
* trigger every second even if we're blocked on a
* reader!
*/
early_output_timer.it_value.tv_sec = 0;
early_output_timer.it_value.tv_usec = 500000;
setitimer(ITIMER_REAL, &early_output_timer, NULL);
}

static void early_output(int signal UNUSED)
{
show_early_output = log_show_early;
}

static void setup_early_output(void)
{
struct sigaction sa;

/*
* Set up the signal handler, minimally intrusively:
* we only set a single volatile integer word (not
* using sigatomic_t - trying to avoid unnecessary
* system dependencies and headers), and using
* SA_RESTART.
*/
memset(&sa, 0, sizeof(sa));
sa.sa_handler = early_output;
sigemptyset(&sa.sa_mask);
sa.sa_flags = SA_RESTART;
sigaction(SIGALRM, &sa, NULL);

/*
* If we can get the whole output in less than a
* tenth of a second, don't even bother doing the
* early-output thing..
*
* This is a one-time-only trigger.
*/
early_output_timer.it_value.tv_sec = 0;
early_output_timer.it_value.tv_usec = 100000;
setitimer(ITIMER_REAL, &early_output_timer, NULL);
}

static void finish_early_output(struct rev_info *rev)
{
int n = estimate_commit_count(rev->commits);
signal(SIGALRM, SIG_IGN);
show_early_header(rev, "done", n);
}

static int cmd_log_walk_no_free(struct rev_info *rev)
{
struct commit *commit;
int saved_nrl = 0;
int saved_dcctc = 0;
int result;

if (rev->early_output)
setup_early_output();

if (prepare_revision_walk(rev))
die(_("revision walk setup failed"));

if (rev->early_output)
finish_early_output(rev);

/*
* For --check and --exit-code, the exit code is based on CHECK_FAILED
* and HAS_CHANGES being accumulated in rev->diffopt, so be careful to
Expand Down
20 changes: 17 additions & 3 deletions builtin/pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ static char *opt_ff;
static const char *opt_verify_signatures;
static const char *opt_verify;
static int opt_autostash = -1;
static int config_autostash;
static int config_rebase_autostash;
static int config_pull_autostash = -1;
static int check_trust_level = 1;
static struct strvec opt_strategies = STRVEC_INIT;
static struct strvec opt_strategy_opts = STRVEC_INIT;
Expand Down Expand Up @@ -367,7 +368,18 @@ static int git_pull_config(const char *var, const char *value,
const struct config_context *ctx, void *cb)
{
if (!strcmp(var, "rebase.autostash")) {
config_autostash = git_config_bool(var, value);
/*
* run_rebase() also reads this option. The reason we handle it here is
* that when pull.rebase is true, a fast-forward may occur without
* invoking run_rebase(). We need to ensure that autostash is set even
* in the fast-forward case.
*
* run_merge() handles merge.autostash, so we don't handle it here.
*/
config_rebase_autostash = git_config_bool(var, value);
return 0;
} else if (!strcmp(var, "pull.autostash")) {
config_pull_autostash = git_config_bool(var, value);
return 0;
} else if (!strcmp(var, "submodule.recurse")) {
recurse_submodules = git_config_bool(var, value) ?
Expand Down Expand Up @@ -1006,6 +1018,8 @@ int cmd_pull(int argc,
}

argc = parse_options(argc, argv, prefix, pull_options, pull_usage, 0);
if (opt_autostash == -1)
opt_autostash = config_pull_autostash;

if (recurse_submodules_cli != RECURSE_SUBMODULES_DEFAULT)
recurse_submodules = recurse_submodules_cli;
Expand Down Expand Up @@ -1052,7 +1066,7 @@ int cmd_pull(int argc,

if (opt_rebase) {
if (opt_autostash == -1)
opt_autostash = config_autostash;
opt_autostash = config_rebase_autostash;

if (is_null_oid(&orig_head) && !is_index_unborn(the_repository->index))
die(_("Updating an unborn branch with changes added to the index."));
Expand Down
3 changes: 3 additions & 0 deletions builtin/reflog.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix,
&cb);
free(ref);
}

reflog_clear_expire_config(&opts);

return status;
}

Expand Down
Loading