Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
368565e
t7900: simplify how we check for maintenance tasks
pks-t Jul 13, 2026
37deb9b
odb: run "pre-auto-gc" hook for all maintenance tasks
pks-t Jul 13, 2026
3f86968
builtin/gc: move worktree and rerere tasks before object optimizations
pks-t Jul 13, 2026
e86fe6f
builtin/gc: extract object database optimizations into separate function
pks-t Jul 13, 2026
4d93bf9
builtin/gc: make repack arguments self-contained
pks-t Jul 13, 2026
57ca517
builtin/gc: inline config values specific to the "files" backend
pks-t Jul 13, 2026
cc78c50
builtin/gc: introduce object database optimization options
pks-t Jul 13, 2026
7d663dd
builtin/gc: move geometric repacking into `odb_optimize()`
pks-t Jul 13, 2026
841ca63
builtin/gc: introduce `odb_optimize_required()`
pks-t Jul 13, 2026
0a77889
builtin/gc: refactor ODB optimizations to operate on "files" source
pks-t Jul 13, 2026
7534d45
builtin/gc: fix signedness issues in ODB-related functionality
pks-t Jul 13, 2026
56f3fc9
odb: make optimizations pluggable
pks-t Jul 13, 2026
88efab5
diff: ignore unmerged paths outside prefix with --relative --cached
peff Jul 15, 2026
7780bff
branch: report active bisect run when rejecting delete
rscharfe Jul 25, 2026
ae0780d
bloom: silence CHECK_ASSERTION_SIDE_EFFECTS false positive
peff Jul 26, 2026
1a1579c
ci: bump ubuntu image version for static-analysis job
peff Jul 26, 2026
2f5ff2c
rebase -i: fix counting of fixups after rebase --skip
phillipwood Jul 26, 2026
4a3a8ee
rebase: remember fixup -c after skipping fixup/squash
phillipwood Jul 26, 2026
447126e
diff-lib: add idx/tree sanity check to oneway_diff
peff Jul 28, 2026
c57c052
mingw: skip symlink type auto-detection for network share targets
dscho Jul 28, 2026
b678bb7
t0014: factor out choice of deprecated commands
peff Jul 28, 2026
bc57ecb
t0014: generate deprecated command names dynamically
peff Jul 28, 2026
6375b40
mailmap: change primary address for Christian Couder
chriscool Aug 3, 2026
7a403c3
mailmap: change primary address for D. Ben Knoble
benknoble Aug 5, 2026
f072d0e
Merge branch 'jk/diff-relative-cached-unmerged'
gitster Aug 5, 2026
524d5ad
Merge branch 'pw/rebase-fixup-fixes'
gitster Aug 5, 2026
82c48ea
Merge branch 'ps/odb-pluggable-housekeeping'
gitster Aug 5, 2026
67b1d2f
Merge branch 'rs/branch-delete-bisect-warning'
gitster Aug 5, 2026
2816039
Merge branch 'jk/ci-static-analysis-image-bump'
gitster Aug 5, 2026
7943c6b
Merge branch 'jk/t0014-dynamic-deprecated-cmds'
gitster Aug 5, 2026
c165f38
Merge branch 'js/mingw-symlink-net-share-leak'
gitster Aug 5, 2026
2c78326
The 11th batch
gitster Aug 5, 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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ jobs:
if: needs.ci-config.outputs.enabled == 'yes'
env:
jobname: StaticAnalysis
CI_JOB_IMAGE: ubuntu-22.04
runs-on: ubuntu-22.04
CI_JOB_IMAGE: ubuntu-latest
runs-on: ubuntu-latest
concurrency:
group: static-analysis-${{ github.ref }}
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ test:fuzz-smoke-tests:
- ./ci/run-build-and-minimal-fuzzers.sh

static-analysis:
image: ubuntu:22.04
image: ubuntu:latest
stage: analyze
needs: [ ]
variables:
Expand Down
3 changes: 2 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ Chris Shoemaker <c.shoemaker@cox.net>
Chris Wright <chrisw@sous-sol.org> <chrisw@osdl.org>
Christian Ludwig <chrissicool@gmail.com> <chrissicool@googlemail.com>
Cord Seele <cowose@gmail.com> <cowose@googlemail.com>
Christian Couder <chriscool@tuxfamily.org> <christian.couder@gmail.com>
Christian Couder <christian.couder@gmail.com> <chriscool@tuxfamily.org>
Christian Stimming <stimming@tuhh.de> <chs@ckiste.goetheallee>
Christopher D铆az Riveros <chrisadr@gentoo.org> Christopher Diaz Riveros
Clemens Buchacher <drizzd@gmx.net> <drizzd@aon.at>
Clemens Buchacher <drizzd@gmx.net> <clemens.buchacher@intel.com>
Csaba Henk <csaba@gluster.com> <csaba@lowlife.hu>
D. Ben Knoble <ben.knoble@gmail.com> <ben.knoble+github@gmail.com>
Dan Johnson <computerdruid@gmail.com>
Dana L. How <danahow@gmail.com> <how@deathvalley.cswitch.com>
Dana L. How <danahow@gmail.com> Dana How
Expand Down
41 changes: 41 additions & 0 deletions Documentation/RelNotes/2.56.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ UI, Workflows & Features
filtered on the client based on server-advertised capabilities,
returning empty strings for inapplicable or unsupported fields.

