Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
184abdc
ci(win+Meson): build in Release mode
dscho May 3, 2025
c428216
scalar: customize register_dir()'s behavior
derrickstolee May 7, 2025
9816e24
scalar register: add --no-maintenance option
derrickstolee May 7, 2025
882ce0c
scalar clone: add --no-maintenance option
derrickstolee May 7, 2025
a34fef8
scalar reconfigure: add --maintenance=<mode> option
derrickstolee May 7, 2025
7291c2b
pack-bitmap: fix memory leak if `load_bitmap_entries_v1` failed
brandb97 May 12, 2025
6389579
gitlab-ci: always run MSVC-based Meson job
pks-t Apr 28, 2025
9c9f884
send-email: try to get fqdn by running hostname -f on Linux and macOS
AdityaGarg8 May 12, 2025
e918917
scalar reconfigure: improve --maintenance docs
derrickstolee May 14, 2025
d2c3e94
replay: replace the_repository with repo parameter passed to cmd_repl…
newren May 14, 2025
fba60a4
json-writer: add docstrings to jw_* functions
lucasoshiro May 16, 2025
da69229
json-writer: describe the usage of jw_* functions
lucasoshiro May 16, 2025
e931288
Merge branch 'js/ci-build-win-in-release-mode'
gitster May 23, 2025
abb674a
Merge branch 'ly/pack-bitmap-load-leakfix'
gitster May 23, 2025
95c79ef
Merge branch 'ds/scalar-no-maintenance'
gitster May 23, 2025
5e9dea5
Merge branch 'ps/ci-gitlab-enable-msvc-meson-job'
gitster May 23, 2025
fb67f78
Merge branch 'ag/send-email-hostname-f'
gitster May 23, 2025
96d1278
Merge branch 'en/replay-wo-the-repository'
gitster May 23, 2025
a306da7
Merge branch 'lo/json-writer-docs'
gitster May 23, 2025
845c48a
The seventeenth batch
gitster May 23, 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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ jobs:
run: pip install meson ninja
- name: Setup
shell: pwsh
run: meson setup build --vsenv -Dperl=disabled -Dcredential_helpers=wincred
run: meson setup build --vsenv -Dbuildtype=release -Dperl=disabled -Dcredential_helpers=wincred
- name: Compile
shell: pwsh
run: meson compile -C build
Expand Down
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ build:msvc-meson:
test:msvc-meson:
extends: .msvc-meson
stage: test
when: manual
timeout: 6h
needs:
- job: "build:msvc-meson"
Expand Down
19 changes: 19 additions & 0 deletions Documentation/RelNotes/2.50.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ UI, Workflows & Features
* The `send-email` documentation has been updated with OAuth2.0
related examples.

* Two of the "scalar" subcommands that add a repository that hasn't
been under "scalar"'s control are taught an option not to enable the
scheduled maintenance on it.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -157,6 +161,12 @@ Performance, Internal Implementation, Development Support etc.

* Build performance fix.

* Teach "git send-email" to also consult `hostname -f` for mail
domain to compute the identity given to SMTP servers.

* The dependency on the_repository variable has been reduced from the
code paths in "git replay".


Fixes since v2.49
-----------------
Expand Down Expand Up @@ -306,6 +316,15 @@ Fixes since v2.49
* Use-after-free fix in the sequencer.
(merge 5dbaec628d pw/sequencer-reflog-use-after-free later to maint).

* win+Meson CI pipeline, unlike other pipelines for Windows,
used to build artifacts in develper mode, which has been changed to
build them in release mode for consistency.
(merge 184abdcf05 js/ci-build-win-in-release-mode later to maint).

