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

Re: [RFC] Hidden refs

From
Jeff King <peff@peff.net>
Date
Oct 13, 2010, 17:35 UTC
Message-ID
<20101013173555.GA13188@sigill.intra.peff.net>
In-Reply-To
<4CB5CEA3.8020702@xiplink.com>
On Wed, Oct 13, 2010 at 11:22:11AM -0400, Marc Branchaud wrote:
Show 11 quoted lines
> We want to have our build system record, in our repo, which commits
> correspond to which builds.
> 
> Nominally, this is a job for tags.  But we don't want to have to look at
> these tags all the time.  We particularly just want to tag the repo when we
> make an actual release -- tags are a Big Deal for us.
> 
> Notes are an option, though they feel a bit heavy for this application.  And
> although we can store the build notes in their own refspace, it would (I
> believe) be a little clunky to make commands like checkout and log work with
> the commits that were noted by the build system.

Keep in mind that notes and tags are basically inverses as far as efficient lookup goes. If you want to map a build name or number to a commit, you would use a ref which points to a commit. But if you want to map a commit sha1 to a build number, you would use notes.

Show 6 quoted lines
> It struck me that it would be neat to have hidden refs in the refs/
> directory.  I experimented a bit with a "refs/.builds" directory:
> 
> * "git update-ref refs/.builds/One" fails with "Cannot lock the
>   ref 'refs/.builds/One'."  So I created a ref the regular way
>   (refs/blah/One) and copied the "One" file into refs/.builds/.

Yeah, I believe "." at the front of a directory component is explicitly forbidden by check_ref_format. I don't recall whether there was a specific rationale, or whether it was simply a can of worms we didn't want to explore.

...

Look like it blames to 03feddd (git-check-ref-format: reject funny ref names., 2005-10-13). This looks like the relevant thread:

  http://article.gmane.org/gmane.comp.version-control.git/9874
but I didn't read through it carefully.
-Peff
Previous: Marc BranchaudNext: Junio C Hamano
Message 4 of 8 in “[RFC] Hidden refs”
  1. Marc BranchaudOct 13, 2010
  2. Stephen BashOct 13, 2010
  3. Marc BranchaudOct 13, 2010
  4. Jeff KingOct 13, 2010
  5. Junio C HamanoOct 13, 2010
  6. Jeff KingOct 13, 2010
  7. Junio C HamanoOct 13, 2010
  8. Jonathan NiederOct 13, 2010

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.