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

Re: branch description

From
Johan Herland <johan@herland.net>
Date
Apr 19, 2008, 18:09 UTC
Message-ID
<200804192009.36243.johan@herland.net>
In-Reply-To
<7v1w51g2q5.fsf@gitster.siamese.dyndns.org>
On Saturday 19 April 2008, Junio C Hamano wrote:
Show 32 quoted lines
> Johan Herland <johan@herland.net> writes:
> 
> > The problem with (3) vs. (4) is that in (3) we must make sure that whenever
> > a branch is moved/renamed (e.g. "git clone", "git branch -m", probably more
> > as well), the corresponding description is moved/renamed as well. This is
> > elegantly solved in (4).
> 
> If your "elegently solved" is coming from an assumption that it is enough
> for "git mv" (for example) to just copy whatever is in .git/refs/heads/foo
> to .git/refs/heads/bar without understanding what is contained in it, that
> assumption unfortunately does not hold.
> 
> You must support packed refs, so you need to teach the refs infrastructure
> what per-branch attributes there are other than the commit object name it
> points at anyway.
> 
> And we already do -- when you do "branch -m foo bar", corresponding config
> entries are also renamed.  We also move reflogs.
> 
> A possible approach that would work, which contains elements from (4), is
> to change implementations of loose ref to have this extra info in loose
> ref files (that is what (4) is), *and* introduce another separate
> mechanism to store corresponding information for packed refs elsewhere.
> Propagation needs to deal with both representations, renaming needs to
> deal with both representations, looking up needs to deal with both
> representations, everybody needs to deal with both representations.
> 
> If you are going to invent "another separate mechanism" to support packed
> refs anyway, why not use that same mechanism to record information for
> loose ones as well?  That is the approach suggested by (3).  In either way
> we need to teach relevant parts of the code for propagation, renaming,
> looking up etc about the new mechanism.

You're right. Also, after thinking some more about this, it occured to me that most code paths will probably _not_ be interested in branch descriptions at all. It therefore makes sense to keep the descriptions away from the refs themselves, so that they don't impact performance.

So #3 (keeping descriptions in $GIT_DIR/info/refs_description) is probably the best solution.

Have fun! :)
...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Junio C HamanoNext: Jakub Narebski
Message 19 of 23 in “branch description”
  1. Stephen SinclairApr 15, 2008
  2. Russ DillApr 15, 2008
  3. Brian GernhardtApr 15, 2008
  4. Junio C HamanoApr 15, 2008
  5. Jeff KingApr 15, 2008
  6. Jeff KingApr 15, 2008
  7. Junio C HamanoApr 15, 2008
  8. Stephen SinclairApr 15, 2008
  9. Brian GernhardtApr 15, 2008
  10. Jakub NarebskiApr 16, 2008
  11. Jeff KingApr 16, 2008
  12. Stephen SinclairApr 16, 2008
  13. Mike HommeyApr 16, 2008
  14. Matt GrahamApr 16, 2008
  15. Johan HerlandApr 16, 2008
  16. Jakub NarebskiApr 18, 2008
  17. Johan HerlandApr 19, 2008
  18. Junio C HamanoApr 19, 2008
  19. Johan HerlandApr 19, 2008
  20. Jakub NarebskiApr 19, 2008
  21. Junio C HamanoApr 16, 2008
  22. Jakub NarebskiApr 16, 2008
  23. Jakub NarebskiApr 15, 2008

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.