github-changelog-generator icon indicating copy to clipboard operation
github-changelog-generator copied to clipboard

Can we get tag annotations

Open Ic3fr0g opened this issue 6 years ago • 6 comments

Is it possible to fetch the tag title and annotations for each tag, subsequently add them to each tag's description?

## [v1.7.5f](https://github.com) (2019-06-21)
[Full Changelog](https://github.com)

**Description:**
*Tag's title goes here*

- *Tag's annotations goes here*

**Merged pull requests:**
...

https://github.com/github-changelog-generator/github-changelog-generator/blob/f73e689ef1d4b8726aa39c4dc5cc8671da0d45e2/lib/github_changelog_generator/octo_fetcher.rb#L109

I'm not familiar with Ruby otherwise I would raise a PR for this.

Ic3fr0g avatar Jun 26 '19 07:06 Ic3fr0g

I created a GIST in Python. Hope this helps someone. It has a lot of assumptions! Would love for somebody to hit the Github API instead of the way I have done this (git tag -l -n9), parsing and regex.

Ic3fr0g avatar Jun 26 '19 09:06 Ic3fr0g

In the meantime, I incorporated that script as a git hook. See this link. Would love to see this functionality as well.

Ic3fr0g avatar Jul 08 '19 19:07 Ic3fr0g

Hi @Ic3fr0g !

Since you have some work already, care to stage a PR?

ferrarimarco avatar Jul 09 '19 16:07 ferrarimarco

I'm not familiar with Ruby otherwise I would raise a PR for this.

I did this in Python

Ic3fr0g avatar Jul 10 '19 14:07 Ic3fr0g

I'll like to try my hands on this.

@Ic3fr0g could you clarify how you obtain the annotations? Going through your script looks like its only the tag title it uses.

0sc avatar Oct 15 '19 23:10 0sc

I fetch tag annotations using git tag -l -n9. There are a lot of silly hacks I perform to get it to work with this script.

Firstly, all tags follow some nomenclature v1.01, v1.1.1a or something in that format. Typically my tags read like this (fetched using git tag -l -n9) -

v2.2.2h         Check-in experiment: D3+ as a controller
    
    - Override txns for check-ins in D3+ with new controller 'C'
    - Priority for normal rules = 1025, AKB rules = 1026

In my code, I iterate and parse every line in the text data generated by the tag summary. I store the tags as keys in the dictionary tags_title_annotation with values as "title" and "annotation". And I use the fact that subsequent lines under a tag title will either be its annotation or a new tag.

Hope that helps.

Ic3fr0g avatar Oct 17 '19 07:10 Ic3fr0g