All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "John Cai via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "René Scharfe" <l.s.r@web.de>,
	"John Cai" <johncai86@gmail.com>
Subject: Re: [PATCH v3] builtin/reflog.c: use parse-options api for expire, delete subcommands
Date: Tue, 04 Jan 2022 14:04:41 -0800	[thread overview]
Message-ID: <xmqq8rvvb1ja.fsf@gitster.g> (raw)
In-Reply-To: <pull.1175.v3.git.git.1641318061821.gitgitgadget@gmail.com> (John Cai via GitGitGadget's message of "Tue, 04 Jan 2022 17:41:01 +0000")

"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: John Cai <johncai86@gmail.com>
>
> Switching out manual arg parsing for the parse-options API for the
> expire and delete subcommands.
>
> Move explicit_expiry flag into cmd_reflog_expire_cb struct so callbacks
> can set both the value of the timestamp as well as the explicit_expiry
> flag.
>
> Signed-off-by: "John Cai" <johncai86@gmail.com>

Makes sense.

> -/* NEEDSWORK: switch to using parse_options */
> -static const char reflog_expire_usage[] =
> -N_("git reflog expire [--expire=<time>] "
> -   "[--expire-unreachable=<time>] "
> -   "[--rewrite] [--updateref] [--stale-fix] [--dry-run | -n] "
> -   "[--verbose] [--all] <refs>...");

...

> +static const char * reflog_expire_usage[] = {
> +	N_("git reflog expire [--expire=<time>] "
> +   "[--expire-unreachable=<time>] "
> +   "[--rewrite] [--updateref] [--stale-fix] [--dry-run | -n] "
> +   "[--verbose] [--all] <refs>..."),

Funny indentation?  Let's align the opening double-quote of all the
other lines to that of the first line on a fixed-column terminal,
like was done in the original.

>  static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
>  {
>  	struct cmd_reflog_expire_cb cmd = { 0 };
>  	timestamp_t now = time(NULL);
>  	int i, status, do_all, all_worktrees = 1;
> -	int explicit_expiry = 0;
>  	unsigned int flags = 0;
>  	int verbose = 0;
>  	reflog_expiry_should_prune_fn *should_prune_fn = should_expire_reflog_ent;
> +	const struct option options[] = {

This does not seem to apply.  Please leave a note on how the 'base'
was chosen when sending a patch that requires something not yet in
'master'.

I've based the topic for this patch by prepar ng a merge of
'ab/reflog-prep' into 'master', at least for now.

Other than that, looks nicely done.  The new approach seems much
simpler and sensible than the previous round.

Thanks.

  reply	other threads:[~2022-01-04 22:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-31  6:29 [PATCH 0/2] reflog.c: switch to use parse-options API John Cai via GitGitGadget
2021-12-31  6:29 ` [PATCH 1/2] builtin/reflog.c: use parse-options for expire subcommand John Cai via GitGitGadget
2022-01-01  2:06   ` John Cai
2022-01-01 11:16     ` René Scharfe
2022-01-01 19:09       ` John Cai
2022-01-02  9:00         ` René Scharfe
2021-12-31  6:29 ` [PATCH 2/2] builtin/reflog.c: switch to use parse-options API for delete subcommand John Cai via GitGitGadget
2022-01-03 15:20 ` [PATCH v2 0/2] reflog.c: switch to use parse-options API John Cai via GitGitGadget
2022-01-03 15:20   ` [PATCH v2 1/2] parse-options.h: add parse_opt_expiry_date helper John Cai via GitGitGadget
2022-01-04  2:26     ` Junio C Hamano
2022-01-03 15:20   ` [PATCH v2 2/2] builtin/reflog.c: switch to use parse-options API for delete subcommand John Cai via GitGitGadget
2022-01-04  2:36     ` Junio C Hamano
2022-01-04 17:41   ` [PATCH v3] builtin/reflog.c: use parse-options api for expire, delete subcommands John Cai via GitGitGadget
2022-01-04 22:04     ` Junio C Hamano [this message]
2022-01-05  4:06     ` [PATCH v4] " John Cai via GitGitGadget
2022-01-05 20:34       ` Junio C Hamano
2022-01-06 19:06       ` [PATCH v5] " John Cai via GitGitGadget
2022-01-06 21:09         ` Junio C Hamano
2022-01-06 21:32           ` John Cai

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=xmqq8rvvb1ja.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=johncai86@gmail.com \
    --cc=l.s.r@web.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.