pr-git-1218/john-cai/jc-libify-reflog-v3
tagged this
25 Feb 19:30
In [1], there was a discussion around a bug report of stash not recovering in the middle of the process when killed with ctl-c. 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: * add missing test coverage for git stash delete * libify reflog's delete functionality and move some of the helpers into a reflog.c library and call reflog_delete from builtin/reflog.c * call reflog_delete from builtin/stash.c Updates since v2: * removed unnecessary includes * adjusted wrapping/whitespace in reflog.h * adjusted test to be isolated from other tests since currently tests for stash depend on each other. There was some discussion around this and even a possibility to refactor the tests. However, it would have been a larger effort than is worth for this series, so instead I just made one of the tests I added be isolated from the others. Updates since v1: * added missing test coverage * squashed 1/3 and 2/3 together * moved enum into reflog.c * updated object.h's flag allocation mapping 1. https://lore.kernel.org/git/220126.86h79qe692.gmgdl@evledraar.gmail.com/ John Cai (3): stash: add tests to ensure reflog --rewrite --updatref behavior reflog: libify delete reflog function and helpers stash: call reflog_delete() in reflog.c Makefile | 1 + builtin/reflog.c | 455 +---------------------------------------------- builtin/stash.c | 18 +- object.h | 2 +- reflog.c | 432 ++++++++++++++++++++++++++++++++++++++++++++ reflog.h | 43 +++++ t/t3903-stash.sh | 65 +++++-- 7 files changed, 539 insertions(+), 477 deletions(-) create mode 100644 reflog.c create mode 100644 reflog.h base-commit: e6ebfd0e8cbbd10878070c8a356b5ad1b3ca464e Submitted-As: https://lore.kernel.org/git/pull.1218.v3.git.git.1645817452.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.1218.git.git.1645209647.gitgitgadget@gmail.com In-Reply-To: https://lore.kernel.org/git/pull.1218.v2.git.git.1645554651.gitgitgadget@gmail.com
Assets 2
-
2022-02-25T19:30:52Z -
2022-02-25T19:30:52Z -