# [QUESTION] How does Git ref backend work

2 messages from 2023-04-12 to 2023-04-12. Participants: ZheNing Hu.
Thread: https://gitlist.dev/t/59581

## ZheNing Hu, 2023-04-12 06:25

Subject: [QUESTION] How does Git ref backend work
Message-ID: <CAOLTT8Tg_Gkj6jid-sH_A=-xajN=rd=Vgh-nqHY5NcJ4-VExbg@mail.gmail.com>
URL: https://gitlist.dev/e/CAOLTT8Tg_Gkj6jid-sH_A%3D-xajN%3Drd%3DVgh-nqHY5NcJ4-VExbg%40mail.gmail.com

```
1. I noticed that normally refs transactions use the refs files-backend,
looking at the reference transaction of refs files-backend alone:
First, it opens a transaction in memory, then multiple update items
are added in memory, and finally, when the reference transaction
is committed, it creates a ref.lock for each update item, renames it
to the real address of the ref.

but there seems to be some packed-backend logic coupled inside of
files-backend. This makes me wonder why these ref backends are not
independent?

2. Is the reftable backend in a usable state? How can I enable it?
I couldn't find any clues on https://www.git-scm.com/docs/reftable.
3. Will future git refs backend possibly support external storage media
e.g. Redis?

Thanks,
--
ZheNing Hu

```

## ZheNing Hu, 2023-04-12 06:48

Subject: Re: [QUESTION] How does Git ref backend work
Message-ID: <CAOLTT8RAhCY_Xo_jDopggCVEF8t5Kghji4h+Td6Gja_3kMSpJQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAOLTT8RAhCY_Xo_jDopggCVEF8t5Kghji4h%2BTd6Gja_3kMSpJQ%40mail.gmail.com
In-Reply-To: <CAOLTT8Tg_Gkj6jid-sH_A=-xajN=rd=Vgh-nqHY5NcJ4-VExbg@mail.gmail.com>

```
ZheNing Hu <adlternative@gmail.com> 于2023年4月12日周三 14:25写道：
>
> 1. I noticed that normally refs transactions use the refs files-backend,
> looking at the reference transaction of refs files-backend alone:
> First, it opens a transaction in memory, then multiple update items
> are added in memory, and finally, when the reference transaction
> is committed, it creates a ref.lock for each update item, renames it
> to the real address of the ref.
>
> but there seems to be some packed-backend logic coupled inside of
> files-backend. This makes me wonder why these ref backends are not
> independent?
>
> 2. Is the reftable backend in a usable state? How can I enable it?
> I couldn't find any clues on https://www.git-scm.com/docs/reftable.
> 3. Will future git refs backend possibly support external storage media
> e.g. Redis?
>

I just found a similar discussion on the mailing list:
https://lore.kernel.org/git/CAJoAoZn7Nt37Eh17dpLDK+YX2BaEaAaii2rJPXO3L0BmQQkcgQ@mail.gmail.com/

> Thanks,
> --
> ZheNing Hu

```
