Git: get all branch notes

We would like to annotate our commits with help git notes addthat works great. To get a list of all commits with notes, we use this command

git notes | cut -d' ' -f2 | xargs -ihash git log hash -1

Now we are looking for notes of a branch. I do not understand here, because the notes do not know anything about branches. Maybe there is a way to start with git logand ask git notesfor a note to fix there. But I'm sure this will slow down the work of large repositories.

Any ideas?

+4
source share
1 answer

I would start with this:

git log --pretty=format:"%H %N" --show-notes <branch>

See git help logfor additional things you can put in a format string to fix the output the way you want ...

+2
source

All Articles