threads / discuss / 34453

Git counterpart to SVN bugtraq properties?

Subject: Git counterpart to SVN bugtraq properties?

## tl;dr

10 messages between Jul 17, 2013 and Oct 4, 2013.

replies: 9people: 4as markdown or json

Marc Strapetz· Jul 17, 2013, 13:03 UTC · lore

I'm looking for a specification or guidelines on how a Git client should integrate with bug tracking systems. For SVN, one can use bugtraq-properties [1] to specify e.g. the issue tracker URL or how to parse the bug ID from a commit message. AFAIU, there is nothing comparable for Git [2]? If that's actually the case, is someone interested in working out a similar specification for Git?

[1] http://code.google.com/p/tortoisesvn/source/browse/tags/version_1.2.0/doc/issuetrackers.txt

[2] http://stackoverflow.com/questions/17545548
-Marc
John Keeping· Jul 17, 2013, 13:33 UTC · re: Marc Strapetz · lore

Re: Git counterpart to SVN bugtraq properties?

On Wed, Jul 17, 2013 at 03:03:14PM +0200, Marc Strapetz wrote:
Show 10 quoted lines
> I'm looking for a specification or guidelines on how a Git client should
> integrate with bug tracking systems. For SVN, one can use
> bugtraq-properties [1] to specify e.g. the issue tracker URL or how to
> parse the bug ID from a commit message. AFAIU, there is nothing
> comparable for Git [2]? If that's actually the case, is someone
> interested in working out a similar specification for Git?
> 
> [1] http://code.google.com/p/tortoisesvn/source/browse/tags/version_1.2.0/doc/issuetrackers.txt
> 
> [2] http://stackoverflow.com/questions/17545548

The Git way to record the issue ID as a footer in the commit message. See for example [1]. Although I'm not aware of any standard for naming this footer.

In terms of recording the URL and other data, I think you'd want a dotfile in the repository (perhaps .bugzilla). This shoudld probably be in the gitconfig format, like .gitmodules.

I think "all" it needs is to draw up a spec for the names of keys and format of their values, along with the format of footer(s) identifying issues associated with a commit and to persuade UI developers to support it... ;-)

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4a88f73f14f6d6c94616538427e1235a6d0a5885
Marc Strapetz· Jul 18, 2013, 13:32 UTC · re: John Keeping · lore

Re: Git counterpart to SVN bugtraq properties?

On 17.07.2013 15:33, John Keeping wrote:
Show 15 quoted lines
> On Wed, Jul 17, 2013 at 03:03:14PM +0200, Marc Strapetz wrote:
>> I'm looking for a specification or guidelines on how a Git client should
>> integrate with bug tracking systems. For SVN, one can use
>> bugtraq-properties [1] to specify e.g. the issue tracker URL or how to
>> parse the bug ID from a commit message. AFAIU, there is nothing
>> comparable for Git [2]? If that's actually the case, is someone
>> interested in working out a similar specification for Git?
>>
>> [1] http://code.google.com/p/tortoisesvn/source/browse/tags/version_1.2.0/doc/issuetrackers.txt
>>
>> [2] http://stackoverflow.com/questions/17545548
> 
> The Git way to record the issue ID as a footer in the commit message.
> See for example [1].  Although I'm not aware of any standard for naming
> this footer.

I wasn't aware of that and probably I'm not the only one. For instance, we are using JIRA and typical commit messages look like

 SG-1234: fix something
 More details on what has been fixed ...

So the issues ID is present in the first line. This has the advantage that every GUI client will display it, as usually the short version of the commit message (which is used everywhere) reaches up to the first dot or LF. Hence it's pretty easy to display a hyperlink for the "SG-1234" part. bugtraq properties allow to define whether the issue ID should be appended to the top or bottom of the commit message. So looks like such an option makes sense for Git as well.

> In terms of recording the URL and other data, I think you'd want a
> dotfile in the repository (perhaps .bugzilla).  This shoudld probably be
> in the gitconfig format, like .gitmodules.

Having such a file sounds reasonable for storing the defaults, though let's call it .bugtraq or have some other more general name. Similar to .gitmodules, it makes sense to have the actual properties stored in $GIT_DIR/config which can be "initialized" from this .bugtraq file. The arguments are the same as for submodules: URLs stored in .bugtraq might need to be changed, depending on the client location (firewall/proxy...).

Or we could just have $GIT_DIR/config properties *optionally*, overriding the .bugtraq properties, as for most users the default configuration will work fine anyway.

> I think "all" it needs is to draw up a spec for the names of keys and
> format of their values, along with the format of footer(s) identifying
> issues associated with a commit and to persuade UI developers to support
> it... ;-)

I'll try to compose something here. But I'm wondering how we could attract a couple of developers or users to join in this discussion?

-Marc
Marc Strapetz· Sep 30, 2013, 16:54 UTC · re: John Keeping · lore

Re: Git counterpart to SVN bugtraq properties?