* 'git branch -d' has been taught to report when a branch cannot be
deleted because it is being used in an active bisect run.


Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
Expand Down Expand Up @@ -280,6 +283,21 @@ Performance, Internal Implementation, Development Support etc.
first refactoring force_object_loose() to use generic ODB write
interfaces instead of loose-backend internals.

* Object database housekeeping in 'git gc' and 'git maintenance' has
been refactored to be pluggable. The files-backend-specific logic,
including incremental and geometric repacking as well as object
pruning, has been moved out of the command implementation and into the
files object database source, enabling future alternative object
database backends to implement their own housekeeping services.

* The image version used by the static-analysis CI job has been bumped
to ubuntu-latest (Ubuntu 24.04), which brings in a newer Coccinelle
version that resolves a severe performance regression. A false
positive warning from the 'CHECK_ASSERTION_SIDE_EFFECTS' build with
GCC 15 in the Bloom filter code has also been silenced to facilitate
the image upgrade.
(merge 1a1579c42d jk/ci-static-analysis-image-bump later to maint).


Fixes since v2.55
-----------------
Expand Down Expand Up @@ -466,3 +484,26 @@ Fixes since v2.55
* The remote-matching logic for submodules has been corrected to resolve
'url.*.insteadOf' aliases before comparing the inventoried URL from
'.gitmodules' with the URLs of configured remotes.

* 'git diff --relative' running with '--cached' has been corrected to
avoid a segfault when encountering unmerged paths outside the
prefix.
(merge 447126ed7d jk/diff-relative-cached-unmerged later to maint).

* Two bugs in how 'git rebase' handles skipped 'fixup' and 'squash'
commands have been fixed. One bug caused an incorrect commit count to
be shown in the template message when multiple commands were skipped,
and another prevented the editor from opening when the final command
in a chain containing 'fixup -c' was skipped.

* The alias tests in 't/t0014-alias.sh' have been updated to dynamically
query the list of deprecated commands using 'git
--list-cmds=deprecated' to avoid test failures when running with
'WITH_BREAKING_CHANGES' in a build directory that contains stale
executables of formerly deprecated commands.
(merge bc57ecb915 jk/t0014-dynamic-deprecated-cmds later to maint).

