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
70b7b03
Merge branch 'ps/object-store-midx' into ps/object-store-midx-dedup-info
gitster Jul 29, 2025
f175b34
t0450: fix test for out-of-tree builds
To1ne Aug 8, 2025
595bef7
odb: store locality in object database sources
pks-t Aug 11, 2025
0d61933
odb: allow `odb_find_source()` to fail
pks-t Aug 11, 2025
25c532f
odb: consistently use "dir" to refer to alternate's directory
pks-t Aug 11, 2025
a59d44f
odb: return newly created in-memory sources
pks-t Aug 11, 2025
57363df
odb: simplify calling `link_alt_odb_entry()`
pks-t Aug 11, 2025
9ff2129
midx: drop redundant `struct repository` parameter
pks-t Aug 11, 2025
017db7b
midx: load multi-pack indices via their source
pks-t Aug 11, 2025
c3f5d25
midx: write multi-pack indices via their source
pks-t Aug 11, 2025
7744936
midx: stop duplicating info redundant with its owning source
pks-t Aug 11, 2025
13296ac
midx: compute paths via their source
pks-t Aug 11, 2025
d14147c
doc: git-add: clarify intro & add an example
jvns Aug 19, 2025
929e112
doc: git-add: simplify discussion of ignored files
jvns Aug 19, 2025
e5c27bd
doc: rephrase the purpose of the staging area
jvns Aug 29, 2025
2f4bf83
doc: fix formatting of function-wrap shell alias
kemitchell Sep 1, 2025
608cf5b
gitlab-ci: disable realtime monitoring to unbreak Windows jobs
pks-t Sep 2, 2025
0f0a8a1
builtin/refs: add 'exists' subcommand
inosmeet Aug 26, 2025
0749b93
t1403: split 'show-ref --exists' tests into a separate file
inosmeet Aug 26, 2025
01d429c
t1422: refactor tests to be shareable
inosmeet Aug 26, 2025
ef94b3e
t: add test for git refs exists subcommand
inosmeet Aug 26, 2025
bb4a83b
doc: add missing backtick for inline-verbatim
LemmingAvalanche Sep 2, 2025
b0d97aa
doc: remove extra backtick for inline-verbatim
LemmingAvalanche Sep 2, 2025
30598cc
describe: use oidset in finish_depth_computation()
rscharfe Sep 2, 2025
f9a6705
t0450: add allowlist for builtins with missing .adoc
To1ne Aug 8, 2025
4065e48
Merge branch 'je/doc-add'
gitster Sep 12, 2025
c31a276
Merge branch 'ps/object-store-midx-dedup-info'
gitster Sep 12, 2025
07f2947
Merge branch 'ms/refs-exists'
gitster Sep 12, 2025
ca3999d
Merge branch 'ps/gitlab-ci-disable-windows-monitoring'
gitster Sep 12, 2025
ed19b95
Merge branch 'km/alias-doc-markup-fix'
gitster Sep 12, 2025
4097eac
Merge branch 'kh/doc-markup-fixes'
gitster Sep 12, 2025
f67058f
Merge branch 'tc/t0450-harden'
gitster Sep 12, 2025
da3799a
Merge branch 'rs/describe-with-lazy-queue-and-oidset'
gitster Sep 12, 2025
92c87bd
The eighth batch
gitster Sep 12, 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
3 changes: 3 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ build:mingw64:
variables:
NO_PERL: 1
before_script:
- Set-MpPreference -DisableRealtimeMonitoring $true
- ./ci/install-sdk.ps1 -directory "git-sdk"
script:
- git-sdk/usr/bin/bash.exe -l -c 'ci/make-test-artifacts.sh artifacts'
Expand All @@ -135,6 +136,7 @@ test:mingw64:
- job: "build:mingw64"
artifacts: true
before_script:
- Set-MpPreference -DisableRealtimeMonitoring $true
- git-sdk/usr/bin/bash.exe -l -c 'tar xf artifacts/artifacts.tar.gz'
- New-Item -Path .git/info -ItemType Directory
- New-Item .git/info/exclude -ItemType File -Value "/git-sdk"
Expand All @@ -148,6 +150,7 @@ test:mingw64:
tags:
- saas-windows-medium-amd64
before_script:
- Set-MpPreference -DisableRealtimeMonitoring $true
- choco install -y git meson ninja openssl
- Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
- refreshenv
Expand Down
18 changes: 18 additions & 0 deletions Documentation/RelNotes/2.52.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ UI, Workflows & Features
* A new command "git last-modified" has been added to show the closest
ancestor commit that touched each path.

