commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

Auto-linked references to commits/PRs in changelog

Open paduszyk opened this issue 1 year ago • 3 comments

Description

We all use GitHub's auto-links to refer to commits and pull requests.

I think it would be nice if the changelogs generated by the tool had them as well.

Commits added by push and squash merge could have SHA1 and PR references, respectively, appended, e.g.:

  • fix: resolve an urgent issue [abcd123]
  • feat: add a new feature (#1)

Possible Solution

I believe this proposal would require:

  • update the default templates (SHA1 is already found in the context);
  • update commit parser to detect that the commit message includes r"#\d+"

Additional context

This would also require adding (somewhere in the settings) extra info on the base URL for the repo.

If they are not found, the auto-link generation may be disabled by default.

Additional context

No response

paduszyk avatar May 15 '24 10:05 paduszyk

For the commits hash, here's an example on how to do a special rule for commitizen (the example is with commit.author, but as you said, the hash is there). https://commitizen-tools.github.io/commitizen/customization/#custom-changelog-generator

For the github issue, does this not work? git commit -am "feat: my new feature #23" and when commitizen generates the changelog the link appears.

woile avatar May 15 '24 13:05 woile

Nope. Referring to PRs does not result in a link. It's even evidenced by the changelog for this repo.

paduszyk avatar May 15 '24 19:05 paduszyk

I like this feature and think this would be pretty useful, but I'm not sure whether it might incur additional to maintain the core commitizen 🤔 @woile @noirbizarre WDYT?

Lee-W avatar May 20 '24 20:05 Lee-W