git: fb36cfdfb2 - main - Add gitref macro to reference a git hash

John Baldwin jhb at FreeBSD.org
Tue Feb 16 16:07:15 UTC 2021


On 2/13/21 1:22 PM, Sergio Carlavilla Delgado wrote:
> The branch main has been updated by carlavilla:
> 
> URL: https://cgit.FreeBSD.org/doc/commit/?id=fb36cfdfb2dd5e9ebe217d820609d96fb73d8cc8
> 
> commit fb36cfdfb2dd5e9ebe217d820609d96fb73d8cc8
> Author:     Sergio Carlavilla Delgado <carlavilla at FreeBSD.org>
> AuthorDate: 2021-02-13 21:16:57 +0000
> Commit:     Sergio Carlavilla Delgado <carlavilla at FreeBSD.org>
> CommitDate: 2021-02-13 21:22:34 +0000
> 
>      Add gitref macro to reference a git hash
>      
>      With this extension a git hash can be easily referenced.
>      
>      The porters handbook versions chapter uses this extension
>      as an example in the FreeBSD 14.0 version table.
>      
>      An example of use
>      
>      gitref:hash[repository="src|doc|ports",length=hash-longitude]
>      
>      The repository should be src, doc or ports.
>      And if no length it's specified the macro will use 12 characters
>      of the specified hash.
>      
>      PR:             253050
>      Submitted by:   jhb@

Thanks!  My only suggestion would be that ideally we would not specify
the length inline as someday we might need to expand it as our repo
grows, and we'd want all the existing gitref's to expand at the same time
without having to go change the length fields in all of them explicitly
I think.  That is, I'd rather that when we need 13 as the length for src,
we can do that by making a single change to extension.rb and rebuilding
without having to touch all the places that use gitref like release notes,
etc.

-- 
John Baldwin


More information about the dev-commits-doc-all mailing list