1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-10 09:56:10 +02:00
git/builtin
Patrick Steinhardt 9f6714ab3e builtin/gc: pack refs when using `git maintenance run --auto`
When running `git maintenance run --auto`, then the various subtasks
will only run as needed. Thus, we for example end up only packing loose
objects if we hit a certain threshold.

Interestingly enough, the "pack-refs" task is actually _never_ executed
when the auto-flag is set because it does not have a condition at all.
As 41abfe15d9 (maintenance: add pack-refs task, 2021-02-09) mentions:

    The 'auto_condition' function pointer is left NULL for now. We could
    extend this in the future to have a condition check if pack-refs
    should be run during 'git maintenance run --auto'.

It is not quite clear from that quote whether it is actually intended
that the task doesn't run at all in this mode. Also, no test was added
to verify this behaviour. Ultimately though, it feels quite surprising
that `git maintenance run --auto --task=pack-refs` would quietly never
do anything at all.

In any case, now that we do have the logic in place to let ref backends
decide whether or not to repack refs, it does make sense to wire it up
accordingly. With the "reftable" backend we will thus now perform
auto-compaction, which optimizes the refdb as needed.

But for the "files" backend we now unconditionally pack refs as it does
not yet know to handle the "auto" flag. Arguably, this can be seen as a
bug fix given that previously the task never did anything at all.
Eventually though we should amend the "files" backend to use some
heuristics for auto compaction, as well.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-03-25 09:54:07 -07:00
..
add.c Merge branch 'eg/add-uflags' 2024-03-07 15:59:41 -08:00
am.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
annotate.c
apply.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
archive.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:33 -08:00
bisect.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
blame.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
branch.c Merge branch 'kh/branch-ref-syntax-advice' 2024-03-15 16:05:59 -07:00
bugreport.c
bundle.c
cat-file.c Merge branch 'js/check-null-from-read-object-file' 2024-02-14 15:36:06 -08:00
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout--worker.c
checkout-index.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
checkout.c Merge branch 'js/merge-tree-3-trees' 2024-03-07 15:59:41 -08:00
clean.c clean: further clean-up of implementation around "--force" 2024-03-04 14:05:13 -08:00
clone.c Merge branch 'as/option-names-in-messages' 2024-03-15 16:05:59 -07:00
column.c column: disallow negative padding 2024-02-13 10:18:50 -08:00
commit-graph.c Merge branch 'ja/doc-placeholders-fix' 2024-02-08 13:20:34 -08:00
commit-tree.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
commit.c Merge branch 'jt/commit-redundant-scissors-fix' 2024-03-07 15:59:41 -08:00
config.c config: add back code comment 2024-01-29 10:27:53 -08:00
count-objects.c
credential-cache--daemon.c
credential-cache.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
credential-store.c
credential.c
describe.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diagnose.c
diff-files.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diff-index.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diff-tree.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diff.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
difftool.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
fast-export.c use xstrncmpz() 2024-02-12 09:32:41 -08:00
fast-import.c commit-reach(repo_in_merge_bases_many): report missing commits 2024-02-28 09:47:03 -08:00
fetch-pack.c
fetch.c Merge branch 'js/merge-base-with-missing-commit' 2024-03-11 14:12:30 -07:00
fmt-merge-msg.c
for-each-ref.c for-each-ref: add new option to include root refs 2024-02-23 10:36:28 -08:00
for-each-repo.c
fsck.c refs: drop unused params from the reflog iterator callback 2024-02-21 09:58:06 -08:00
fsmonitor--daemon.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:33 -08:00
gc.c builtin/gc: pack refs when using `git maintenance run --auto` 2024-03-25 09:54:07 -07:00
get-tar-commit-id.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
grep.c Merge branch 'js/check-null-from-read-object-file' 2024-02-14 15:36:06 -08:00
hash-object.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
help.c
hook.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
index-pack.c unpack: replace xwrite() loop with write_in_full() 2024-03-02 11:12:16 -08:00
init-db.c Merge branch 'ps/refstorage-extension' 2024-01-16 10:11:57 -08:00
interpret-trailers.c format_trailers(): use strbuf instead of FILE 2024-03-01 10:35:42 -08:00
log.c commit-reach(repo_get_merge_bases_many): pass on "missing commits" errors 2024-02-29 08:06:01 -08:00
ls-files.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
ls-remote.c Merge branch 'en/header-cleanup' 2024-01-08 14:05:15 -08:00
ls-tree.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
mailinfo.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
mailsplit.c
merge-base.c commit-reach(repo_get_merge_bases_many_dirty): pass on errors 2024-02-29 08:06:01 -08:00
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
merge-tree.c Merge branch 'js/merge-base-with-missing-commit' 2024-03-11 14:12:30 -07:00
merge.c Merge branch 'js/merge-base-with-missing-commit' 2024-03-11 14:12:30 -07:00
mktag.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:33 -08:00
mktree.c
multi-pack-index.c
mv.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
name-rev.c name-rev: use mem_pool_strfmt() 2024-02-26 09:35:40 -08:00
notes.c Merge branch 'js/check-null-from-read-object-file' 2024-02-14 15:36:06 -08:00
pack-objects.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
pack-redundant.c
pack-refs.c builtin/pack-refs: introduce new "--auto" flag 2024-03-25 09:54:07 -07:00
patch-id.c
prune-packed.c
prune.c
pull.c commit-reach(get_octopus_merge_bases): pass on "missing commits" errors 2024-02-29 08:06:01 -08:00
push.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
range-diff.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
read-tree.c Merge branch 'js/merge-tree-3-trees' 2024-03-07 15:59:41 -08:00
rebase.c Merge branch 'js/merge-base-with-missing-commit' 2024-03-11 14:12:30 -07:00
receive-pack.c commit-reach(repo_in_merge_bases_many): report missing commits 2024-02-28 09:47:03 -08:00
reflog.c Merge branch 'ps/reflog-list' into HEAD 2024-03-01 14:38:55 -08:00
remote-ext.c
remote-fd.c
remote.c builtin/remote.c: trivial fix of error message 2024-03-05 14:11:56 -08:00
repack.c repack: check error writing to pack-objects subprocess 2024-03-02 11:12:16 -08:00
replace.c
replay.c
rerere.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
reset.c Merge branch 'js/merge-tree-3-trees' 2024-03-07 15:59:41 -08:00
rev-list.c rev-list: allow missing tips with --missing=[print|allow*] 2024-02-14 09:39:14 -08:00
rev-parse.c commit-reach(repo_get_merge_bases): pass on "missing commits" errors 2024-02-29 08:06:01 -08:00
revert.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
rm.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
send-pack.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
shortlog.c
show-branch.c
show-index.c
show-ref.c Merge branch 'tc/show-ref-exists-fix' into maint-2.43 2024-02-13 14:44:47 -08:00
sparse-checkout.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
stash.c Merge branch 'ps/report-failure-from-git-stash' into maint-2.43 2024-02-13 14:44:49 -08:00
stripspace.c
submodule--helper.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
symbolic-ref.c
tag.c Merge branch 'rj/tag-column-fix' 2024-02-27 16:04:32 -08:00
unpack-file.c
unpack-objects.c unpack: replace xwrite() loop with write_in_full() 2024-03-02 11:12:16 -08:00
update-index.c
update-ref.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
update-server-info.c
upload-archive.c
upload-pack.c upload-pack: always turn off save_commit_buffer 2024-02-28 14:42:01 -08:00
var.c config: rename global config function 2024-01-18 12:17:41 -08:00
verify-commit.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
verify-pack.c
verify-tag.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
worktree.c Merge branch 'jc/comment-style-fixes' into maint-2.43 2024-02-13 14:44:48 -08:00
write-tree.c