Message ID | 20241119201016.22713-1-jonathantanmy@google.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 1f2be8bed66dc5911fbbf725246ff0e7dcc209a6 |
Headers | show |
Series | [v2] index-pack: teach --promisor to forbid pack name | expand |
On Tue, Nov 19, 2024 at 12:10:15PM -0800, Jonathan Tan wrote: > Thanks, Peff, for the catch. Here's an updated patch, with an updated > commit message. This looks good to me, thanks. > Range-diff against v1: > [...] > @@ Commit message > test here any more.) > > [1] https://lore.kernel.org/git/20241114005652.GC1140565@coredump.intra.peff.net/ > + [2] https://lore.kernel.org/git/20241119185345.GB15723@coredump.intra.peff.net/ > > Signed-off-by: Jonathan Tan <jonathantanmy@google.com> > --- > This is on jt/repack-local-promisor. > > - Looking into it further, I think that we also need to require no > - packfile name to be given (so that we are writing the file to the > - repository). Therefore, I've added that requirement both in the code and > - in the documentation. > - > - I've tried to summarize our conversation in the commit message - if you > - notice anything missing or incorrect, feel free to let me know. > + Thanks, Peff, for the catch. Here's an updated patch, with an updated > + commit message. Heh, I guess you stick your notes directly into the commit message. ;) I do that sometimes, too. A long time ago I had a patch that would let you write "---" in the commit message editor and then auto-convert that into actual notes. Probably not that big a deal, though. -Peff
diff --git a/Documentation/git-index-pack.txt b/Documentation/git-index-pack.txt index 4be09e58e7..58dd5b5f0e 100644 --- a/Documentation/git-index-pack.txt +++ b/Documentation/git-index-pack.txt @@ -144,6 +144,8 @@ Also, if there are objects in the given pack that references non-promisor objects (in the repo), repacks those non-promisor objects into a promisor pack. This avoids a situation in which a repo has non-promisor objects that are accessible through promisor objects. ++ +Requires <pack-file> to not be specified. NOTES ----- diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 08b340552f..05758a2f3e 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1970,6 +1970,8 @@ int cmd_index_pack(int argc, usage(index_pack_usage); if (fix_thin_pack && !from_stdin) die(_("the option '%s' requires '%s'"), "--fix-thin", "--stdin"); + if (promisor_msg && pack_name) + die(_("--promisor cannot be used with a pack name")); if (from_stdin && !startup_info->have_repository) die(_("--stdin requires a git repository")); if (from_stdin && hash_algo) diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index aff164ddf8..c53f355e48 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -332,10 +332,8 @@ test_expect_success 'build pack index for an existing pack' ' git index-pack -o tmp.idx test-3.pack && cmp tmp.idx test-1-${packname_1}.idx && - git index-pack --promisor=message test-3.pack && + git index-pack test-3.pack && cmp test-3.idx test-1-${packname_1}.idx && - echo message >expect && - test_cmp expect test-3.promisor && cat test-2-${packname_2}.pack >test-3.pack && git index-pack -o tmp.idx test-2-${packname_2}.pack &&