On 17.07.2013 15:33, John Keeping wrote:
Show 24 quoted lines
> On Wed, Jul 17, 2013 at 03:03:14PM +0200, Marc Strapetz wrote:
>> I'm looking for a specification or guidelines on how a Git client should
>> integrate with bug tracking systems. For SVN, one can use
>> bugtraq-properties [1] to specify e.g. the issue tracker URL or how to
>> parse the bug ID from a commit message. AFAIU, there is nothing
>> comparable for Git [2]? If that's actually the case, is someone
>> interested in working out a similar specification for Git?
>>
>> [1] http://code.google.com/p/tortoisesvn/source/browse/tags/version_1.2.0/doc/issuetrackers.txt
>>
>> [2] http://stackoverflow.com/questions/17545548
> 
> The Git way to record the issue ID as a footer in the commit message.
> See for example [1].  Although I'm not aware of any standard for naming
> this footer.
> 
> In terms of recording the URL and other data, I think you'd want a
> dotfile in the repository (perhaps .bugzilla).  This shoudld probably be
> in the gitconfig format, like .gitmodules.
> 
> I think "all" it needs is to draw up a spec for the names of keys and
> format of their values, along with the format of footer(s) identifying
> issues associated with a commit and to persuade UI developers to support
> it... ;-)

Finally, I've created a minimal spec which is sufficient to parse and display issue IDs:

https://github.com/mstrap/bugtraq/blob/master/specification.txt
I'd appreciate comments and pull requests.
-Marc
Jonathan Nieder· Sep 30, 2013, 18:55 UTC · re: Marc Strapetz · lore

Re: Git counterpart to SVN bugtraq properties?

Hi,
Marc Strapetz wrote:
>> On Wed, Jul 17, 2013 at 03:03:14PM +0200, Marc Strapetz wrote:
>>> I'm looking for a specification or guidelines on how a Git client should
>>> integrate with bug tracking systems.
[...]
> Finally, I've created a minimal spec which is sufficient to parse and
> display issue IDs:
>
> https://github.com/mstrap/bugtraq/blob/master/specification.txt
Neat. :)

It reminds me a little of Gerrit's commentlink functionality, though that tries to solve a different / more generic problem (automatic linking in commit messages in general, not just to bug trackers): https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#_a_id_commentlink_a_section_commentlink

Some projects use more than one bug tracker. For example, a distro might have its own bug tracking system and also sometimes make commits that refer to the upstream bug tracker. I don't think that's important to necessarily address in the first version of a project like this, but thought I should mention it to help plans for the future.

Gerrit keeps its configuration in a file named "project.config" in the tree associated to the refs/meta/config commit so a single configuration can be applied to the entire repository. Which .gitbugtraq file should take effect in a repository with multiple branches?

Hope that helps, Jonathan

Marc Strapetz· Oct 1, 2013, 11:58 UTC · re: Jonathan Nieder · lore

Re: Git counterpart to SVN bugtraq properties?

On 30.09.2013 20:55, Jonathan Nieder wrote:
Show 19 quoted lines
> Hi,
> 
> Marc Strapetz wrote:
>>> On Wed, Jul 17, 2013 at 03:03:14PM +0200, Marc Strapetz wrote:
> 
>>>> I'm looking for a specification or guidelines on how a Git client should
>>>> integrate with bug tracking systems.
> [...]
>> Finally, I've created a minimal spec which is sufficient to parse and
>> display issue IDs:
>>
>> https://github.com/mstrap/bugtraq/blob/master/specification.txt
> 
> Neat. :)
> 
> It reminds me a little of Gerrit's commentlink functionality, though
> that tries to solve a different / more generic problem (automatic
> linking in commit messages in general, not just to bug trackers):
> https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#_a_id_commentlink_a_section_commentlink

Thanks, that's an interesting pointer. I have included some of the ideas in this new draft (section 2 and new section 3):

https://github.com/mstrap/bugtraq/blob/wip/specification.txt
Show 6 quoted lines
> Some projects use more than one bug tracker.  For example, a distro
> might have its own bug tracking system and also sometimes make commits
> that refer to the upstream bug tracker.  I don't think that's
> important to necessarily address in the first version of a project
> like this, but thought I should mention it to help plans for the
> future.

I'd even say it's a good idea to prepare for multiple configurations right from the beginning :) I've changed that in the draft as well.

Show 5 quoted lines
> Gerrit keeps its configuration in a file named "project.config" in the
> tree associated to the refs/meta/config commit so a single
> configuration can be applied to the entire repository.  Which
> .gitbugtraq file should take effect in a repository with multiple
> branches?

Actually, if the configuration changes over time, .gitbugtraq does not work well, at least when working with older commits. However, the advantage of this regular file is that users will get it automatically when cloning a repository for the first time and they will get updates to this file on Pull as well. So the Bugtraq configuration works out of the box.

To set up refs/meta/config, you have to be a Git expert, IMO. And -- more important -- a user (or the client) needs to invoke additional commands to receive the configuration (or updates of the configuration). Nevertheless I see the advantages of this singular file as well. So I'm not sure, how to proceed here.

-Marc
Thomas Koch· Oct 4, 2013, 09:15 UTC · re: Marc Strapetz · lore

Re: Git counterpart to SVN bugtraq properties?

On Wednesday, July 17, 2013 03:03:14 PM Marc Strapetz wrote:
> I'm looking for a specification or guidelines on how a Git client should
> integrate with bug tracking systems. For SVN, one can use
> bugtraq-properties [1] to specify e.g. the issue tracker URL ...

There's seldom a question that has not been asked before. There already is a popular standard for project information like the link to a bugtracker and much more: https://en.wikipedia.org/wiki/DOAP (Description of a Project)

Marc Strapetz· Oct 4, 2013, 11:22 UTC · re: Thomas Koch · lore

Re: Git counterpart to SVN bugtraq properties?

On 04.10.2013 11:15, Thomas Koch wrote:
Show 8 quoted lines
> On Wednesday, July 17, 2013 03:03:14 PM Marc Strapetz wrote:
>> I'm looking for a specification or guidelines on how a Git client should
>> integrate with bug tracking systems. For SVN, one can use
>> bugtraq-properties [1] to specify e.g. the issue tracker URL ...
> 
> There's seldom a question that has not been asked before. There already is a 
> popular standard for project information like the link to a bugtracker and 
> much more: https://en.wikipedia.org/wiki/DOAP (Description of a Project) 
I can't see how that relates to concepts like (SVN) bugtraq properties.
-Marc
Thomas Koch· Oct 4, 2013, 12:36 UTC · re: Marc Strapetz · lore

Re: Git counterpart to SVN bugtraq properties?

On Friday, October 04, 2013 01:22:08 PM Marc Strapetz wrote:
Show 12 quoted lines
> On 04.10.2013 11:15, Thomas Koch wrote:
> > On Wednesday, July 17, 2013 03:03:14 PM Marc Strapetz wrote:
> >> I'm looking for a specification or guidelines on how a Git client should
> >> integrate with bug tracking systems. For SVN, one can use
> >> bugtraq-properties [1] to specify e.g. the issue tracker URL ...
> > 
> > There's seldom a question that has not been asked before. There already
> > is a popular standard for project information like the link to a
> > bugtracker and much more: https://en.wikipedia.org/wiki/DOAP
> > (Description of a Project)
> 
> I can't see how that relates to concepts like (SVN) bugtraq properties.

You asked for a place to write the bugtracker URL to. DOAP defines a data structure that also contains the bugtracker URL of a project. Just place a doap file in your Git repo and parse it.

Regards, Thomas Koch
Marc Strapetz· Oct 1, 2013, 12:24 UTC · lore

Re: Git counterpart to SVN bugtraq properties?

On 30.09.2013 21:42, James Sharpe wrote:
> You could also use git notes to store the information. The advantage
> there is they can be added to commits without changing the history.
> Gerrit and jenkins can auto generate this sort of metadata via plugins.

git notes could be the preferred storage for issues IDs when the client wants to add this kind of meta information on Commit. This would actually solve one weak point of SVN bugtraq properties where you can just specify to prepend or append an issue ID to the commit message (i.e. silently altering the commit message).

-Marc
Show 46 quoted lines
> 
> On 30 Sep 2013 20:02, "Jonathan Nieder" <jrnieder@gmail.com
> <mailto:jrnieder@gmail.com>> wrote:
> 
>     Hi,
> 
>     Marc Strapetz wrote:
>     >> On Wed, Jul 17, 2013 at 03:03:14PM +0200, Marc Strapetz wrote:
> 
>     >>> I'm looking for a specification or guidelines on how a Git
>     client should
>     >>> integrate with bug tracking systems.
>     [...]
>     > Finally, I've created a minimal spec which is sufficient to parse and
>     > display issue IDs:
>     >
>     > https://github.com/mstrap/bugtraq/blob/master/specification.txt
> 
>     Neat. :)
> 
>     It reminds me a little of Gerrit's commentlink functionality, though
>     that tries to solve a different / more generic problem (automatic
>     linking in commit messages in general, not just to bug trackers):
>     https://gerrit-review.googlesource.com/Documentation/config-gerrit.html#_a_id_commentlink_a_section_commentlink
> 
>     Some projects use more than one bug tracker.  For example, a distro
>     might have its own bug tracking system and also sometimes make commits
>     that refer to the upstream bug tracker.  I don't think that's
>     important to necessarily address in the first version of a project
>     like this, but thought I should mention it to help plans for the
>     future.
> 
>     Gerrit keeps its configuration in a file named "project.config" in the
>     tree associated to the refs/meta/config commit so a single
>     configuration can be applied to the entire repository.  Which
>     .gitbugtraq file should take effect in a repository with multiple
>     branches?
> 
>     Hope that helps,
>     Jonathan
>     --
>     To unsubscribe from this list: send the line "unsubscribe git" in
>     the body of a message to majordomo@vger.kernel.org
>     <mailto:majordomo@vger.kernel.org>
>     More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

← back to recent threads