# Does anyone use git-notes?

9 messages from 2010-08-25 to 2010-08-26. Participants: Scott Chacon, Joshua Jensen, Thomas Rast, Junio C Hamano, Tor Arntsen, Michael J Gruber, Jon Seymour, Will Palmer.
Thread: https://gitlist.dev/t/24859

## Scott Chacon, 2010-08-25 18:15

Subject: Does anyone use git-notes?
Message-ID: <AANLkTin=VXp2BU0vhTLUy6MpJ7spXRs1dZC1wygoN6T-@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTin%3DVXp2BU0vhTLUy6MpJ7spXRs1dZC1wygoN6T-%40mail.gmail.com

```
I would like to write a post on how to use them, but I'm a bit
confused as to how people actually use them on a day to day basis.  I
appears to me in trying to work out a flow for them that the lack of
an ability to merge them makes them very difficult to use for anything
practical.  Can someone share with me how they use them and what the
cycle is?

Thanks,
Scott

```

## Joshua Jensen, 2010-08-25 18:40

Subject: Re: Does anyone use git-notes?
Message-ID: <4C756395.6020103@workspacewhiz.com>
URL: https://gitlist.dev/e/4C756395.6020103%40workspacewhiz.com
In-Reply-To: <AANLkTin=VXp2BU0vhTLUy6MpJ7spXRs1dZC1wygoN6T-@mail.gmail.com>

```
  ----- Original Message -----
From: Scott Chacon
Date: 8/25/2010 12:15 PM
> I would like to write a post on how to use them, but I'm a bit
> confused as to how people actually use them on a day to day basis.  I
> appears to me in trying to work out a flow for them that the lack of
> an ability to merge them makes them very difficult to use for anything
> practical.  Can someone share with me how they use them and what the
> cycle is?
I do.  I use them to automatically store a matching Perforce revision 
number for a given Git commit.  Only the server assigns them due to the 
merging issues.  I also change the ref, so they read as p4notes.

It irks me, though, that they show in the gitk --all view.  ARGH!

Josh

```

## Thomas Rast, 2010-08-25 18:52

Subject: Re: Does anyone use git-notes?
Message-ID: <201008252052.37524.trast@student.ethz.ch>
URL: https://gitlist.dev/e/201008252052.37524.trast%40student.ethz.ch
In-Reply-To: <AANLkTin=VXp2BU0vhTLUy6MpJ7spXRs1dZC1wygoN6T-@mail.gmail.com>

```
Scott Chacon wrote:
> I would like to write a post on how to use them, but I'm a bit
> confused as to how people actually use them on a day to day basis.  I
> appears to me in trying to work out a flow for them that the lack of
> an ability to merge them makes them very difficult to use for anything
> practical.  Can someone share with me how they use them and what the
> cycle is?

I run a cronjob that downloads mail from gmane and fetches git.git,
then attempts to correlate mail with commits.  The results are at

  git://repo.or.cz/git/trast.git notes/terse notes/full

I have previously posted about this at e.g.

  http://mid.gmane.org/200902091508.11460.trast@student.ethz.ch
  http://mid.gmane.org/201003042321.36240.trast@student.ethz.ch

though I should point out that it no longer tries to apply the patches
as outlined in the first post; this was simply way too expensive.


I also use it when heavily editing a patch series to tack little
reminders on my fixup patches.  I have

  $ git config alias.fixup
  !sh -c 'r=$1; git commit -m"fixup! $(git log -1 --pretty=%s $r)"' -

so I usually do

  # hack
  git add -p
  git fixup HEAD~3
  git notes add -m 'fix foo'

which combined with notes.rewriteRef=refs/notes/* (and
notes.rewriteMode left at the default of 'concatenate') means that I
end up having a little list of reminders what changed since the last
revisions.  I then simply clear them out before starting a new round.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

```

## Junio C Hamano, 2010-08-25 22:42

