Re: [PATCH 8/9] repack: implement `--filter-to` for storing filtered out objects
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jun 21, 2023, 11:49 UTC
- Message-ID
- <ZJLjvhnh0lSRCVzG@nand.local>
- In-Reply-To
- <20230614192541.1599256-9-christian.couder@gmail.com>
On Wed, Jun 14, 2023 at 09:25:40PM +0200, Christian Couder wrote:
Show 13 quoted lines
> diff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt > index aa29c7e648..070dd22610 100644 > --- a/Documentation/git-repack.txt > +++ b/Documentation/git-repack.txt > @@ -148,6 +148,12 @@ depth is 4095. > resulting packfile and put them into a separate packfile. See > linkgit:git-rev-list[1] for valid `<filter-spec>` forms. > > +--filter-to=<dir>:: > + Write the pack containing filtered out objects to the > + directory `<dir>`. This can be used for putting the pack on a > + separate object directory that is accessed through the Git > + alternates mechanism. Only useful with `--filter`.
Here you say "only useful with --filter", but...
Show 11 quoted lines
> @@ -1073,8 +1077,11 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
> strvec_push(&cmd.args, "--incremental");
> }
>
> - if (po_args.filter)
> - prepare_pack_filtered_cmd(&pack_filtered_cmd, &po_args, packtmp);
> + if (po_args.filter) {
> + if (!filter_to)
> + filter_to = packtmp;
> + prepare_pack_filtered_cmd(&pack_filtered_cmd, &po_args, filter_to);
> + }Would you want an "} else if (filter_to)" here to die and show the usage message, since --filter-to needs --filter? Or maybe it should imply --filter-to.
Thanks, Taylor