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

Re: [PATCH] Introduce light weight commit annotations

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 10, 2007, 18:56 UTC
Message-ID
<Pine.LNX.4.64.0706101952180.4059@racer.site>
In-Reply-To
<200706101514.14954.johan@herland.net>
Hi,
On Sun, 10 Jun 2007, Johan Herland wrote:
Show 14 quoted lines
> On Saturday 09 June 2007, Johannes Schindelin wrote:
>
> > With the provided script, edit-commit-annotations, you can add 
> > after-the-fact annotations to commits, which will be shown by the log 
> > if the config variable core.showannotations is set.
> > 
> > The annotations are tracked in a new ref, refs/annotations/commits, in 
> > the same fan-out style as .git/objects/??/*, only that they only exist 
> > in the object database now.
> 
> Very interesting. I have to say that after having played around with
> it a couple of minutes, I really like it. Needs some polishing here
> and there (i.e. cleaning up the COMMIT_ANNOTATION.NNNN* files), but
> it is a very good proof-of-concept.

Thanks. I composed it in a hurry, since I wanted it to go out before I took my flight home.

Show 7 quoted lines
> > 	I have the hunch that this will be relatively fast and scalable,
> > 	since the tree objects are sorted by name (the name being the
> > 	object name of the to-be-annotated commit).
> 
> I think I agree with your hunch, although I initially thought that your
> solution was a bit heavy on the number of objects created. But, hey, git
> is _designed_ to handle massive amounts of objects. :)

Besides, these tree objects should delta really well, being almost as efficient as having only one tree object to begin with.

Show 16 quoted lines
> > diff --git a/config.c b/config.c
> > index 58d3ed5..34db9b2 100644
> > --- a/config.c
> > +++ b/config.c
> > @@ -356,6 +356,11 @@ int git_default_config(const char *var, const char *value)
> >  		return 0;
> >  	}
> >  
> > +	if (!strcmp(var, "core.showannotaions")) {
> > +		show_commit_annotations = git_config_bool(var, value);
> > +		return 0;
> > +	}
> > +
> 
> Small typo here. "core.showannotaions" should be "core.showannotations",
> I guess.

Yep. I tested it with "core.shownotes", but decided before sending the patch that the name would be inconsistent with the rest of the code.

However, as I suggested later, I could imagine that an even better way could be to have "core.annotationsRef", overrideable by GIT_ANNOTATIONS_REF, which could possibly even be a list of refs.

BTW I am not married to calling it "annotations". If you like "notes" better, I'm fine with it.

Ciao, Dscho

Previous: Johan HerlandNext: Johan Herland
Message 3 of 18 in “Introduce light weight commit annotations”
  1. Introduce light weight commit annotationsJohannes Schindelin, Jun 9, 2007
  2. Johan HerlandJun 10, 2007
  3. Johannes SchindelinJun 10, 2007
  4. Johan HerlandJun 10, 2007
  5. Johannes SchindelinJun 10, 2007
  6. Junio C HamanoJun 10, 2007
  7. Johannes SchindelinJun 10, 2007
  8. Junio C HamanoJun 10, 2007
  9. Johannes SchindelinJun 11, 2007
  10. Johannes SchindelinJun 12, 2007
  11. Alex RiesenJun 10, 2007
  12. Alex RiesenJun 10, 2007
  13. Junio C HamanoJun 11, 2007
  14. Nicolas PitreJun 11, 2007
  15. Alex RiesenJun 11, 2007
  16. Junio C HamanoJun 11, 2007
  17. Alex RiesenJun 11, 2007
  18. Johannes SchindelinJun 11, 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.