threads / discuss / 24472

Git Notes on Branches

Subject: Git Notes on Branches

## tl;dr

2 messages between Jul 22, 2010 and Jul 22, 2010.

replies: 1people: 2as markdown or json

Joshua Shrader· Jul 22, 2010, 20:22 UTC · lore

I'm wondering if there is a way to (or a reason that would prevent one from implementing a feature that allows one to) associate a note with a branch, rather than a specific object. It seems like a notes object contains a reference to the object that it annotates:

Annotate 4bd93734af...

Rather than forcing this to be a SHA1, can the same approaches as taken with HEAD be employed? That is, allow it to be either an object ID, or a local branch?

This would essentially define a new use case for notes. Rather than just being used to annotate objects, they could be used to describe a feature branch or a bug fix, for example. Then, when a release is created (from, say, master), a "git branches --merged" will show all merged branches. Assuming the workflow is to develop on well-defined branches, if each of these branches had a description in an attached note, created Release Notes would be a piece of cake. Add a description via "git notes add feat-branch-2" that you want to show up in the Release Notes once the branch is re-integrated.

I see a potential problem when working remotely and trying to push the note to origin, but I don't think its insurmountable.

Thoughts?
Josh
Jonathan Nieder· Jul 22, 2010, 21:05 UTC · re: Joshua Shrader · lore

Re: Git Notes on Branches

Hi Joshua,
Joshua Shrader wrote:
> I'm wondering if there is a way to (or a reason that would prevent one
> from implementing a feature that allows one to) associate a note with
> a branch, rather than a specific object.

Except for the word “note”, I think your suggestion does not have anything to do with git notes at all. :)

Special support in gitweb, ‘git branch’, and so on for a branch with files named after branches and giving descriptions would seem sane to me.

Here’s something similar for inspiration:
  http://thread.gmane.org/gmane.comp.version-control.git/33528/focus=33563

Good luck, Jonathan

← back to recent threads