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

Re: [PATCH v3 0/3] Remove special casing for PSEUDOREF updates

From
Han-Wen Nienhuys <hanwen@google.com>
Date
Aug 3, 2020, 19:07 UTC
Message-ID
<CAFQ2z_O1sRm-_SNP=-GvgNLqB+qgf6k9YVfbF1XCAmFWdeX6Ew@mail.gmail.com>
In-Reply-To
<xmqqpn8hgca7.fsf@gitster.c.googlers.com>
On Mon, Jul 27, 2020 at 6:20 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> > On Fri, Jul 17, 2020 at 12:10 AM Junio C Hamano <gitster@pobox.com> wrote:
> >> I reviewed some codepaths that deal with FETCH_HEAD recently.
> >>
> >> As the file is quite different from all the other pseudo references
> >> in that it needs to store more than one object name and in that each
> >> ref in it needs more than just the object name, I doubt that it
> >> makes much sense to enhance the refs API so that its requirements
> >> can be covered.
> >
> > I agree. Do we ever pretend that FETCH_HEAD is a ref today?
>
> "git rev-parse FETCH_HEAD", "git show FETCH_HEAD" etc. all should keep
> working, so in that sense, it is treated as a ref.

I added this to the last version of the full reftable patch series that I posted, as patches "Split off reading loose ref data in separate function" and "Read FETCH_HEAD as loose ref".

Which other refs that aren't really refs should also be supported? The JGit source code suggests that MERGE_HEAD should also be special cased?

It's not pretty, though. The entry point is read_raw_ref(), which gets a ref_store as argument. ref_store doesn't have generic API to get at the repository directory, so the implementation of reading the FETCH_HEAD file has to be pushed down to the ref backend (which does know the directory).

> It does not
> protect the history leading to the objects listed in it from being
> collected, though.
Is there documented agreement of how pseudo refs and GC should interact?
Show 7 quoted lines
> "git merge FETCH_HEAD" is an interesting case---I haven't thought it
> through.
>
> What should happen after "git pull origin foo bar" attempts to grab
> two branches and make an octopus merge into the branch currently
> checked out, and then "git reset --hard && git merge FETCH_HEAD" is
> given?
I don't understand this question.
-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--
Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Previous: Junio C HamanoNext: Junio C Hamano
Message 25 of 39 in “Remove special casing for PSEUDOREF updates”
  1. 0/2 Remove special casing for PSEUDOREF updatesHan-Wen Nienhuys via GitGitGadget, Jul 6, 2020
  2. 1/2 Modify pseudo refs through ref backend storageHan-Wen Nienhuys via GitGitGadget, Jul 6, 2020
  3. Junio C HamanoJul 6, 2020
  4. Han-Wen NienhuysJul 7, 2020
  5. Junio C HamanoJul 7, 2020
  6. Han-Wen NienhuysJul 7, 2020
  7. Junio C HamanoJul 7, 2020
  8. 2/2 Make HEAD a PSEUDOREF rather than PER_WORKTREE.Han-Wen Nienhuys via GitGitGadget, Jul 6, 2020
  9. Junio C HamanoJul 6, 2020
  10. Han-Wen NienhuysJul 7, 2020
  11. 0/3 Remove special casing for PSEUDOREF updatesHan-Wen Nienhuys via GitGitGadget, Jul 9, 2020
  12. 2/3 Modify pseudo refs through ref backend storageHan-Wen Nienhuys via GitGitGadget, Jul 9, 2020
  13. 3/3 Make HEAD a PSEUDOREF rather than PER_WORKTREE.Han-Wen Nienhuys via GitGitGadget, Jul 9, 2020
  14. 1/3 t1400: use git rev-parse for testing PSEUDOREF existenceHan-Wen Nienhuys via GitGitGadget, Jul 9, 2020
  15. Junio C HamanoJul 10, 2020
  16. 0/3 Remove special casing for PSEUDOREF updatesHan-Wen Nienhuys via GitGitGadget, Jul 16, 2020
  17. 1/3 t1400: use git rev-parse for testing PSEUDOREF existenceHan-Wen Nienhuys via GitGitGadget, Jul 16, 2020
  18. 3/3 Make HEAD a PSEUDOREF rather than PER_WORKTREE.Han-Wen Nienhuys via GitGitGadget, Jul 16, 2020
  19. 2/3 Modify pseudo refs through ref backend storageHan-Wen Nienhuys via GitGitGadget, Jul 16, 2020
  20. Johannes SchindelinJul 17, 2020
  21. Han-Wen NienhuysJul 27, 2020
  22. Junio C HamanoJul 16, 2020
  23. Han-Wen NienhuysJul 27, 2020
  24. Junio C HamanoJul 27, 2020
  25. Han-Wen NienhuysAug 3, 2020
  26. Junio C HamanoAug 3, 2020
  27. Junio C HamanoAug 5, 2020
  28. Han-Wen NienhuysAug 5, 2020
  29. Junio C HamanoAug 5, 2020
  30. Han-Wen NienhuysAug 10, 2020
  31. Junio C HamanoAug 10, 2020
  32. Han-Wen NienhuysAug 11, 2020
  33. Junio C HamanoAug 11, 2020
  34. Han-Wen NienhuysAug 19, 2020
  35. Junio C HamanoAug 19, 2020
  36. 0/3 Remove special casing for PSEUDOREF updatesHan-Wen Nienhuys via GitGitGadget, Jul 27, 2020
  37. 1/3 t1400: use git rev-parse for testing PSEUDOREF existenceHan-Wen Nienhuys via GitGitGadget, Jul 27, 2020
  38. 2/3 Modify pseudo refs through ref backend storageHan-Wen Nienhuys via GitGitGadget, Jul 27, 2020
  39. 3/3 Make HEAD a PSEUDOREF rather than PER_WORKTREE.Han-Wen Nienhuys via GitGitGadget, Jul 27, 2020

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.