* Git for Windows has been updated to avoid auto-detecting the symlink
type if the target path starts with a slash, preventing NTLM
credential leaks when checking out repositories with crafted
symbolic links pointing to network shares.
6 changes: 3 additions & 3 deletions bloom.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,10 @@ int bloom_filter_contains_vec(const struct bloom_filter *filter,
uint32_t test_bloom_murmur3_seeded(uint32_t seed, const char *data, size_t len,
int version)
{
assert(version == 1 || version == 2);

if (version == 2)
return murmur3_seeded_v2(seed, data, len);
else
else if (version == 1)
return murmur3_seeded_v1(seed, data, len);
else
BUG("unexpected bloom version: %d", version);
}
80 changes: 57 additions & 23 deletions branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,39 @@ int validate_branchname(const char *name, struct strbuf *ref)
static int initialized_checked_out_branches;
static struct strmap current_checked_out_branches = STRMAP_INIT;

enum branch_checkout_kind {
BRANCH_CHECKOUT_KIND_CHECKOUT,
BRANCH_CHECKOUT_KIND_REBASE,
BRANCH_CHECKOUT_KIND_BISECT,
BRANCH_CHECKOUT_KIND_UPDATE_REF,
};

struct checked_out_branch {
char *refname;
char *path;
enum branch_checkout_kind kind;
};

static struct checked_out_branch *checked_out_branches;
static size_t checked_out_branches_alloc, checked_out_branches_nr;

static void register_checked_out_branch(const char *prefix, const char *name,
const char *path,
enum branch_checkout_kind kind)
{
char *refname = xstrfmt("%s%s", prefix, name);
char *path_copy = xstrdup(path);

ALLOC_GROW(checked_out_branches, checked_out_branches_nr + 1,
checked_out_branches_alloc);
checked_out_branches[checked_out_branches_nr].refname = refname;
checked_out_branches[checked_out_branches_nr].path = path_copy;
checked_out_branches[checked_out_branches_nr].kind = kind;
checked_out_branches_nr++;

strmap_put(&current_checked_out_branches, refname, path_copy);
}

static void prepare_checked_out_branches(void)
{
int i = 0;
Expand All @@ -397,7 +430,7 @@ static void prepare_checked_out_branches(void)
worktrees = get_worktrees(the_repository);

while (worktrees[i]) {
char *old, *wt_gitdir;
char *wt_gitdir;
struct wt_status_state state = { 0 };
struct worktree *wt = worktrees[i++];
struct string_list update_refs = STRING_LIST_INIT_DUP;
Expand All @@ -406,34 +439,25 @@ static void prepare_checked_out_branches(void)
continue;

if (wt->head_ref) {
old = strmap_put(&current_checked_out_branches,
wt->head_ref,
xstrdup(wt->path));
free(old);
register_checked_out_branch("", wt->head_ref, wt->path,
BRANCH_CHECKOUT_KIND_CHECKOUT);
}

if (wt_status_check_rebase(wt, &state) &&
(state.rebase_in_progress || state.rebase_interactive_in_progress) &&
state.branch) {
struct strbuf ref = STRBUF_INIT;
strbuf_addf(&ref, "refs/heads/%s", state.branch);
old = strmap_put(&current_checked_out_branches,
ref.buf,
xstrdup(wt->path));
free(old);
strbuf_release(&ref);
register_checked_out_branch("refs/heads/", state.branch,
wt->path,
BRANCH_CHECKOUT_KIND_REBASE);
}
wt_status_state_free_buffers(&state);

if (wt_status_check_bisect(wt, &state) &&
state.bisecting_from) {
struct strbuf ref = STRBUF_INIT;
strbuf_addf(&ref, "refs/heads/%s", state.bisecting_from);
old = strmap_put(&current_checked_out_branches,
ref.buf,
xstrdup(wt->path));
free(old);
strbuf_release(&ref);
register_checked_out_branch("refs/heads/",
state.bisecting_from,
wt->path,
BRANCH_CHECKOUT_KIND_BISECT);
}
wt_status_state_free_buffers(&state);

Expand All @@ -442,10 +466,9 @@ static void prepare_checked_out_branches(void)
&update_refs)) {
struct string_list_item *item;
for_each_string_list_item(item, &update_refs) {
old = strmap_put(&current_checked_out_branches,
item->string,
xstrdup(wt->path));
free(old);
register_checked_out_branch("", item->string,
wt->path,
BRANCH_CHECKOUT_KIND_UPDATE_REF);
}
string_list_clear(&update_refs, 1);
}
Expand All @@ -462,6 +485,17 @@ const char *branch_checked_out(const char *refname)
return strmap_get(&current_checked_out_branches, refname);
}

const char *branch_bisecting(const char *refname)
{
prepare_checked_out_branches();
for (size_t i = 0; i < checked_out_branches_nr; i++) {
if (!strcmp(refname, checked_out_branches[i].refname) &&
checked_out_branches[i].kind == BRANCH_CHECKOUT_KIND_BISECT)
return checked_out_branches[i].path;
}
return NULL;
}

/*
* Check if a branch 'name' can be created as a new branch; die otherwise.
* 'force' can be used when it is OK for the named branch already exists.
Expand Down
6 changes: 6 additions & 0 deletions branch.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ void create_branches_recursively(struct repository *r, const char *name,
*/
const char *branch_checked_out(const char *refname);

/*
* If the branch at 'refname' is currently used for bisecting in a
* worktree, then return the path to that worktree.
*/
const char *branch_bisecting(const char *refname);

/*
* Check if 'name' can be a valid name for a branch; die otherwise.
* Return 1 if the named branch already exists; return 0 otherwise.
Expand Down
7 changes: 7 additions & 0 deletions builtin/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,

if (kinds == FILTER_REFS_BRANCHES) {
const char *path;
if ((path = branch_bisecting(name))) {
error(_("cannot delete branch '%s' "
"used by worktree at '%s' for bisect"),
bname.buf, path);
ret = 1;
continue;
}
if ((path = branch_checked_out(name))) {
error(_("cannot delete branch '%s' "
"used by worktree at '%s'"),
Expand Down
Loading
Loading