mbox series

[0/5] refs: remove long-dead code

Message ID cover-0.5-00000000000-20210928T130032Z-avarab@gmail.com (mailing list archive)
Headers show
Series refs: remove long-dead code | expand

Message

Ævar Arnfjörð Bjarmason Sept. 28, 2021, 1:02 p.m. UTC
This removes dead code in the refs backend, mainly in the
ref-cache. By line count this is mostly a straightforward follow-up to
9939b33d6a3 (packed-backend: rip out some now-unused code, 2017-09-08)
and 9dd389f3d8d (packed_ref_store: get rid of the `ref_cache`
entirely, 2017-09-25).

Ævar Arnfjörð Bjarmason (5):
  refs.[ch]: remove unused ref_storage_backend_exists()
  refs/ref-cache.[ch]: remove unused remove_entry_from_dir()
  refs/ref-cache.[ch]: remove unused add_ref_entry()
  refs/ref-cache.c: remove "mkdir" parameter from find_containing_dir()
  refs/ref-cache.[ch]: remove "incomplete" from create_dir_entry()

 refs.c               |  5 ---
 refs.h               |  2 -
 refs/files-backend.c |  6 +--
 refs/ref-cache.c     | 87 ++++++++------------------------------------
 refs/ref-cache.h     | 26 +------------
 5 files changed, 19 insertions(+), 107 deletions(-)

Comments

Jeff King Sept. 28, 2021, 5:58 p.m. UTC | #1
On Tue, Sep 28, 2021 at 03:02:19PM +0200, Ævar Arnfjörð Bjarmason wrote:

> This removes dead code in the refs backend, mainly in the
> ref-cache. By line count this is mostly a straightforward follow-up to
> 9939b33d6a3 (packed-backend: rip out some now-unused code, 2017-09-08)
> and 9dd389f3d8d (packed_ref_store: get rid of the `ref_cache`
> entirely, 2017-09-25).

Thanks, all five look good to me.

Reading through I was surprised the loose backend didn't use
add_ref_entry(), but that's because it uses add_entry_to_dir() more
directly. And that also explains why the "incomplete" parameter in the
final patch was always 1: in the loose world, we are always reading as
incrementally as possible.

So patches 2-4 are really just fallout from switching the packed-refs
reading away from ref-cache. Makes sense.

-Peff
Junio C Hamano Sept. 28, 2021, 10:12 p.m. UTC | #2
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> This removes dead code in the refs backend, mainly in the
> ref-cache. By line count this is mostly a straightforward follow-up to
> 9939b33d6a3 (packed-backend: rip out some now-unused code, 2017-09-08)
> and 9dd389f3d8d (packed_ref_store: get rid of the `ref_cache`
> entirely, 2017-09-25).
>
> Ævar Arnfjörð Bjarmason (5):
>   refs.[ch]: remove unused ref_storage_backend_exists()
>   refs/ref-cache.[ch]: remove unused remove_entry_from_dir()
>   refs/ref-cache.[ch]: remove unused add_ref_entry()
>   refs/ref-cache.c: remove "mkdir" parameter from find_containing_dir()
>   refs/ref-cache.[ch]: remove "incomplete" from create_dir_entry()

Looking good.  Thanks.