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

Re: notes TODOs (was: Re: [PATCH 1/4] gitweb: notes feature)

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 5, 2010, 15:27 UTC
Message-ID
<201002051627.05182.jnareb@gmail.com>
In-Reply-To
<201002051546.19406.johan@herland.net>
On Fri, 5 Feb 2010, Johan Herland wrote:
> On Friday 05 February 2010, Giuseppe Bilotta wrote:
Show 13 quoted lines
> > If I may be allowed to add a suggestion to put in the list, I would
> > like to see notes attachable to named refs (branch heads in
> > particular). From a cursory reading of your patches currently in pu
> > it would seem that you explicitly prohibit this case currently.
> > However, this has many possible uses, ranging from longer branch
> > descriptions to tracking information to improve survival in case of
> > remote rebases.
> 
> Nope. There is no explicit prohibition on anything. On a fundamental 
> level, Git-notes simply maps a given SHA1 (the annotated object) to 
> another SHA1 (the object holding the annotation itself). In principle 
> you can annotate _any_ SHA1, it doesn't even have to exist as a git 
> object!

I guess that it isn't currently possible to map _path_ (here: fully qualified name of ref, i.e. "refs/heads/master" in example) to SHA1 rather than SHA1 to SHA1, as fan-outs assumes mapping of SHA1 (to object).

Show 7 quoted lines
> 
> In fact, something like the following abomination should solve 
> your "problem" quite easily:
> 
>   git notes add $(echo "refs/heads/master" | git hash-object --stdin)
> 
> (...washing my hands...)

This actually annotates (existing or not) _blob_ object with "refs/heads/master" as contents (git-hash-object defaults to -t blob).

Show 15 quoted lines
> 
> > And one last comment: how do notes behave wrt to cloning and remote
> > handling? Am I correct in my understanding that notes are
> > (presently) local only? Would it make sense to have them cloned to
> > something like the refs/notes/remotes/* namespace?
> 
> They are no more local than any other ref, except that they are
> outside the refspecs that are "usually" pushed/fetched (refs/heads/
> and refs/tags/).
> 
> 	git push <remote> refs/notes/<foo>
> 	git fetch <remote> refs/notes/<foo>[:refs/notes/<foo>]
> 	etc.
> 
> should all work as expected.

It would be nice, but I guess not possible, to have notes autofollowed on fetch, like tags are autofollowed...

-- 
Jakub Narebski
Poland
Previous: Johan HerlandNext: Giuseppe Bilotta
Message 3 of 7 in “notes TODOs (was: Re: [PATCH 1/4] gitweb: notes feature)”
  1. Giuseppe BilottaFeb 5, 2010
  2. Johan HerlandFeb 5, 2010
  3. Jakub NarebskiFeb 5, 2010
  4. Giuseppe BilottaFeb 5, 2010
  5. Jakub NarebskiFeb 6, 2010
  6. Junio C HamanoFeb 6, 2010
  7. Jakub NarebskiFeb 7, 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.