* CI settings at GitLab has been updated to run MSVC based Meson job
automatically (as opposed to be done only upon manual request).
(merge 6389579b2f ps/ci-gitlab-enable-msvc-meson-job later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 227c4f33a0 ja/doc-block-delimiter-markup-fix later to maint).
(merge 2bfd3b3685 ab/decorate-code-cleanup later to maint).
Expand Down
31 changes: 26 additions & 5 deletions Documentation/scalar.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ SYNOPSIS
--------
[verse]
scalar clone [--single-branch] [--branch <main-branch>] [--full-clone]
[--[no-]src] <url> [<enlistment>]
[--[no-]src] [--[no-]tags] [--[no-]maintenance] <url> [<enlistment>]
scalar list
scalar register [<enlistment>]
scalar register [--[no-]maintenance] [<enlistment>]
scalar unregister [<enlistment>]
scalar run ( all | config | commit-graph | fetch | loose-objects | pack-files ) [<enlistment>]
scalar reconfigure [ --all | <enlistment> ]
scalar reconfigure [--maintenance=(enable|disable|keep)] [ --all | <enlistment> ]
scalar diagnose [<enlistment>]
scalar delete <enlistment>

Expand Down Expand Up @@ -97,6 +97,11 @@ cloning. If the HEAD at the remote did not point at any branch when
A sparse-checkout is initialized by default. This behavior can be
turned off via `--full-clone`.

--[no-]maintenance::
By default, `scalar clone` configures the enlistment to use Git's
background maintenance feature. Use the `--no-maintenance` to skip
this configuration.

List
~~~~

Expand All @@ -117,6 +122,12 @@ Note: when this subcommand is called in a worktree that is called `src/`, its
parent directory is considered to be the Scalar enlistment. If the worktree is
_not_ called `src/`, it itself will be considered to be the Scalar enlistment.

--[no-]maintenance::
By default, `scalar register` configures the enlistment to use Git's
background maintenance feature. Use the `--no-maintenance` to skip
this configuration. This does not disable any maintenance that may
already be enabled in other ways.

Unregister
~~~~~~~~~~

Expand Down Expand Up @@ -149,8 +160,18 @@ After a Scalar upgrade, or when the configuration of a Scalar enlistment
was somehow corrupted or changed by mistake, this subcommand allows to
reconfigure the enlistment.

With the `--all` option, all enlistments currently registered with Scalar
will be reconfigured. Use this option after each Scalar upgrade.
--all::
When `--all` is specified, reconfigure all enlistments currently
registered with Scalar by the `scalar.repo` config key. Use this
option after each upgrade to get the latest features.