Subject: Re: Does anyone use git-notes?
Message-ID: <7vhbiipb5z.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vhbiipb5z.fsf%40alter.siamese.dyndns.org
In-Reply-To: <AANLkTin=VXp2BU0vhTLUy6MpJ7spXRs1dZC1wygoN6T-@mail.gmail.com>

```
Scott Chacon <schacon@gmail.com> writes:

> I would like to write a post on how to use them, but I'm a bit
> confused as to how people actually use them on a day to day basis.  I
> appears to me in trying to work out a flow for them that the lack of
> an ability to merge them makes them very difficult to use for anything
> practical.  Can someone share with me how they use them and what the
> cycle is?

I have a custom post-applypatch hook (see my "todo" branch) enabled and
then use the amlook script (again, see my "todo" branch) script to inspect
the corresponding notes tree.

After applying a received patch e-mail, the result is annotated with
enough information to identify which message it came from by the hook.
When I am scouring the mailing list backlog to see if I have missed
something interesting (sometimes I find interest in a topic that I thought
totally uninteresting earlier), the amlook script is used to see if the
patch has been already applied.

Looking through millions of notes this way won't scale (iow, amlook is a
bad example of using this feature, as the notes tree is used as a database
index in the wrong direction), by the way, so you may probably not want to
use it as a good example.

```

## Junio C Hamano, 2010-08-25 22:43

Subject: Re: Does anyone use git-notes?
Message-ID: <7vd3t6pb3v.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd3t6pb3v.fsf%40alter.siamese.dyndns.org
In-Reply-To: <AANLkTin=VXp2BU0vhTLUy6MpJ7spXRs1dZC1wygoN6T-@mail.gmail.com>

```
Scott Chacon <schacon@gmail.com> writes:

> I would like to write a post on how to use them, but I'm a bit
> confused as to how people actually use them on a day to day basis.  I
> appears to me in trying to work out a flow for them that the lack of
> an ability to merge them makes them very difficult to use for anything
> practical.  Can someone share with me how they use them and what the
> cycle is?

I have a custom post-applypatch hook (see my "todo" branch) enabled and
then use the amlook script (again, see my "todo" branch) to inspect the
notes the hook left.

After applying a received patch e-mail, the result is annotated with
enough information to identify which message it came from by the hook (I
probably should add more information to the notes, but never got around to
it).  When I am scouring the mailing list backlog to see if I have missed
something interesting (sometimes I find interest in a topic that I thought
totally uninteresting earlier), the amlook script is used to see if the
patch has already been applied, and if so to which branch.

Looking through millions of notes this way won't scale (iow, amlook is a
bad example of using this feature, as the notes tree is used as a database
index in the wrong direction), by the way, so you may probably not want to
use it as a good example.

```

## Tor Arntsen, 2010-08-26 07:56

Subject: Re: Does anyone use git-notes?
Message-ID: <AANLkTim01==of5ce07F4MFVazevNiRQLBMv38ferSgKB@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTim01%3D%3Dof5ce07F4MFVazevNiRQLBMv38ferSgKB%40mail.gmail.com
In-Reply-To: <AANLkTin=VXp2BU0vhTLUy6MpJ7spXRs1dZC1wygoN6T-@mail.gmail.com>

