Subject: Re: [PATCH v2 2/3] reflog: libify delete reflog function and helpers

From: Junio C Hamano <[email-masked]>
Date: Wed, 23 Feb 2022 13:28:34 -0800

"John Cai via GitGitGadget" <[email-masked]> writes:

> From: John Cai <[email-masked]>
>
> Currently stash shells out to reflog in order to delete refs. In an
> effort to reduce how much we shell out to a subprocess, libify the
> functionality that stash needs into reflog.c.
>
> Add a reflog_delete function that is pretty much the logic in the while
> loop in builtin/reflog.c cmd_reflog_delete(). This is a function that
> builtin/reflog.c and builtin/stash.c can both call.
>
> Also move functions needed by reflog_delete and export them.
>
> Helped-by: Ævar Arnfjörð Bjarmason <[email-masked]>
> Signed-off-by: John Cai <[email-masked]>
> ---
>  Makefile         |   1 +
>  builtin/reflog.c | 451 +----------------------------------------------
>  object.h         |   2 +-
>  reflog.c         | 435 +++++++++++++++++++++++++++++++++++++++++++++
>  reflog.h         |  49 +++++
>  5 files changed, 490 insertions(+), 448 deletions(-)
>  create mode 100644 reflog.c
>  create mode 100644 reflog.h

This round, without polluting global namespace in reflog.h by moving
too many things there and instead keeping what is private to the
implementation in reflog.c, looks much better than the previous
round.

Looking good.

Thanks.