On Fri, Feb 18 2022, John Cai via GitGitGadget wrote: > In [1], there was a discussion around a bug report of stash not recovering > in the middle of the process. It turned out to not be a bug we need to fix. > However, out of that discussion came the idea of libifying reflog. This can > stand alone as a code improvement. > > stash.c currently shells out to call reflog to delete reflogs. Libify reflog > delete and call it from both builtin/reflog.c and builtin/stash.c. > > This patch has three parts: > > * libify reflog's delete functionality and move some of the helpers into a > reflog.c library and export them > * call reflog_delete from builtin/reflog.c > * call reflog_delete from builtin/stash.c > > 1. https://lore.kernel.org/git/220126.86h79qe692.gmgdl@xxxxxxxxxxxxxxxxxxx/ I just reviewed this in detail, it's very nice to see this done & another shell-out in our code API-ified. There's at least one bad bug here (but easily fixed), and some nits etc. that I suggested mainly to make the diff easier to look at locally, but aside from those minor adjustments this looks very good to me.