-
Notifications
You must be signed in to change notification settings - Fork 0
Variator (with example)
It is used to make the workflow smooth by enabling user to store the most used commit message definitions on per-project basis.
👉 C l i c k H E R E f o r m o r e i n f o 👈
If you haven't yet, it is recommended to have a look at the "Simple Example" below first, to get the context...
| Command | Description |
|---|---|
cg var |
List all defined variators |
cg var set <variator_id> "<value>" |
Define a new variator |
cg var clear <id> |
Remove specific variator(s) |
cg var clear all |
Remove all variators |
cg var clear 1,2 |
To remove variators with id 1 and 2
|
cg var + help or -h or --help
|
To show help |
e.g. cg var set tpaw "(Top Picks - Auto Wrap)" or cg var set nftpaw "@.feat(Top Picks - Auto Wrap)"
Use (!id) or (!variator_id) in commit messages:
-
@.feat(!tpaw): <message>→@.feat(Top Picks - Auto Wrap): <message> -
(!nftpaw): <message>→@.feat(Top Picks - Auto Wrap): <message>
- Numeric IDs are auto-assigned (1, 2, 3...)
- (!id) is different from ! at start (breaking change)USAGE:
Note
- This example is based on the real-life use.
- Exactly as I used the variator for the first time in this repo, with step-by-step description
Flow:
-
I just finished the variator implementation, and its testing, including edge-case scenarios.
-
Let's variate then!
-
CLI:
cg varNo variators defined. Use 'cg var set <id> "<value>"' to create one.Okay! Let's add one...
-
I have several files that are ready to be commited, and I know that...
- I want to use
@.featchangelog modifier to group and announce the brand new ComfyGit feature - I want the header to be "V A R I A T O R !", so I'll be adding
(Specific)to modifier in the following format:(V A R I A T O R !) - Hence, I know that my commit message definition part will be
@.feat(V A R I A T O R !):, and it will repeat itself quite a lot. - Let's do it...
- I want to use
-
CLI:
cg var v "@.feat(V A R I A T O R !)"- I used just a simple
vas the variator caller (variator_id), so the variator should listen to (!v) command - Variator is always invoked with
(!<id|variator_id>)
- I used just a simple
-
CLI:
cg var, just to confirm...=== Variators === ID Variator_ID Value ------------------------------------------------------------ 1 v @.feat(V A R I A T O R !)Here we go!
-
Now I can start all my variator-related commit messages with
(!v):, let's see how it goes... -
Adding...
- 08ec87a -
(!v): streamline default initialization in ProjectEditDialog and ProjectWizard to enhance test reliability - 29a7e72 -
(!v): refactor changelog document building to utilize variator storage and streamline default initialization in tests - 642cd56 -
(!v): add chl_vrtr module for enhanced functionality integration - 06daeaf -
(!v): ensure default values are set for RepoConfig in test cases - 9a3dbe2 -
(!v): add variator_storage field to ProjectConfig with default initialization - 72bb355 -
(!v): add variator command support for listing, setting, and clearing variators - 3a57e15 -
(!v): enhance changelog generation by integrating variator storage into parsing and document building functions - a6b5392 -
(!v): integrate variator storage into release notes generation for enhanced commit message management - 66f785d -
(!v): introduce variator storage for managing commit message configurations with auto-assigned IDs
Let's check the changelog to see if it got parsed correctly...
- 08ec87a -
-
CLI:
cg-->ENTER-->[SELECT PROJECT]-->C(already looks good in preview) -->[SAVE]--> 👣 to repo root --> checkchangelog_temp.md--> 👇
-
introduce variator storage for managing commit message configurations with auto-assigned IDs 66f785d
-
integrate variator storage into release notes generation for enhanced commit message management a6b5392
-
enhance changelog generation by integrating variator storage into parsing and document building functions 3a57e15
-
add variator command support for listing, setting, and clearing variators 72bb355
-
add variator_storage field to ProjectConfig with default initialization 9a3dbe2
-
ensure default values are set for RepoConfig in test cases 06daeaf
-
add chl_vrtr module for enhanced functionality integration 642cd56
-
refactor changelog document building to utilize variator storage and streamline default initialization in tests 29a7e72
-
streamline default initialization in ProjectEditDialog and ProjectWizard to enhance test reliability 08ec87a
- Nice! 🎉