Re: [PATCH v2 03/10] refs: add array of ref namespaces
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 3, 2022, 06:16 UTC
- Message-ID
- <xmqqzggldf7y.fsf@gitster.g>
- In-Reply-To
- <d7486390d57849971ee6a4ac27a0a784c41623ee.1659122979.git.gitgitgadget@gmail.com>
"Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 8 quoted lines
> + [NAMESPACE_REPLACE] = {
> + /*
> + * This namespace allows Git to act as if one object ID
> + * points to the content of another. Unlike the other
> + * ref namespaces, this one can be changed by the
> + * GIT_REPLACE_REF_BASE environment variable. This
> + * .namespace value will be overwritten in setup_git_env().
> + */Thanks---it is a shame that we have unnecessary flexibility that requires us to have this code.
Show 8 quoted lines
> + .ref = "refs/replace/",
> + .decoration = DECORATION_GRAFTED,
> + },
> + [NAMESPACE_NOTES] = {
> + /*
> + * The refs/notes/commit ref points to the tip of a
> + * parallel commit history that adds metadata to commits
> + * in the normal history. This branch can be overwrittenThis is not "branch" but is a ref.
Show 5 quoted lines
> + * by the core.notesRef config variable or the > + * GIT_NOTES_REFS environment variable. > + */ > + .ref = "refs/notes/commit", > + .exact = 1,
Allowing just "the default" to be replaced by another "custom default" is a good start, but we probably want to support more than one notes refs, to parallel how "struct display_notes_opt" has extra_notes_refs to allow multiple notes refs to decorate objects.