I did a bit more experiments with git-notes and I think here is the workable solution.

The main challenge is that git-notes use refs/notes/* to store the data, and this is neither branches nor tags that git push/pull would recognize by default. So the first step is to teach git push/pull to ferry them back and forth between the remote repository and your workspace by adding this under the [remote "origin"] section:

        fetch = +refs/notes/commits:refs/notes/origin
        push  = refs/notes/commits:refs/notes/commits

The first line tells git-pull to retrieve git-notes as the "origin" notes, then the second line tells git-push to try to push your notes into the remote repository.

The reason these two operations are asymmetric is because git-pull doesn't automatically merge the remote ref with your local ref, because it doesn't think this is a branch.

So if you find that the git-push fails on refs/notes/commits, you need to merge them:

    git notes merge origin

This does add some complexity, but only those who have added two lines in .git/config would be affected, so casual users of the core repository won't be impacted.


On the upside, GitHub web UI provides a git-notes display [1], although it doesn't show up in the commit history page, so it's not particular discoverable.


[1] https://github.com/jenkinsci/jenkins/commit/3f4d82a1a3c1585ff13f44053c4d018a93dcc7be
[2] https://github.com/jenkinsci/jenkins/commits/

On 04/17/2013 01:25 PM, Kohsuke Kawaguchi wrote:

As discussed in the project meeting several weeks ago, I dig up what I
wrote, made a bit of improvement, and put it in [1]. It is being run at [2].

This looks at the usual commit markers of the form [FIXED JENKINS-1234],
and generates a JSON file like [4].

Now, the original conversation involved perhaps using git-notes to
supplement what's in the commit messages, but according to [3] it
doesn't look very promising, because of the lack of support in the
mechanism to share/merge notes.

Another possibility is to use GitHub commit comments and scrape them,
although the GitHub UI doesn't allow humans to very easily list them all
(while REST API does allow the program to efficiently iterate them all.)

Another disadvantage is that those comments are no longer in Git itself.

[1] https://github.com/jenkinsci/backend-commit-history-parser
[2]
https://ci.jenkins-ci.org/view/Infrastructure/job/infra_commit_history_generation
[3] http://git-scm.com/2010/08/25/notes.html
[4]
https://ci.jenkins-ci.org/view/Infrastructure/job/infra_commit_history_generation/lastSuccessfulBuild/artifact/release-changelog.json



--
Kohsuke Kawaguchi | CloudBees, Inc. | http://cloudbees.com/
Try Nectar, our professional version of Jenkins

--
You received this message because you are subscribed to the Google Groups "Jenkins 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to