From: vk <g@vkabc.me>
To: git@vger.kernel.org
Cc: ps@pks.im
Subject: Re: [GSoC] [PATCH] builtin/gc: Replace run_command with C function refs_pack_refs
Date: Thu, 28 Mar 2024 12:12:06 +0800 [thread overview]
Message-ID: <0a149be978e68271c251e80f8eb571f4@vkabc.me> (raw)
In-Reply-To: <20240328040010.40230-1-g@vkabc.me>
On 2024-03-28 12:00, vk wrote:
> Replace "git pack-refs" with C function refs_pack_refs
> for maintenance_task_pack_refs(). C function refs_pack_refs
> can be called directly, hence saving an external process.
> ---
> builtin/gc.c | 29 +++++++++++++++++++++++------
> 1 file changed, 23 insertions(+), 6 deletions(-)
>
> diff --git a/builtin/gc.c b/builtin/gc.c
> index 3c874b248b..b55c5f5225 100644
> --- a/builtin/gc.c
> +++ b/builtin/gc.c
> @@ -42,6 +42,8 @@
> #include "setup.h"
> #include "trace2.h"
>
> +#include <revision.h>
> +
> #define FAILED_RUN "failed to run %s"
>
> static const char * const builtin_gc_usage[] = {
> @@ -218,14 +220,29 @@ static int pack_refs_condition(void)
>
> static int maintenance_task_pack_refs(MAYBE_UNUSED struct
> maintenance_run_opts *opts)
> {
> - struct child_process cmd = CHILD_PROCESS_INIT;
>
> - cmd.git_cmd = 1;
> - strvec_pushl(&cmd.args, "pack-refs", "--all", "--prune", NULL);
> - if (opts->auto_flag)
> - strvec_push(&cmd.args, "--auto");
I forgot to add this --auto optional logic. Will add it in the following
patch.
Thanks
next prev parent reply other threads:[~2024-03-28 4:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 4:00 [GSoC] [PATCH] builtin/gc: Replace run_command with C function refs_pack_refs vk
2024-03-28 4:12 ` vk [this message]
2024-03-28 4:31 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0a149be978e68271c251e80f8eb571f4@vkabc.me \
--to=g@vkabc.me \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).