<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs.c, branch v2.44.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.44.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.44.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-01-30T00:03:00Z</updated>
<entry>
<title>Merge branch 'ps/not-so-many-refs-are-special'</title>
<updated>2024-01-30T00:03:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-01-30T00:03:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8282f9592838acd265491737e4d36636fc64b639'/>
<id>urn:sha1:8282f9592838acd265491737e4d36636fc64b639</id>
<content type='text'>
Define "special ref" as a very narrow set that consists of
FETCH_HEAD and MERGE_HEAD, and clarify everything else that used to
be classified as such are actually just pseudorefs.

* ps/not-so-many-refs-are-special:
  Documentation: add "special refs" to the glossary
  refs: redefine special refs
  refs: convert MERGE_AUTOSTASH to become a normal pseudo-ref
  sequencer: introduce functions to handle autostashes via refs
  refs: convert AUTO_MERGE to become a normal pseudo-ref
  sequencer: delete REBASE_HEAD in correct repo when picking commits
  sequencer: clean up pseudo refs with REF_NO_DEREF
</content>
</entry>
<entry>
<title>Merge branch 'ps/worktree-refdb-initialization'</title>
<updated>2024-01-26T16:54:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-01-26T16:54:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dc8ce995a2ad203ffb5ef335682b64da955e645a'/>
<id>urn:sha1:dc8ce995a2ad203ffb5ef335682b64da955e645a</id>
<content type='text'>
Instead of manually creating refs/ hierarchy on disk upon a
creation of a secondary worktree, which is only usable via the
files backend, use the refs API to populate it.

* ps/worktree-refdb-initialization:
  builtin/worktree: create refdb via ref backend
  worktree: expose interface to look up worktree by name
  builtin/worktree: move setup of commondir file earlier
  refs/files: skip creation of "refs/{heads,tags}" for worktrees
  setup: move creation of "refs/" into the files backend
  refs: prepare `refs_init_db()` for initializing worktree refs
</content>
</entry>
<entry>
<title>refs: redefine special refs</title>
<updated>2024-01-19T19:10:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-01-19T10:40:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2cd33f44282853d77bea9c29d1a4f88d8c3b3e5a'/>
<id>urn:sha1:2cd33f44282853d77bea9c29d1a4f88d8c3b3e5a</id>
<content type='text'>
Now that our list of special refs really only contains refs which have
actually-special semantics, let's redefine what makes a special ref.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: convert MERGE_AUTOSTASH to become a normal pseudo-ref</title>
<updated>2024-01-19T19:10:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-01-19T10:40:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3f921c75913a4ba7b73cb0d8ec05a2cf24d1f4d4'/>
<id>urn:sha1:3f921c75913a4ba7b73cb0d8ec05a2cf24d1f4d4</id>
<content type='text'>
Similar to the preceding conversion of the AUTO_MERGE pseudo-ref, let's
convert the MERGE_AUTOSTASH ref to become a normal pseudo-ref as well.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: convert AUTO_MERGE to become a normal pseudo-ref</title>
<updated>2024-01-19T19:10:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-01-19T10:40:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd7c6ffa9e118cdf18a3752ec456070ed0a22e3b'/>
<id>urn:sha1:fd7c6ffa9e118cdf18a3752ec456070ed0a22e3b</id>
<content type='text'>
In 70c70de616 (refs: complete list of special refs, 2023-12-14) we have
inrtoduced a new `is_special_ref()` function that classifies some refs
as being special. The rule is that special refs are exclusively read and
written via the filesystem directly, whereas normal refs exclucsively go
via the refs API.

The intent of that commit was to record the status quo so that we know
to route reads of such special refs consistently. Eventually, the list
should be reduced to its bare minimum of refs which really are special,
namely FETCH_HEAD and MERGE_HEAD.

Follow up on this promise and convert the AUTO_MERGE ref to become a
normal pseudo-ref by using the refs API to both read and write it
instead of accessing the filesystem directly.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/refstorage-extension'</title>
<updated>2024-01-16T18:11:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-01-16T18:11:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=32c6fc3e3036613d80f1217a833d9f3868717b41'/>
<id>urn:sha1:32c6fc3e3036613d80f1217a833d9f3868717b41</id>
<content type='text'>
Introduce a new extension "refstorage" so that we can mark a
repository that uses a non-default ref backend, like reftable.

