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

Re: [RFC 0/3] Reflogs for deleted refs: fix breakage and suggest namespace change

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 19, 2012, 16:27 UTC
Message-ID
<7vlihaq22v.fsf@alter.siamese.dyndns.org>
In-Reply-To
<5030E7D6.8020206@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 9 quoted lines
> It's been a wish of mine, but it's pretty low priority.  I've also
> brainstormed about some other changes that could be connected with a new
> repo format:
>
> * Allow "deleted" loose references (for example denoted by value 0{40})
> that override packed references with the same name.  This would remove
> the need to rewrite the packed-refs file when a reference is deleted.
> (A prerequisite for this change would be to allow next and next/foo at
> the same time.)

We would need to think the performance implications through of the approach; it tempts us to accumulate the loose "removed" markers in the hope that it would be an improvement than having to rewrite the packed-refs over and over, and without numbers to back that theory up, we may be worsening the system without knowing.

Having said that, it is an interesting idea. I wouldn't use 0{40} as the sentinel value but rather use letters outside [0-9a-f], though.

> * Push HEAD and its friends down out of $GIT_DIR into a
> reference-specific directory.

Not going to happen for several years, I am afraid, as I think many casual tools do an equivalent of "test -f $DIR/HEAD" to see if $DIR is a repository; even our own gitweb does so.

We should advertise an easy way for scripted Porcelains to directly ask is_git_directory().

> * Rename lock files to look less like reference names (e.g., something
> like "refs/foo~lock" instead of "refs/foo.lock").
If you do the ~d/~f thing, foo.lock becomes a non-issue, no?
> * Somehow munge reference names in a way to avoid other filesystem
> limitations -- e.g., case insensitivity, filenames like "com" and "prn"
> or with multiple dots under Windows.

Very interesting. I however am afraid that the users and the projects will learn to avoid the problematic names a lot sooner than such a change will be implemented to make the issue go away (or they have already learned long time ago), and the end result may end up solving a non-issue only to make the output from "find .git/refs" even more unreadable.

> * ...or maybe a packed-refs file that can (usually) be updated in-place,
> and get rid of loose references entirely.
I find this equally intriguing as your "deleted" one above.
Previous: Michael HaggertyNext: Jeff King
Message 19 of 21 in “[RFC 0/3] Reflogs for deleted refs: fix breakage and suggest namespace change”
  1. mhagger@alum.mit.eduAug 18, 2012
  2. 1/3 t9300: format test in modern style prior to modifying itmhagger@alum.mit.edu, Aug 18, 2012
  3. 2/3 Delete reflogs for dead references to allow pruningmhagger@alum.mit.edu, Aug 18, 2012
  4. Jeff KingAug 21, 2012
  5. 3/3 Change naming convention for the reflog graveyardmhagger@alum.mit.edu, Aug 18, 2012
  6. Junio C HamanoAug 18, 2012
  7. Alexey MuranovAug 18, 2012
  8. Junio C HamanoAug 19, 2012
  9. Alexey MuranovAug 19, 2012
  10. Alexey MuranovAug 19, 2012
  11. Alexey MuranovAug 19, 2012
  12. Junio C HamanoAug 19, 2012
  13. Alexey MuranovAug 19, 2012
  14. Junio C HamanoAug 20, 2012
  15. Junio C HamanoAug 20, 2012
  16. Alexey MuranovAug 20, 2012
  17. Alexey MuranovAug 20, 2012
  18. Michael HaggertyAug 19, 2012
  19. Junio C HamanoAug 19, 2012
  20. Jeff KingAug 21, 2012
  21. Junio C HamanoAug 21, 2012

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.