--maintenance=(enable|disable|keep)::
By default, Scalar configures the enlistment to use Git's
background maintenance feature; this is the same as using the
`enable` value for this option. Use the `disable` value to
remove each considered enlistment from background maintenance.
Use `keep' to leave the background maintenance configuration
untouched for these repositories.

Diagnose
~~~~~~~~
Expand Down
65 changes: 35 additions & 30 deletions builtin/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@
#include <oidset.h>
#include <tree.h>

static const char *short_commit_name(struct commit *commit)
static const char *short_commit_name(struct repository *repo,
struct commit *commit)
{
return repo_find_unique_abbrev(the_repository, &commit->object.oid,
return repo_find_unique_abbrev(repo, &commit->object.oid,
DEFAULT_ABBREV);
}

static struct commit *peel_committish(const char *name)
static struct commit *peel_committish(struct repository *repo, const char *name)
{
struct object *obj;
struct object_id oid;

if (repo_get_oid(the_repository, name, &oid))
if (repo_get_oid(repo, name, &oid))
return NULL;
obj = parse_object(the_repository, &oid);
return (struct commit *)repo_peel_to_type(the_repository, name, 0, obj,
obj = parse_object(repo, &oid);
return (struct commit *)repo_peel_to_type(repo, name, 0, obj,
OBJ_COMMIT);
}

Expand All @@ -50,7 +51,8 @@ static char *get_author(const char *message)
return NULL;
}

static struct commit *create_commit(struct tree *tree,
static struct commit *create_commit(struct repository *repo,
struct tree *tree,
struct commit *based_on,
struct commit *parent)
{
Expand All @@ -62,7 +64,7 @@ static struct commit *create_commit(struct tree *tree,
struct commit_extra_header *extra = NULL;
struct strbuf msg = STRBUF_INIT;
const char *out_enc = get_commit_output_encoding();
const char *message = repo_logmsg_reencode(the_repository, based_on,
const char *message = repo_logmsg_reencode(repo, based_on,
NULL, out_enc);
const char *orig_message = NULL;
const char *exclude_gpgsig[] = { "gpgsig", NULL };
Expand All @@ -79,7 +81,7 @@ static struct commit *create_commit(struct tree *tree,
goto out;
}

obj = parse_object(the_repository, &ret);
obj = parse_object(repo, &ret);

out:
free_commit_extra_headers(extra);
Expand All @@ -97,7 +99,8 @@ struct ref_info {
int negative_refexprs;
};

static void get_ref_information(struct rev_cmdline_info *cmd_info,
static void get_ref_information(struct repository *repo,
struct rev_cmdline_info *cmd_info,
struct ref_info *ref_info)
{
int i;
Expand Down Expand Up @@ -132,14 +135,14 @@ static void get_ref_information(struct rev_cmdline_info *cmd_info,

if (*refexpr == '^')
refexpr++;
if (repo_dwim_ref(the_repository, refexpr, strlen(refexpr), &oid, &fullname, 0) != 1)
if (repo_dwim_ref(repo, refexpr, strlen(refexpr), &oid, &fullname, 0) != 1)
can_uniquely_dwim = 0;

if (e->flags & BOTTOM) {
if (can_uniquely_dwim)
strset_add(&ref_info->negative_refs, fullname);
if (!ref_info->negative_refexprs)
ref_info->onto = lookup_commit_reference_gently(the_repository,
ref_info->onto = lookup_commit_reference_gently(repo,
&e->item->oid, 1);
ref_info->negative_refexprs++;
} else {
Expand All @@ -152,31 +155,32 @@ static void get_ref_information(struct rev_cmdline_info *cmd_info,
}
}

static void determine_replay_mode(struct rev_cmdline_info *cmd_info,
static void determine_replay_mode(struct repository *repo,
struct rev_cmdline_info *cmd_info,
const char *onto_name,
char **advance_name,
struct commit **onto,
struct strset **update_refs)
{
struct ref_info rinfo;

get_ref_information(cmd_info, &rinfo);
get_ref_information(repo, cmd_info, &rinfo);
if (!rinfo.positive_refexprs)
die(_("need some commits to replay"));

die_for_incompatible_opt2(!!onto_name, "--onto",
!!*advance_name, "--advance");
if (onto_name) {
*onto = peel_committish(onto_name);
*onto = peel_committish(repo, onto_name);
if (rinfo.positive_refexprs <
strset_get_size(&rinfo.positive_refs))
die(_("all positive revisions given must be references"));
} else if (*advance_name) {
struct object_id oid;
char *fullname = NULL;

*onto = peel_committish(*advance_name);
if (repo_dwim_ref(the_repository, *advance_name, strlen(*advance_name),
*onto = peel_committish(repo, *advance_name);
if (repo_dwim_ref(repo, *advance_name, strlen(*advance_name),
&oid, &fullname, 0) == 1) {
free(*advance_name);
*advance_name = fullname;
Expand Down Expand Up @@ -245,7 +249,8 @@ static struct commit *mapped_commit(kh_oid_map_t *replayed_commits,
return kh_value(replayed_commits, pos);
}

static struct commit *pick_regular_commit(struct commit *pickme,
static struct commit *pick_regular_commit(struct repository *repo,
struct commit *pickme,
kh_oid_map_t *replayed_commits,
struct commit *onto,
struct merge_options *merge_opt,
Expand All @@ -257,12 +262,12 @@ static struct commit *pick_regular_commit(struct commit *pickme,
base = pickme->parents->item;
replayed_base = mapped_commit(replayed_commits, base, onto);

result->tree = repo_get_commit_tree(the_repository, replayed_base);
pickme_tree = repo_get_commit_tree(the_repository, pickme);
base_tree = repo_get_commit_tree(the_repository, base);
result->tree = repo_get_commit_tree(repo, replayed_base);
pickme_tree = repo_get_commit_tree(repo, pickme);
base_tree = repo_get_commit_tree(repo, base);

merge_opt->branch1 = short_commit_name(replayed_base);
merge_opt->branch2 = short_commit_name(pickme);
merge_opt->branch1 = short_commit_name(repo, replayed_base);
merge_opt->branch2 = short_commit_name(repo, pickme);
merge_opt->ancestor = xstrfmt("parent of %s", merge_opt->branch2);

merge_incore_nonrecursive(merge_opt,
Expand All @@ -275,13 +280,13 @@ static struct commit *pick_regular_commit(struct commit *pickme,
merge_opt->ancestor = NULL;
if (!result->clean)
return NULL;
return create_commit(result->tree, pickme, replayed_base);
return create_commit(repo, result->tree, pickme, replayed_base);
}

int cmd_replay(int argc,
const char **argv,
const char *prefix,
struct repository *repo UNUSED)
struct repository *repo)
{
const char *advance_name_opt = NULL;
char *advance_name = NULL;
Expand Down Expand Up @@ -329,7 +334,7 @@ int cmd_replay(int argc,
"--advance", "--contained");
advance_name = xstrdup_or_null(advance_name_opt);

repo_init_revisions(the_repository, &revs, prefix);
repo_init_revisions(repo, &revs, prefix);

/*
* Set desired values for rev walking options here. If they
Expand Down Expand Up @@ -380,7 +385,7 @@ int cmd_replay(int argc,
revs.simplify_history = 0;
}

determine_replay_mode(&revs.cmdline, onto_name, &advance_name,
determine_replay_mode(repo, &revs.cmdline, onto_name, &advance_name,
&onto, &update_refs);

if (!onto) /* FIXME: Should handle replaying down to root commit */
Expand All @@ -391,7 +396,7 @@ int cmd_replay(int argc,
goto cleanup;
}

init_basic_merge_options(&merge_opt, the_repository);
init_basic_merge_options(&merge_opt, repo);
memset(&result, 0, sizeof(result));
merge_opt.show_rename_progress = 0;
last_commit = onto;
Expand All @@ -406,8 +411,8 @@ int cmd_replay(int argc,
if (commit->parents->next)
die(_("replaying merge commits is not supported yet!"));

last_commit = pick_regular_commit(commit, replayed_commits, onto,
&merge_opt, &result);
last_commit = pick_regular_commit(repo, commit, replayed_commits,
onto, &merge_opt, &result);
if (!last_commit)
break;

Expand Down
16 changes: 15 additions & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1393,8 +1393,22 @@ sub maildomain_mta {
return $maildomain;
}

sub maildomain_hostname_command {
my $maildomain;

if ($^O eq 'linux' || $^O eq 'darwin') {
my $domain = `(hostname -f) 2>/dev/null`;
if (!$?) {
chomp($domain);
$maildomain = $domain if valid_fqdn($domain);
}
}
return $maildomain;
}

sub maildomain {
return maildomain_net() || maildomain_mta() || 'localhost.localdomain';
return maildomain_net() || maildomain_mta() ||
maildomain_hostname_command || 'localhost.localdomain';
}

sub smtp_host_string {
Expand Down
4 changes: 0 additions & 4 deletions json-writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,6 @@ static void append_sub_jw(struct json_writer *jw,
strbuf_addbuf(&jw->json, &value->json);
}

/*
* Append existing (properly terminated) JSON sub-data (object or array)
* as-is onto the given JSON data.
*/
void jw_object_sub_jw(struct json_writer *jw, const char *key,
const struct json_writer *value)
{
Expand Down
Loading