```
On Wed, Aug 25, 2010 at 20:15, Scott Chacon <schacon@gmail.com> wrote:
> I would like to write a post on how to use them, but I'm a bit
> confused as to how people actually use them on a day to day basis.  I
> appears to me in trying to work out a flow for them that the lack of
> an ability to merge them makes them very difficult to use for anything
> practical.  Can someone share with me how they use them and what the
> cycle is?

I use Notes in a very simplistic way. For example, with an emulator
I'm writing I have two or three ways of using git-notes:
1: I commit fixes and changes with a commit message describing the
fix. Later I may find out that the fix made a couple more programs of
the set I have run in the emulator, so I add a note to the commit
saying 'This change makes X and Y work'.
2: I add test cases to the instruction validator I wrote for the
emulator, if the test currently fails I say so in the commit message.
At some later point I may commit a fix that lets the test pass, then I
go back to the original commit message (which said the test currently
failed) and add a note saying 'Fixed by [commit] nnnnnnn'.
3: Occasionally I just use notes as a reminder. If a commit adds a new
feature I may later (after using the feature) add a 'todo'-note about
what improvements I should add.

One use case I have thought of for the company case is to add notes to
a release commit with information that wasn't  or couldn't be added at
the time of the commit, e.g. a list of problem reports closed by the
release.  But I haven't actually figured out how I can get Notes
transferred over a pull yet.. although I haven't tried since 1.7.0.

-Tor

```

## Michael J Gruber, 2010-08-26 08:09

Subject: Re: Does anyone use git-notes?
Message-ID: <4C762137.1090801@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4C762137.1090801%40drmicha.warpmail.net
In-Reply-To: <AANLkTin=VXp2BU0vhTLUy6MpJ7spXRs1dZC1wygoN6T-@mail.gmail.com>

```
Scott Chacon venit, vidit, dixit 25.08.2010 20:15:
> I would like to write a post on how to use them, but I'm a bit
> confused as to how people actually use them on a day to day basis.  I
> appears to me in trying to work out a flow for them that the lack of
> an ability to merge them makes them very difficult to use for anything
> practical.  Can someone share with me how they use them and what the
> cycle is?

I use it to store the patch comments (the part that goes after the
"---", before the diff) along with my commits so that I have them in my
git.git tree, not only in my mbox. This makes it also easier to redo a
patch and keep the comment when regenerating the patch e-mail with
format-patch. (I don't have a good solution for the cover letter yet.)

Michael

```

## Jon Seymour, 2010-08-26 08:26

Subject: Re: Does anyone use git-notes?
Message-ID: <AANLkTi=jNPtvpO_gVKyS0U_0qRLtKZ84p=B+8zStxvkX@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3DjNPtvpO_gVKyS0U_0qRLtKZ84p%3DB%2B8zStxvkX%40mail.gmail.com
In-Reply-To: <AANLkTin=VXp2BU0vhTLUy6MpJ7spXRs1dZC1wygoN6T-@mail.gmail.com>

```
On Thu, Aug 26, 2010 at 4:15 AM, Scott Chacon <schacon@gmail.com> wrote:
> I would like to write a post on how to use them, but I'm a bit
> confused as to how people actually use them on a day to day basis.  I
> appears to me in trying to work out a flow for them that the lack of
> an ability to merge them makes them very difficult to use for anything
> practical.  Can someone share with me how they use them and what the
> cycle is?
>

I use them to store test execution output.

By post-processing, then diffing such notes, I can work out what was
regressed or fixed between two commits.

jon.

```

## Will Palmer, 2010-08-26 13:09

Subject: Re: Does anyone use git-notes?
Message-ID: <1282828143.6120.3.camel@wpalmer.simply-domain>
URL: https://gitlist.dev/e/1282828143.6120.3.camel%40wpalmer.simply-domain
In-Reply-To: <4C762137.1090801@drmicha.warpmail.net>

```
On Thu, 2010-08-26 at 10:09 +0200, Michael J Gruber wrote:
> I use it to store the patch comments (the part that goes after the
> "---", before the diff) along with my commits so that I have them in my
> git.git tree, not only in my mbox. This makes it also easier to redo a
> patch and keep the comment when regenerating the patch e-mail with
> format-patch. (I don't have a good solution for the cover letter yet.)
> 
> Michael

Not to stray off-topic, but I use tags for the cover letter eg:
refs/tags/patches/short-description/v[N]

I hadn't thought of using git-notes for the per-patch comments, here I
was with the opposite problem (A straighforward way to keep track of
cover-letters, but no good way to keep track of the per-patch comments)

```
