Thread (1 message) 1 message, 1 author, 2022-02-23

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

From: Junio C Hamano <hidden>
Date: 2022-02-23 21:28:41

"John Cai via GitGitGadget" [off-list ref] writes:
From: John Cai <redacted>

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 [off-list ref]
Signed-off-by: John Cai <redacted>
---
 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help