git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/9] reftable prep: have builtin/reflog.c handle "--verbose"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Dec 16, 2021, 13:45 UTC
Message-ID
<cover-v2-0.9-00000000000-20211216T134028Z-avarab@gmail.com>
In-Reply-To
<cover-00.12-00000000000-20211130T213319Z-avarab@gmail.com>

This series refactors various small bits of builtin/reflog.c (e.g. using a "struct string_list" now), and finally makes it handle the "--verbose" output, instead of telling the files backend to emit that same verbose output.

This means that when we start to integrate "reftable" the new backend won't need to implement verbose reflog output, it will just work.

This is a sort-of v2[1]. I ejected the changes at the end to add better --progress output to "git reflog". Those fixes are worthwhile, but hopefully this smaller & easier to review series can be queued up first, we can do those UX improvements later.

1. https://lore.kernel.org/git/cover-00.12-00000000000-20211130T213319Z-avarab@gmail.com/
Ævar Arnfjörð Bjarmason (9):
  reflog delete: narrow scope of "cmd" passed to count_reflog_ent()
  reflog expire: narrow scope of "cb" in cmd_reflog_expire()
  reflog: change one->many worktree->refnames to use a string_list
  reflog expire: don't do negative comparison on enum values
  reflog expire: refactor & use "tip_commit" only for UE_NORMAL
  reflog expire: don't use lookup_commit_reference_gently()
  reflog: reduce scope of "struct rev_info"
  refs files-backend: assume cb->newlog if !EXPIRE_REFLOGS_DRY_RUN
  reflog + refs-backend: move "verbose" out of the backend
 builtin/reflog.c     | 208 +++++++++++++++++++++++--------------------
 refs.h               |   3 +-
 refs/files-backend.c |  44 +++++----
 3 files changed, 134 insertions(+), 121 deletions(-)
Range-diff against v1:
 1:  99e8a639163 =  1:  22c8119640c reflog delete: narrow scope of "cmd" passed to count_reflog_ent()
 2:  c424b26b4fe =  2:  b8e84538427 reflog expire: narrow scope of "cb" in cmd_reflog_expire()
 3:  5a54b04a13e =  3:  c0e190e46cf reflog: change one->many worktree->refnames to use a string_list
 4:  a7a2dfd1406 =  4:  e42fac1b518 reflog expire: don't do negative comparison on enum values
 5:  de162a476c1 =  5:  39263cd00ae reflog expire: refactor & use "tip_commit" only for UE_NORMAL
 6:  eb3dd3fa8b9 =  6:  c71aab5845e reflog expire: don't use lookup_commit_reference_gently()
 7:  3aab4a4a436 =  7:  2fb33ef2546 reflog: reduce scope of "struct rev_info"
 8:  adbec242a7a =  8:  f9fe6a2cfb0 refs files-backend: assume cb->newlog if !EXPIRE_REFLOGS_DRY_RUN
 9:  6a8f3915898 =  9:  28aa0aa6e30 reflog + refs-backend: move "verbose" out of the backend