* "git refs exists" that works like "git show-ref --exists" has been
added.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -47,6 +50,11 @@ Performance, Internal Implementation, Development Support etc.
hash function implementation used to hash lines have been updated
to the one used for ELF symbol lookup by Glibc.

* Instead of scanning for the remaining items to see if there are
still commits to be explored in the queue, use khash to remember
which items are still on the queue (an unacceptable alternative is
to reserve one object flag bits).


Fixes since v2.51
-----------------
Expand Down Expand Up @@ -151,6 +159,11 @@ including security updates, are included in this release.
this.
(merge 681f26bccc ds/ls-files-lazy-unsparse later to maint).

* Windows "real-time monitoring" interferes with the execution of
tests and affects negatively in both correctness and performance,
which has been disabled in Gitlab CI.
(merge 608cf5b793 ps/gitlab-ci-disable-windows-monitoring 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 @@ -164,3 +177,8 @@ including security updates, are included in this release.
(merge 374579c6d4 kh/doc-interpret-trailers-markup-fix later to maint).
(merge 44dce6541c kh/doc-config-typofix later to maint).
(merge 785628b173 js/doc-sending-patch-via-thunderbird later to maint).
(merge e5c27bd3d8 je/doc-add later to maint).
(merge 13296ac909 ps/object-store-midx-dedup-info later to maint).
(merge 2f4bf83ffc km/alias-doc-markup-fix later to maint).
(merge b0d97aac19 kh/doc-markup-fixes later to maint).
(merge f9a6705d9a tc/t0450-harden later to maint).
2 changes: 1 addition & 1 deletion Documentation/config/alias.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ it will be treated as a shell command. For example, defining
** A convenient way to deal with this is to write your script
operations in an inline function that is then called with any
arguments from the command-line. For example `alias.cmd = "!c() {
echo $1 | grep $2 ; }; c" will correctly execute the prior example.
echo $1 | grep $2 ; }; c"` will correctly execute the prior example.
** Setting `GIT_TRACE=1` can help you debug the command being run for
your alias.
2 changes: 1 addition & 1 deletion Documentation/fetch-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--no-all::
Fetch all remotes, except for the ones that has the
`remote.<name>.skipFetchAll` configuration variable set.
This overrides the configuration variable fetch.all`.
This overrides the configuration variable `fetch.all`.

-a::
--append::
Expand Down
34 changes: 16 additions & 18 deletions Documentation/git-add.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [-

DESCRIPTION
-----------
This command updates the index using the current content found in
the working tree, to prepare the content staged for the next commit.
It typically adds the current content of existing paths as a whole,
but with some options it can also be used to add content with
only part of the changes made to the working tree files applied, or
remove paths that do not exist in the working tree anymore.

The "index" holds a snapshot of the content of the working tree, and it
is this snapshot that is taken as the contents of the next commit. Thus
after making any changes to the working tree, and before running
the commit command, you must use the `add` command to add any new or
modified files to the index.
Add contents of new or changed files to the index. The "index" (also
known as the "staging area") is what you use to prepare the contents of
the next commit.

When you run `git commit` without any other arguments, it will only
commit staged changes. For example, if you've edited `file.c` and want
to commit your changes to that file, you can run:

git add file.c
git commit

You can also add only part of your changes to a file with `git add -p`.

This command can be performed multiple times before a commit. It only
adds the content of the specified file(s) at the time the add command is
Expand All @@ -37,12 +37,10 @@ you must run `git add` again to add the new content to the index.
The `git status` command can be used to obtain a summary of which
files have changes that are staged for the next commit.

The `git add` command will not add ignored files by default. If any
ignored files were explicitly specified on the command line, `git add`
will fail with a list of ignored files. Ignored files reached by
directory recursion or filename globbing performed by Git (quote your
globs before the shell) will be silently ignored. The `git add` command can
be used to add ignored files with the `-f` (force) option.
The `git add` command will not add ignored files by default. You can
use the `--force` option to add ignored files. If you specify the exact
filename of an ignored file, `git add` will fail with a list of ignored
files. Otherwise it will silently ignore the file.

Please see linkgit:git-commit[1] for alternative ways to add content to a
commit.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-fast-import.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ External data format::
+
Here usually `<dataref>` must be either a mark reference (`:<idnum>`)
set by a prior `blob` command, or a full 40-byte SHA-1 of an
existing Git blob object. If `<mode>` is `040000`` then
existing Git blob object. If `<mode>` is `040000` then
`<dataref>` must be the full 40-byte SHA-1 of an existing
Git tree object or a mark reference set with `--import-marks`.

Expand Down
2 changes: 1 addition & 1 deletion Documentation/git-multi-pack-index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ OPTIONS
--no-progress::
Turn progress on/off explicitly. If neither is specified, progress is
shown if standard error is connected to a terminal. Supported by
sub-commands `write`, `verify`, `expire`, and `repack.
sub-commands `write`, `verify`, `expire`, and `repack`.

The following subcommands are available:

Expand Down
7 changes: 7 additions & 0 deletions Documentation/git-refs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ git refs list [--count=<count>] [--shell|--perl|--python|--tcl]
[--contains[=<object>]] [--no-contains[=<object>]]
[(--exclude=<pattern>)...] [--start-after=<marker>]
[ --stdin | (<pattern>...)]
git refs exists <ref>

DESCRIPTION
-----------
Expand All @@ -38,6 +39,12 @@ list::
formatting, and sorting. This subcommand is an alias for
linkgit:git-for-each-ref[1] and offers identical functionality.

exists::
Check whether the given reference exists. Returns an exit code of 0 if
it does, 2 if it is missing, and 1 in case looking up the reference
failed with an error other than the reference being missing. This does
not verify whether the reference resolves to an actual object.

OPTIONS
-------

Expand Down
4 changes: 2 additions & 2 deletions builtin/commit-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static int graph_verify(int argc, const char **argv, const char *prefix,
if (opts.progress)
flags |= COMMIT_GRAPH_WRITE_PROGRESS;

source = odb_find_source(the_repository->objects, opts.obj_dir);
source = odb_find_source_or_die(the_repository->objects, opts.obj_dir);
graph_name = get_commit_graph_filename(source);
chain_name = get_commit_graph_chain_filename(source);
if (open_commit_graph(graph_name, &fd, &st))
Expand Down Expand Up @@ -291,7 +291,7 @@ static int graph_write(int argc, const char **argv, const char *prefix,
git_env_bool(GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS, 0))
flags |= COMMIT_GRAPH_WRITE_BLOOM_FILTERS;

source = odb_find_source(the_repository->objects, opts.obj_dir);
source = odb_find_source_or_die(the_repository->objects, opts.obj_dir);

if (opts.reachable) {
if (write_commit_graph_reachable(source, flags, &write_opts))
Expand Down
34 changes: 22 additions & 12 deletions builtin/describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "commit-slab.h"
#include "wildmatch.h"
#include "prio-queue.h"
#include "oidset.h"

#define MAX_TAGS (FLAG_BITS - 1)
#define DEFAULT_CANDIDATES 10
Expand Down Expand Up @@ -286,38 +287,47 @@ static void lazy_queue_clear(struct lazy_queue *queue)
queue->get_pending = false;
}

static bool all_have_flag(const struct lazy_queue *queue, unsigned flag)
static unsigned long finish_depth_computation(struct lazy_queue *queue,
struct possible_tag *best)
{
unsigned long seen_commits = 0;
struct oidset unflagged = OIDSET_INIT;

for (size_t i = queue->get_pending ? 1 : 0; i < queue->queue.nr; i++) {
struct commit *commit = queue->queue.array[i].data;
if (!(commit->object.flags & flag))
return false;
if (!(commit->object.flags & best->flag_within))
oidset_insert(&unflagged, &commit->object.oid);
}
return true;
}

static unsigned long finish_depth_computation(struct lazy_queue *queue,
struct possible_tag *best)
{
unsigned long seen_commits = 0;
while (!lazy_queue_empty(queue)) {
struct commit *c = lazy_queue_get(queue);
struct commit_list *parents = c->parents;
seen_commits++;
if (c->object.flags & best->flag_within) {
if (all_have_flag(queue, best->flag_within))
if (!oidset_size(&unflagged))
break;
} else
} else {
oidset_remove(&unflagged, &c->object.oid);
best->depth++;
}
while (parents) {
unsigned seen, flag_before, flag_after;
struct commit *p = parents->item;
repo_parse_commit(the_repository, p);
if (!(p->object.flags & SEEN))
seen = p->object.flags & SEEN;
if (!seen)
lazy_queue_put(queue, p);
flag_before = p->object.flags & best->flag_within;
p->object.flags |= c->object.flags;
flag_after = p->object.flags & best->flag_within;
if (!seen && !flag_after)
oidset_insert(&unflagged, &p->object.oid);
if (seen && !flag_before && flag_after)
oidset_remove(&unflagged, &p->object.oid);
parents = parents->next;
}
}
oidset_clear(&unflagged);
return seen_commits;
}

Expand Down
31 changes: 24 additions & 7 deletions builtin/multi-pack-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,20 @@ static int parse_object_dir(const struct option *opt, const char *arg,
char **value = opt->value;
free(*value);
if (unset)
*value = xstrdup(repo_get_object_directory(the_repository));
*value = xstrdup(the_repository->objects->sources->path);
else
*value = real_pathdup(arg, 1);
return 0;
}

static struct odb_source *handle_object_dir_option(struct repository *repo)
{
struct odb_source *source = odb_find_source(repo->objects, opts.object_dir);
if (!source)
source = odb_add_to_alternates_memory(repo->objects, opts.object_dir);
return source;
}

static struct option common_opts[] = {
OPT_CALLBACK(0, "object-dir", &opts.object_dir,
N_("directory"),
Expand Down Expand Up @@ -140,6 +148,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
N_("refs snapshot for selecting bitmap commits")),
OPT_END(),
};
struct odb_source *source;
int ret;

opts.flags |= MIDX_WRITE_BITMAP_HASH_CACHE;
Expand All @@ -158,6 +167,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,
if (argc)
usage_with_options(builtin_multi_pack_index_write_usage,
options);
source = handle_object_dir_option(repo);

FREE_AND_NULL(options);

Expand All @@ -166,7 +176,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,

read_packs_from_stdin(&packs);

ret = write_midx_file_only(repo, opts.object_dir, &packs,
ret = write_midx_file_only(source, &packs,
opts.preferred_pack,
opts.refs_snapshot, opts.flags);

Expand All @@ -177,7 +187,7 @@ static int cmd_multi_pack_index_write(int argc, const char **argv,

}

ret = write_midx_file(repo, opts.object_dir, opts.preferred_pack,
ret = write_midx_file(source, opts.preferred_pack,
opts.refs_snapshot, opts.flags);

free(opts.refs_snapshot);
Expand All @@ -194,6 +204,8 @@ static int cmd_multi_pack_index_verify(int argc, const char **argv,
N_("force progress reporting"), MIDX_PROGRESS),
OPT_END(),
};
struct odb_source *source;

options = add_common_options(builtin_multi_pack_index_verify_options);

trace2_cmd_mode(argv[0]);
Expand All @@ -206,10 +218,11 @@ static int cmd_multi_pack_index_verify(int argc, const char **argv,
if (argc)
usage_with_options(builtin_multi_pack_index_verify_usage,
options);
source = handle_object_dir_option(the_repository);

FREE_AND_NULL(options);

return verify_midx_file(the_repository, opts.object_dir, opts.flags);
return verify_midx_file(source, opts.flags);
}

static int cmd_multi_pack_index_expire(int argc, const char **argv,
Expand All @@ -222,6 +235,8 @@ static int cmd_multi_pack_index_expire(int argc, const char **argv,
N_("force progress reporting"), MIDX_PROGRESS),
OPT_END(),
};
struct odb_source *source;

options = add_common_options(builtin_multi_pack_index_expire_options);

trace2_cmd_mode(argv[0]);
Expand All @@ -234,10 +249,11 @@ static int cmd_multi_pack_index_expire(int argc, const char **argv,
if (argc)
usage_with_options(builtin_multi_pack_index_expire_usage,
options);
source = handle_object_dir_option(the_repository);

FREE_AND_NULL(options);

return expire_midx_packs(the_repository, opts.object_dir, opts.flags);
return expire_midx_packs(source, opts.flags);
}

static int cmd_multi_pack_index_repack(int argc, const char **argv,
Expand All @@ -252,6 +268,7 @@ static int cmd_multi_pack_index_repack(int argc, const char **argv,
N_("force progress reporting"), MIDX_PROGRESS),
OPT_END(),
};
struct odb_source *source;

options = add_common_options(builtin_multi_pack_index_repack_options);

Expand All @@ -266,11 +283,11 @@ static int cmd_multi_pack_index_repack(int argc, const char **argv,
if (argc)
usage_with_options(builtin_multi_pack_index_repack_usage,
options);
source = handle_object_dir_option(the_repository);

FREE_AND_NULL(options);

return midx_repack(the_repository, opts.object_dir,
(size_t)opts.batch_size, opts.flags);
return midx_repack(source, (size_t)opts.batch_size, opts.flags);
}

int cmd_multi_pack_index(int argc,
Expand Down
2 changes: 1 addition & 1 deletion builtin/pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ static int want_object_in_pack_mtime(const struct object_id *oid,
struct multi_pack_index *m = get_multi_pack_index(source);
struct pack_entry e;

if (m && fill_midx_entry(the_repository, oid, &e, m)) {
if (m && fill_midx_entry(m, oid, &e)) {
want = want_object_in_pack_one(e.p, oid, exclude, found_pack, found_offset, found_mtime);
if (want != -1)
return want;
Expand Down
Loading