* ps/refstorage-extension:
  t9500: write "extensions.refstorage" into config
  builtin/clone: introduce `--ref-format=` value flag
  builtin/init: introduce `--ref-format=` value flag
  builtin/rev-parse: introduce `--show-ref-format` flag
  t: introduce GIT_TEST_DEFAULT_REF_FORMAT envvar
  setup: introduce GIT_DEFAULT_REF_FORMAT envvar
  setup: introduce "extensions.refStorage" extension
  setup: set repository's formats on init
  setup: start tracking ref storage format
  refs: refactor logic to look up storage backends
  worktree: skip reading HEAD when repairing worktrees
  t: introduce DEFAULT_REPO_FORMAT prereq
</content>
</entry>
<entry>
<title>refs: prepare `refs_init_db()` for initializing worktree refs</title>
<updated>2024-01-08T21:17:30Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-01-08T10:05:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e573d61ffe3d1e7ea94673757fb69477c1499bc'/>
<id>urn:sha1:2e573d61ffe3d1e7ea94673757fb69477c1499bc</id>
<content type='text'>
The purpose of `refs_init_db()` is to initialize the on-disk files of a
new ref database. The function is quite inflexible right now though, as
callers can neither specify the `struct ref_store` nor can they pass any
flags.

Refactor the interface to accept both of these. This will be required so
that we can start initializing per-worktree ref databases via the ref
backend instead of open-coding the initialization in "worktree.c".

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/pseudo-refs'</title>
<updated>2024-01-02T21:51:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-01-02T21:51:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dbf668a1b7d814b4fcb57c292934cbbc2d926490'/>
<id>urn:sha1:dbf668a1b7d814b4fcb57c292934cbbc2d926490</id>
<content type='text'>
Assorted changes around pseudoref handling.

* ps/pseudo-refs:
  bisect: consistently write BISECT_EXPECTED_REV via the refdb
  refs: complete list of special refs
  refs: propagate errno when reading special refs fails
  wt-status: read HEAD and ORIG_HEAD via the refdb
</content>
</entry>
<entry>
<title>setup: start tracking ref storage format</title>
<updated>2024-01-02T17:24:47Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2023-12-29T07:26:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=173761e21b2978fe7c0f7af7276e8b14511fed23'/>
<id>urn:sha1:173761e21b2978fe7c0f7af7276e8b14511fed23</id>
<content type='text'>
In order to discern which ref storage format a repository is supposed to
use we need to start setting up and/or discovering the format. This
needs to happen in two separate code paths.

  - The first path is when we create a repository via `init_db()`. When
    we are re-initializing a preexisting repository we need to retain
    the previously used ref storage format -- if the user asked for a
    different format then this indicates an error and we error out.
    Otherwise we either initialize the repository with the format asked
    for by the user or the default format, which currently is the
    "files" backend.

  - The second path is when discovering repositories, where we need to
    read the config of that repository. There is not yet any way to
    configure something other than the "files" backend, so we can just
    blindly set the ref storage format to this backend.

Wire up this logic so that we have the ref storage format always readily
available when needed. As there is only a single backend and because it
is not configurable we cannot yet verify that this tracking works as
expected via tests, but tests will be added in subsequent commits. To
countermand this ommission now though, raise a BUG() in case the ref
storage format is not set up properly in `ref_store_init()`.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: refactor logic to look up storage backends</title>
<updated>2024-01-02T17:24:47Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2023-12-29T07:26:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0fcc285c5eaab904ea9a8ade2696fe61355cf587'/>
<id>urn:sha1:0fcc285c5eaab904ea9a8ade2696fe61355cf587</id>
<content type='text'>
In order to look up ref storage backends, we're currently using a linked
list of backends, where each backend is expected to set up its `next`
pointer to the next ref storage backend. This is kind of a weird setup
as backends need to be aware of other backends without much of a reason.

Refactor the code so that the array of backends is centrally defined in
"refs.c", where each backend is now identified by an integer constant.
Expose functions to translate from those integer constants to the name
and vice versa, which will be required by subsequent patches.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