10:  f54dee1f1cc <  -:  ----------- reflog expire: add progress output on --stale-fix
11:  794e6e677a8 <  -:  ----------- gc + reflog: emit progress output from "reflog expire --all"
12:  fc2b15d0abe <  -:  ----------- gc + reflog: don't stall before initial "git gc" progress output
-- 
2.34.1.1020.gc80c40b6642
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 14 of 37 in “reflog + gc: refactor, progress output, reftable-readyness”
  1. 00/12 reflog + gc: refactor, progress output, reftable-readynessÆvar Arnfjörð Bjarmason, Nov 30, 2021
  2. 01/12 reflog delete: narrow scope of "cmd" passed to count_reflog_ent()Ævar Arnfjörð Bjarmason, Nov 30, 2021
  3. 02/12 reflog expire: narrow scope of "cb" in cmd_reflog_expire()Ævar Arnfjörð Bjarmason, Nov 30, 2021
  4. 03/12 reflog: change one->many worktree->refnames to use a string_listÆvar Arnfjörð Bjarmason, Nov 30, 2021
  5. 04/12 reflog expire: don't do negative comparison on enum valuesÆvar Arnfjörð Bjarmason, Nov 30, 2021
  6. 05/12 reflog expire: refactor & use "tip_commit" only for UE_NORMALÆvar Arnfjörð Bjarmason, Nov 30, 2021
  7. 06/12 reflog expire: don't use lookup_commit_reference_gently()Ævar Arnfjörð Bjarmason, Nov 30, 2021
  8. 07/12 reflog: reduce scope of "struct rev_info"Ævar Arnfjörð Bjarmason, Nov 30, 2021
  9. 09/12 reflog + refs-backend: move "verbose" out of the backendÆvar Arnfjörð Bjarmason, Nov 30, 2021
  10. 11/12 gc + reflog: emit progress output from "reflog expire --all"Ævar Arnfjörð Bjarmason, Nov 30, 2021
  11. 10/12 reflog expire: add progress output on --stale-fixÆvar Arnfjörð Bjarmason, Nov 30, 2021
  12. 08/12 refs files-backend: assume cb->newlog if !EXPIRE_REFLOGS_DRY_RUNÆvar Arnfjörð Bjarmason, Nov 30, 2021
  13. 12/12 gc + reflog: don't stall before initial "git gc" progress outputÆvar Arnfjörð Bjarmason, Nov 30, 2021
  14. 0/9 reftable prep: have builtin/reflog.c handle "--verbose"Ævar Arnfjörð Bjarmason, Dec 16, 2021
  15. 1/9 reflog delete: narrow scope of "cmd" passed to count_reflog_ent()Ævar Arnfjörð Bjarmason, Dec 16, 2021
  16. 2/9 reflog expire: narrow scope of "cb" in cmd_reflog_expire()Ævar Arnfjörð Bjarmason, Dec 16, 2021
  17. 3/9 reflog: change one->many worktree->refnames to use a string_listÆvar Arnfjörð Bjarmason, Dec 16, 2021
  18. 4/9 reflog expire: don't do negative comparison on enum valuesÆvar Arnfjörð Bjarmason, Dec 16, 2021
  19. 5/9 reflog expire: refactor & use "tip_commit" only for UE_NORMALÆvar Arnfjörð Bjarmason, Dec 16, 2021
  20. 7/9 reflog: reduce scope of "struct rev_info"Ævar Arnfjörð Bjarmason, Dec 16, 2021
  21. 6/9 reflog expire: don't use lookup_commit_reference_gently()Ævar Arnfjörð Bjarmason, Dec 16, 2021
  22. 8/9 refs files-backend: assume cb->newlog if !EXPIRE_REFLOGS_DRY_RUNÆvar Arnfjörð Bjarmason, Dec 16, 2021
  23. 9/9 reflog + refs-backend: move "verbose" out of the backendÆvar Arnfjörð Bjarmason, Dec 16, 2021
  24. Junio C HamanoDec 16, 2021
  25. Ævar Arnfjörð BjarmasonDec 16, 2021
  26. Han-Wen NienhuysDec 21, 2021
  27. Ævar Arnfjörð BjarmasonDec 21, 2021
  28. 0/9 reftable prep: have builtin/reflog.c handle "--verbose"Ævar Arnfjörð Bjarmason, Dec 22, 2021
  29. 1/9 reflog delete: narrow scope of "cmd" passed to count_reflog_ent()Ævar Arnfjörð Bjarmason, Dec 22, 2021
  30. 2/9 reflog expire: narrow scope of "cb" in cmd_reflog_expire()Ævar Arnfjörð Bjarmason, Dec 22, 2021
  31. 4/9 reflog expire: use "switch" over enum valuesÆvar Arnfjörð Bjarmason, Dec 22, 2021
  32. 3/9 reflog: change one->many worktree->refnames to use a string_listÆvar Arnfjörð Bjarmason, Dec 22, 2021
  33. 7/9 reflog: reduce scope of "struct rev_info"Ævar Arnfjörð Bjarmason, Dec 22, 2021
  34. 6/9 reflog expire: don't use lookup_commit_reference_gently()Ævar Arnfjörð Bjarmason, Dec 22, 2021
  35. 5/9 reflog expire: refactor & use "tip_commit" only for UE_NORMALÆvar Arnfjörð Bjarmason, Dec 22, 2021
  36. 8/9 refs files-backend: assume cb->newlog if !EXPIRE_REFLOGS_DRY_RUNÆvar Arnfjörð Bjarmason, Dec 22, 2021
  37. 9/9 reflog + refs-backend: move "verbose" out of the backendÆvar Arnfjörð Bjarmason, Dec 22, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.