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

Re: git push to a non-bare repository

From
Nicolas Pitre <nico@cam.org>
Date
Mar 19, 2007, 15:20 UTC
Message-ID
<alpine.LFD.0.83.0703191116181.18328@xanadu.home>
In-Reply-To
<7vzm69ivfg.fsf@assigned-by-dhcp.cox.net>
On Sun, 18 Mar 2007, Junio C Hamano wrote:
Show 21 quoted lines
> Theodore Tso <tytso@mit.edu> writes:
> 
> > Right, but if the branch being pointed to is pointed to by HEAD I
> > would argue that the reflog for HEAD should be updated, since
> > operations that reference HEAD will see a new commit, and and it will
> > be confusing when "git reflog" shows no hint of the change.
> >
> > Of couse, if the branch being pushed to isn't one which is pointed by
> > HEAD, of course HEAD's reflog shouldn't be updated.
> 
> If we were to do this properly, we probably would need to
> restructure the reflog update code for the HEAD in a major way.
> "git-update-ref refs/heads/foo $newvalue" when HEAD points at
> branch 'foo' currently does not update HEAD reflog because the
> current definition of HEAD reflog is (as Nico mentioned) log of
> changes made through HEAD symref.  Instead, we would need a
> reverse lookup every time any ref is updated to see if that ref
> is pointed by any symbolics ref and update the reflogs of those
> symbolic refs.  This is expensive to do in general, though,
> because there is no backpointer to list of symbolic refs that
> point at a non-symbolic ref.

But practically speaking... is there that many cases where a branch is updated directly instead of the operation performed through HEAD?

We identified one case which is a push to a non bare repo.

If those cases are very few (and they _should_ be very few) then we might simply cheat a little and update HEAD separately in those cases.

Nicolas
Previous: Junio C HamanoNext: Nicolas Pitre
Message 16 of 27 in “git push to a non-bare repository”
  1. Matthieu MoyMar 18, 2007
  2. Junio C HamanoMar 18, 2007
  3. Sam VilainMar 18, 2007
  4. Jakub NarebskiMar 18, 2007
  5. Junio C HamanoMar 18, 2007
  6. Theodore TsoMar 19, 2007
  7. Junio C HamanoMar 19, 2007
  8. Shawn O. PearceMar 19, 2007
  9. Theodore TsoMar 19, 2007
  10. Shawn O. PearceMar 19, 2007
  11. Theodore TsoMar 19, 2007
  12. Shawn O. PearceMar 19, 2007
  13. Nicolas PitreMar 19, 2007
  14. Theodore TsoMar 19, 2007
  15. Junio C HamanoMar 19, 2007
  16. Nicolas PitreMar 19, 2007
  17. Nicolas PitreMar 19, 2007
  18. Sam VilainMar 19, 2007
  19. Junio C HamanoMar 20, 2007
  20. Junio C HamanoMar 20, 2007
  21. Theodore TsoMar 19, 2007
  22. Shawn O. PearceMar 19, 2007
  23. Junio C HamanoMar 19, 2007
  24. Matthieu MoyMar 19, 2007
  25. Jakub NarebskiMar 19, 2007
  26. Neil SchemenauerMar 21, 2007
  27. Sergio CallegariMar 19, 2007

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.