aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/Makefile6
-rw-r--r--Documentation/RelNotes/2.46.0.txt17
-rw-r--r--Documentation/docinfo-html.in5
-rw-r--r--Documentation/git-clone.txt6
-rwxr-xr-xGIT-VERSION-GEN2
-rw-r--r--midx-write.c18
-rw-r--r--refs.c22
-rwxr-xr-xt/t5319-multi-pack-index.sh55
8 files changed, 109 insertions, 22 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile
index dc65759cb1..1bd23fbeef 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -204,12 +204,15 @@ ASCIIDOC_DOCBOOK = docbook5
ASCIIDOC_EXTRA += -acompat-mode -atabsize=8
ASCIIDOC_EXTRA += -I. -rasciidoctor-extensions
ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
+ASCIIDOC_EXTRA += -adocinfo=shared
ASCIIDOC_DEPS = asciidoctor-extensions.rb GIT-ASCIIDOCFLAGS
DBLATEX_COMMON =
XMLTO_EXTRA += --skip-validation
XMLTO_EXTRA += -x manpage.xsl
endif
+ASCIIDOC_DEPS += docinfo.html
+
SHELL_PATH ?= $(SHELL)
# Shell quote;
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
@@ -338,6 +341,9 @@ clean:
$(RM) $(cmds_txt) $(mergetools_txt) *.made
$(RM) GIT-ASCIIDOCFLAGS
+docinfo.html: docinfo-html.in
+ $(QUIET_GEN)$(RM) $@ && cat $< >$@
+
$(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_HTML) -d manpage -o $@ $<
diff --git a/Documentation/RelNotes/2.46.0.txt b/Documentation/RelNotes/2.46.0.txt
index 80620b9317..b25475918a 100644
--- a/Documentation/RelNotes/2.46.0.txt
+++ b/Documentation/RelNotes/2.46.0.txt
@@ -1,10 +1,6 @@
Git v2.46 Release Notes
=======================
-Backward Compatibility Notes
-
- (None at this moment)
-
UI, Workflows & Features
* The "--rfc" option of "git format-patch" learned to take an
@@ -212,7 +208,7 @@ Performance, Internal Implementation, Development Support etc.
* When bundleURI interface fetches multiple bundles, Git failed to
take full advantage of all bundles and ended up slurping duplicated
- objects, which has been corrected..
+ objects, which has been corrected.
* The code to deal with modified paths that are out-of-cone in a
sparsely checked out working tree has been optimized.
@@ -446,6 +442,17 @@ Fixes since v2.45
with warning messages.
(merge 4f5822076f jc/http-cookiefile later to maint).
+ * Repacking a repository with multi-pack index started making stupid
+ pack selections in Git 2.45, which has been corrected.
+ (merge 8fb6d11fad ds/midx-write-repack-fix later to maint).
+
+ * Fix documentation mark-up regression in 2.45.
+ (merge 6474da0aa4 ja/doc-markup-updates-fix later to maint).
+
+ * Work around asciidoctor's css that renders `monospace` material
+ in the SYNOPSIS section of manual pages as block elements.
+ (merge d44ce6ddd5 js/doc-markup-updates-fix later to maint).
+
* Other code cleanup, docfix, build fix, etc.
(merge 493fdae046 ew/object-convert-leakfix later to maint).
(merge 00f3661a0a ss/doc-eol-attr-fix later to maint).
diff --git a/Documentation/docinfo-html.in b/Documentation/docinfo-html.in
new file mode 100644
index 0000000000..fb3560eb92
--- /dev/null
+++ b/Documentation/docinfo-html.in
@@ -0,0 +1,5 @@
+<style>
+pre>code {
+ display: inline;
+}
+</style>
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 5de18de2ab..8e925db7e9 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -13,9 +13,9 @@ SYNOPSIS
[`-l`] [`-s`] [`--no-hardlinks`] [`-q`] [`-n`] [`--bare`] [`--mirror`]
[`-o` _<name>_] [`-b` _<name>_] [`-u` _<upload-pack>_] [`--reference` _<repository>_]
[`--dissociate`] [`--separate-git-dir` _<git-dir>_]
- [`--depth` _<depth>_] [`--`[`no-`]`single-branch`] [`--no-tags`]
- [++--recurse-submodules++[++=++__<pathspec>__]] [`--`[`no-`]`shallow-submodules`]
- [`--`[`no-`]`remote-submodules`] [`--jobs` _<n>_] [`--sparse`] [`--`[`no-`]`reject-shallow`]
+ [`--depth` _<depth>_] [`--`[`no-`]{empty}`single-branch`] [`--no-tags`]
+ [++--recurse-submodules++[++=++__<pathspec>__]] [++--++[++no-++]{empty}++shallow-submodules++]
+ [`--`[`no-`]{empty}`remote-submodules`] [`--jobs` _<n>_] [`--sparse`] [`--`[`no-`]{empty}`reject-shallow`]
[++--filter=++__<filter-spec>__] [`--also-filter-submodules`]] [`--`] _<repository>_
[_<directory>_]
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 8cb2535294..50dcc77cad 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
-DEF_VER=v2.46.0-rc1
+DEF_VER=v2.46.0-rc2
LF='
'
diff --git a/midx-write.c b/midx-write.c
index 478b42e720..a77ee73c68 100644
--- a/midx-write.c
+++ b/midx-write.c
@@ -1499,8 +1499,7 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
repo_config_get_bool(r, "repack.usedeltabaseoffset", &delta_base_offset);
repo_config_get_bool(r, "repack.usedeltaislands", &use_delta_islands);
- strvec_pushl(&cmd.args, "pack-objects", "--stdin-packs", "--non-empty",
- NULL);
+ strvec_push(&cmd.args, "pack-objects");
strvec_pushf(&cmd.args, "%s/pack/pack", object_dir);
@@ -1524,15 +1523,16 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
}
cmd_in = xfdopen(cmd.in, "w");
- for (i = 0; i < m->num_packs; i++) {
- struct packed_git *p = m->packs[i];
- if (!p)
+
+ for (i = 0; i < m->num_objects; i++) {
+ struct object_id oid;
+ uint32_t pack_int_id = nth_midxed_pack_int_id(m, i);
+
+ if (!include_pack[pack_int_id])
continue;
- if (include_pack[i])
- fprintf(cmd_in, "%s\n", pack_basename(p));
- else
- fprintf(cmd_in, "^%s\n", pack_basename(p));
+ nth_midxed_object_oid(&oid, m, i);
+ fprintf(cmd_in, "%s\n", oid_to_hex(&oid));
}
fclose(cmd_in);
diff --git a/refs.c b/refs.c
index bb90a18875..915aeb4d1d 100644
--- a/refs.c
+++ b/refs.c
@@ -2844,6 +2844,14 @@ int repo_migrate_ref_storage_format(struct repository *repo,
}
/*
+ * Release the new ref store such that any potentially-open files will
+ * be closed. This is required for platforms like Cygwin, where
+ * renaming an open file results in EPERM.
+ */
+ ref_store_release(new_refs);
+ FREE_AND_NULL(new_refs);
+
+ /*
* Until now we were in the non-destructive phase, where we only
* populated the new ref store. From hereon though we are about
* to get hands by deleting the old ref store and then moving
@@ -2874,10 +2882,14 @@ int repo_migrate_ref_storage_format(struct repository *repo,
*/
initialize_repository_version(hash_algo_by_ptr(repo->hash_algo), format, 1);
- free(new_refs->gitdir);
- new_refs->gitdir = xstrdup(old_refs->gitdir);
- repo->refs_private = new_refs;
+ /*
+ * Unset the old ref store and release it. `get_main_ref_store()` will
+ * make sure to lazily re-initialize the repository's ref store with
+ * the new format.
+ */
ref_store_release(old_refs);
+ FREE_AND_NULL(old_refs);
+ repo->refs_private = NULL;
ret = 0;
@@ -2888,8 +2900,10 @@ done:
new_gitdir.buf);
}
- if (ret && new_refs)
+ if (new_refs) {
ref_store_release(new_refs);
+ free(new_refs);
+ }
ref_transaction_free(transaction);
strbuf_release(&new_gitdir);
return ret;
diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh
index 10d2a6bf92..ace5ac3b61 100755
--- a/t/t5319-multi-pack-index.sh
+++ b/t/t5319-multi-pack-index.sh
@@ -1027,6 +1027,61 @@ test_expect_success 'repack --batch-size=<large> repacks everything' '
)
'
+test_expect_success 'repack/expire loop' '
+ git init repack-expire &&
+ test_when_finished "rm -fr repack-expire" &&
+ (
+ cd repack-expire &&
+
+ test_commit_bulk 5 &&
+
+ # Create three overlapping pack-files
+ git rev-list --objects HEAD~3 >in-1 &&
+ git rev-list --objects HEAD~4..HEAD~2 >in-2 &&
+ git rev-list --objects HEAD~3..HEAD >in-3 &&
+
+ # Create disconnected blobs
+ obj1=$(git hash-object -w in-1) &&
+ obj2=$(git hash-object -w in-2) &&
+ obj3=$(git hash-object -w in-3) &&
+
+ echo $obj2 >>in-2 &&
+ echo $obj3 >>in-3 &&
+
+ for i in $(test_seq 3)
+ do
+ git pack-objects .git/objects/pack/test-$i <in-$i \
+ || return 1
+ done &&
+
+ rm -fr .git/objects/pack/pack-* &&
+ git multi-pack-index write &&
+
+ for i in $(test_seq 3)
+ do
+ for file in $(ls .git/objects/pack/test-$i*)
+ do
+ test-tool chmtime =+$((3600*$i-25000)) $file || return 1
+ done || return 1
+ done &&
+
+ pack1=$(ls .git/objects/pack/test-1-*.pack) &&
+ pack2=$(ls .git/objects/pack/test-2-*.pack) &&
+ pack3=$(ls .git/objects/pack/test-3-*.pack) &&
+
+ # Prevent test-1 from being rewritten.
+ touch "${pack1%.pack}.keep" &&
+
+ # This repack-expire loop should repack all non-kept packs
+ # into a new pack and then delete the old packs.
+ git multi-pack-index repack &&
+ git multi-pack-index expire &&
+
+ test_path_is_missing $pack3 &&
+ test_path_is_missing $pack2
+ )
+'
+
test_expect_success 'load reverse index when missing .idx, .pack' '
git init repo &&
test_when_finished "rm -fr repo" &&