-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-cliff-core: allow adding arbitrary values to commits #803
Comments
I just thought about the simplest solution to my issue: the Commit struct adds a Of course it's not a generic solution 👍 |
Hello Marco 👋🏼
Would that work? Is serde serializing keys as separate fields? Btw can you take a look at #784 which does something similar (adds a new field called
There is a stale PR #688 which greatly simplifies that module. |
This feels like a bit of a workaround and is specific to Maybe we should deprecate individual remote-related fields and instead support |
Sounds good to me as long as the remote field is not behind a feature flag that pulls other dependencies 👍 Should I create a pr that adds this field? |
Yup, please go ahead. |
Is there an existing issue or pull request for this?
Feature description
First of all thank you for the amazing crate and the hard work you put into it 🙏
I would like to attach a
remote
context to the commit, so that people can writecommit.remote.username
in release-plz changelog (which is similar tocommit.github.username
git-cliff equivalent.Even though I can't have
commit.remote
I tried enabling the"github"
feature and my Cargo.lock exploded because of many dependencies to retrieve remote info I'm not using (because I'm retrieving remote info by myself). So I would like to have a "lighter" way to add arbitrary fields to thecommit
object.So a very similar mechanism to #613 but limited to the
commit
object.Desired solution
The
Commit
struct could have a Map of <String, Json> (this is psudo-code). In my example, "String" isremote
and Json is{ author }
.Library users should be able to add any fields they like to it.
Alternatives considered
The alternative is rely entirely on git-cliff for commits remote info retrieval.
My issue is that I generate multiple changelogs that share some commits, so we would hit GitHub API multiple times for the same commits for no reason.
We could solve this by implementing #468 but I'm not sure if it's easier than this issue.
Also, with this approach, the following problems remain:
commit.remote
instead ofcommit.github
,commit.gitea
, etc. (unless you change my mind thatcommit.github
is a better idea 👀)Additional context
PR where I experimented: MarcoIeni/release-plz#1630
Also, I'm curious, why you have
commit.github
,commit.gitea
, etc instead of a unified solution (e.g.commit.remote
)?The text was updated successfully, but these errors were encountered: