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

Re: [PATCH 0/5] make room for "special ref"

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 16, 2023, 00:44 UTC
Message-ID
<xmqq7clfj7r4.fsf@gitster.g>
In-Reply-To
<321b8084-fddb-4b5d-86af-7f88cb3edf7b@ramsayjones.plus.com>
Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
> Yes, I was going to suggest exactly this, after Patrick pointed out
> that there were only two 'special psuedo-refs' (I had a vague feeling
> there were some more than that) FETCH_HEAD and MERGE_HEAD.

Glad to see that I am not alone. We should be able to treat MERGE_HEAD similarly. It is used to communicate the list of "other parents" from "git merge" that stops in the middle (either for merge conflict, or in response to the "--no-commit" command line option) to "git commit" that concludes such an unfinished merge. Many commands merely use the presence of MERGE_HEAD as a sign that a merge is in progress (e.g. "git status"), which would not break if we just started to record the first parent in a pseudoref MERGE_HEAD and wrote the other octopus parents elsewhere, but some commands do need all these parents from MERGE_HEAD (e.g. "git blame" that synthesizes a fake starting commit out of the working tree state).

If we cannot get rid of all "special refs" anyway, however, I think there is little that we can gain from doing such "make FETCH_HEAD and MERGE_HEAD into a single-object pseudoref, and write other info in separate files" exercise. We can treat the current FETCH_HEAD and MERGE_HEAD as "file that is not and is more than a ref", which is what the current code is doing anyway, which means we would declare that they have to stay to be files under $GIT_DIR/ and will be accessed via the filesystem access. At that point, calling them "special ref" might even be more misleading than its worth and we may be better off to admit that they are not even refs but a datafile some commands can use to obtain input from, but the phrase we use to refer to them, be it "special ref" or some random datafile, does not make a fundamental change on anything.

Previous: Ramsay JonesNext: Patrick Steinhardt
Message 21 of 26 in “make room for "special ref"”
  1. 0/5 make room for "special ref"Junio C Hamano, Dec 15, 2023
  2. 2/5 git-bisect.txt: BISECT_HEAD is not that specialJunio C Hamano, Dec 15, 2023
  3. 1/5 git.txt: HEAD is not that specialJunio C Hamano, Dec 15, 2023
  4. Ramsay JonesDec 15, 2023
  5. Junio C HamanoDec 15, 2023
  6. Junio C HamanoDec 15, 2023
  7. doc: format.notes specify a ref under refs/notes/ hierarchyJunio C Hamano, Dec 15, 2023
  8. Patrick SteinhardtDec 18, 2023
  9. Junio C HamanoDec 18, 2023
  10. Jiang XinDec 19, 2023
  11. Ramsay JonesDec 15, 2023
  12. Patrick SteinhardtDec 18, 2023
  13. Junio C HamanoDec 18, 2023
  14. 3/5 refs.h: HEAD is not that specialJunio C Hamano, Dec 15, 2023
  15. Andy KoppeDec 16, 2023
  16. 4/5 docs: AUTO_MERGE is not that specialJunio C Hamano, Dec 15, 2023
  17. 5/5 docs: MERGE_AUTOSTASH is not that specialJunio C Hamano, Dec 15, 2023
  18. Andy KoppeDec 16, 2023
  19. Junio C HamanoDec 15, 2023
  20. Ramsay JonesDec 15, 2023
  21. Junio C HamanoDec 16, 2023
  22. Patrick SteinhardtDec 18, 2023
  23. Andy KoppeDec 16, 2023
  24. Patrick SteinhardtDec 18, 2023
  25. Andy KoppeDec 16, 2023
  26. Patrick SteinhardtDec 18, 2023

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.