Solves #65 - Uses git-graph.toml to parse commits message format #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intro
This solves #65 , it is a proof of concept and I think needs some iteration. To test it, copy the sample below into the file
.git/git-graph.toml
(you can put whatever you want on format="whateveryouwant" following the rules oncargo run -- --help
section--format
)Questions
Can I recycle the file that is already being used here to get the model name, and add the "format" key-value pair to get the format by config file? If we want to use the same file to store all default custom settings permanently, we need to wrap inside an
Option
themodel
andformat
attributes for RepoSettings and CommitFormatToml, as you can see on the second commit. If we don't wrap these attributes inside anOption
, the program will crash if the config file has onlymodel="simple"
, or has onlyformat="blabla"
key-value pair.The rest is implementation details, should I move the new code that tries to parse the config file from
src/main.rs
tosrc/config.rs
? Is there a better way to not have so much nested matches? Every feedback is welcome.