git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org,  peff@peff.net,  stolee@gmail.com
Subject: Re: [PATCH] index-pack: teach --promisor to require --stdin
Date: Tue, 19 Nov 2024 12:29:33 +0900	[thread overview]
Message-ID: <xmqq1pz7gaua.fsf@gitster.g> (raw)
In-Reply-To: <20241118190210.772105-1-jonathantanmy@google.com> (Jonathan Tan's message of "Mon, 18 Nov 2024 11:02:06 -0800")

Jonathan Tan <jonathantanmy@google.com> writes:

> Currently,
>
>  - Running "index-pack --promisor" outside a repo segfaults.
>  - It may be confusing to a user that running "index-pack --promisor"
>    within a repo may make changes to the repo's object DB, especially
>    since the packs indexed by the index-pack invocation may not even be
>    related to the repo.
>
> As discussed in [1], teaching --promisor to require --stdin and forbid a
> packfile name solves both these problems. This combination of arguments
> requires a repo (since we are writing the resulting .pack and .idx to
> it) and it is clear that the files are related to the repo.

Makes sense.

> This change requires the change to t5300 by 1f52cdfacb (index-pack:
> document and test the --promisor option, 2022-03-09) to be undone.
> (--promisor is already tested indirectly, so we don't need the explicit
> test here any more.)

OK.

> This is on jt/repack-local-promisor.
> diff --git a/Documentation/git-index-pack.txt b/Documentation/git-index-pack.txt
> index 4be09e58e7..ac96935d73 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 --stdin, and requires <pack-file> to not be specified.
>  
>  NOTES
>  -----
> diff --git a/builtin/index-pack.c b/builtin/index-pack.c
> index 08b340552f..c46b6e4061 100644
> --- a/builtin/index-pack.c
> +++ b/builtin/index-pack.c
> @@ -1970,6 +1970,10 @@ 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 && !from_stdin)
> +		die(_("the option '%s' requires '%s'"), "--promisor", "--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"));

OK.  Thanks, will queue.

  reply	other threads:[~2024-11-19  3:29 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 18:08 [PATCH 0/5] When fetching from a promisor remote, repack local objects referenced Jonathan Tan
2024-10-24 18:08 ` [PATCH 1/5] pack-objects: make variable non-static Jonathan Tan
2024-10-28  0:30   ` Taylor Blau
2024-10-28 19:34     ` Jonathan Tan
2024-10-28 19:50       ` Taylor Blau
2024-10-28 23:04         ` Jonathan Tan
2024-10-24 18:08 ` [PATCH 2/5] t0410: make test description clearer Jonathan Tan
2024-10-24 18:08 ` [PATCH 3/5] t0410: use from-scratch server Jonathan Tan
2024-10-24 18:08 ` [PATCH 4/5] t5300: move --window clamp test next to unclamped Jonathan Tan
2024-10-24 18:08 ` [PATCH 5/5] index-pack: repack local links into promisor packs Jonathan Tan
2024-10-30 22:29   ` Josh Steadmon
2024-11-01 20:14     ` Jonathan Tan
2024-10-25  6:04 ` [External] [PATCH 0/5] When fetching from a promisor remote, repack local objects referenced Han Young
2024-10-25 21:07   ` Taylor Blau
2024-11-02 10:38     ` Junio C Hamano
2024-10-25 21:07 ` Taylor Blau
2024-11-01 20:11 ` [PATCH v2 0/4] " Jonathan Tan
2024-11-01 20:11   ` [PATCH v2 1/4] t0410: make test description clearer Jonathan Tan
2024-11-01 20:11   ` [PATCH v2 2/4] t0410: use from-scratch server Jonathan Tan
2024-11-01 20:11   ` [PATCH v2 3/4] t5300: move --window clamp test next to unclamped Jonathan Tan
2024-11-13  7:35     ` Jeff King
2024-11-13 18:26       ` Jonathan Tan
2024-11-14  0:56         ` Jeff King
2024-11-14  6:41           ` Junio C Hamano
2024-11-15  9:52             ` Jeff King
2024-11-15 19:55           ` Jonathan Tan
2024-11-16  3:23             ` Jeff King
2024-11-18 19:02               ` [PATCH] index-pack: teach --promisor to require --stdin Jonathan Tan
2024-11-19  3:29                 ` Junio C Hamano [this message]
2024-11-19 18:53                 ` Jeff King
2024-11-20  1:34                   ` Junio C Hamano
2024-11-19 20:10               ` [PATCH v2] index-pack: teach --promisor to forbid pack name Jonathan Tan
2024-11-20  6:29                 ` Jeff King
2024-11-14  0:59       ` [PATCH v2 3/4] t5300: move --window clamp test next to unclamped Jeff King
2024-11-01 20:11   ` [PATCH v2 4/4] index-pack: repack local links into promisor packs Jonathan Tan
2024-11-04  0:22   ` [PATCH v2 0/4] When fetching from a promisor remote, repack local objects referenced Junio C Hamano
2024-11-04  2:05     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1pz7gaua.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@google.com \
    --cc=peff@peff.net \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).