-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Question/help for understanding where the commit attributes come from to use on the handlebars templates #91
Comments
The first thing you should keep in mind is that there are 2 different commit formats we are talking about, says conventional commits and gitmoji commits. Conventional commits have their grammar like this (ref)
while gitmoji commits have their one like this (ref)
As you can see, Notice that I use "should" here. The reason why it is not available is because at the time I wrote this plugin there was no such concept, says scope, in gitmoji and no one ever asked for it since then (almost 6 years ago). lol
No why, scopes in conventional commits are independent from scopes in gitmoji commits. They are both similar concepts but different specs/implementations.
Yes, but not in the current version but the future ones.
Follow the commit format above. For example, make a commit with the following message in convention commit format:
|
Frankly speaking, it was also a headache for me to trace codes that were written 6 years ago, though I'm the author. lol As you already know, to improve user experience, there are some enhancements required to make this plugin better. I'll think about refactoring the project recently to make it more extendable and customizable. |
@momocow Thanks for helping and explaining, I think this is a very useful tool and worth it the refactor/enhancements of those little details, I was asking this also because I wonder if maybe I needed more variables that are not available by default in the context, like how I would still have a way to include them, so far I did this just as a test and it worked (environment variable) in the
and then I would use it in here for example:
Also I am not sure how to easily pass variables to the Handlebars templates or the already defined context, this is what I did to be able to have or bring that "repoName" variable to the template as an example/test, created a
An AI was recommending this other way to include my own variables into the Handlerbars template/context (ofcourse this did not work):
do you know how could that be done in todays app state? |
Hey @momocow thanks for your help recently, I have been trying to understand a lot of the "how it works" of all the ecosystem but it is a lot, just understanding handlerbars "logicless" syntax has been a challenge, there is something that is what is the most hard thing to understand so far and it is the "context" where do this commits and its attributes come from (ofcourse git but let me explain further)? Can not find were is that defined, I was using before your tool, this other tool with the
semantic-release/commit-analyzer
and alsosemantic-release/release-notes-generator
, then I used a "preset" for theconventional-changelog
called "conventional-changelog-conventionalcommits", and this preset also has some "options" or "configuration that you can do" specified heremy confussion comes when you see they have all those "substitutions" or "attributes" that they can use like for example
{{commit.scope}}
in this file for example: https://github.com/conventional-changelog/conventional-changelog/blob/7ac186060b16ea66847c401d57ca78157329d778/packages/conventional-changelog-conventionalcommits/templates/template.hbs#L9
but then when I try to use that attribute
{{commit.scope}}
in the commit-template that we use here atsemantic-release-gitmoji
, it is not available, that is were I wonder why and how they have that attribute available? What is the config I am missing to be able to have those attributes, if you could clarify were is that config setup and if it is possible to configure that in the context I would really appreciate, that has been the most struggling point for me to understand what can I configure and what I cannot (ofcourse, it is not here in gitmoji because it is not configured to be in the context, but would it be possible to have it? If so how? And were in that project that it is available it was configured to be available?).I tried using it here in the template like so (but I think it is not available):
but that is what I want to understand why is it available over here: https://github.com/conventional-changelog/conventional-changelog/blob/7ac186060b16ea66847c401d57ca78157329d778/packages/conventional-changelog-conventionalcommits/templates/template.hbs#L9 were did they configure it to be in the "context"?
The text was updated successfully, but these errors were encountered: