citing git commits on Trac?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

citing git commits on Trac?

Peter Danecek-3
Hi all,
do we have some convention on how to cite git commits on Trac?

I see that the "Commit Ticket Updater" uses the following format <short git hash>/<GitHub project> and links to an URL on Trac, which then is redirected to GitHub.

Are we supposed to do the same manually when citing commits? Is there some support for this behaviour?

Thanks for the clarification!
~petr

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: citing git commits on Trac?

Joshua Root-8
On 2017-3-29 00:09 , Peter Danecek wrote:
> Hi all,
> do we have some convention on how to cite git commits on Trac?
>
> I see that the "Commit Ticket Updater" uses the following format <short git hash>/<GitHub project> and links to an URL on Trac, which then is redirected to GitHub.
>
> Are we supposed to do the same manually when citing commits? Is there some support for this behaviour?
>
> Thanks for the clarification!
> ~petr

Documentation is available at <https://trac.macports.org/wiki/TracLinks>.

I find the easiest way to link to a commit is [committish/repo], e.g.
[42a4d67a/macports-ports]. Apparently you need at least 8 characters of
the hash, which is slightly annoying since GitHub shows only 7
characters in many places.

- Josh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: citing git commits on Trac?

Rainer Müller-4
On 2017-03-28 15:34, Joshua Root wrote:
> Documentation is available at <https://trac.macports.org/wiki/TracLinks>.
>
> I find the easiest way to link to a commit is [committish/repo], e.g.
> [42a4d67a/macports-ports]. Apparently you need at least 8 characters of
> the hash, which is slightly annoying since GitHub shows only 7
> characters in many places.

Unfortunately that minimum length of 8 characters is hardcoded [1].
Apparently this limit was chosen to avoid linking "rfc1234" [2],
although I do not see the reason why the [revnum/repo] form must have a
minimum length...

As an alternative, the [changeset:42a4d67a/macports-ports] syntax works
in any case, with 7 or even fewer characters.

Rainer

[1]
https://trac.edgewall.org/browser/trunk/trac/versioncontrol/web_ui/changeset.py?rev=15468#L1020
[2] https://trac.edgewall.org/ticket/4261
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: citing git commits on Trac?

Ryan Schmidt-24

> On Mar 28, 2017, at 09:23, Rainer Müller <[hidden email]> wrote:
>
> On 2017-03-28 15:34, Joshua Root wrote:
>> Documentation is available at <https://trac.macports.org/wiki/TracLinks>.
>>
>> I find the easiest way to link to a commit is [committish/repo], e.g.
>> [42a4d67a/macports-ports]. Apparently you need at least 8 characters of
>> the hash, which is slightly annoying since GitHub shows only 7
>> characters in many places.
>
> Unfortunately that minimum length of 8 characters is hardcoded [1].
> Apparently this limit was chosen to avoid linking "rfc1234" [2],
> although I do not see the reason why the [revnum/repo] form must have a
> minimum length...
>
> As an alternative, the [changeset:42a4d67a/macports-ports] syntax works
> in any case, with 7 or even fewer characters.
>
> Rainer
>
> [1]
> https://trac.edgewall.org/browser/trunk/trac/versioncontrol/web_ui/changeset.py?rev=15468#L1020
> [2] https://trac.edgewall.org/ticket/4261

I don't see any reason not to always list the entire 40-character hash.

[cb373533029a92cbc2a41f7cb2c2704e05311a34/macports-ports]

Git and GitHub shows the full 40-character hash in many places; it is not more difficult to copy and paste that.

Loading...