Closed MichaelCurrin closed 3 years ago
Consider a threshold - maybe 4 files or less lists the names otherwise breaks out as counts
Or maybe check the length of the generated message and then fallback to generating the count one.
Any idea when this will be available?
I haven't though about this one for a while. I can find time this weekend.
If I make PR, would you be able to review it and/or try it out locally before the next release?
Sure will do!
I have some work in progress on draft linked PR. So far handles exactly one file so not useful yet LOL. But following TDD with tests firsts and one file is the easiest to start with.
I'll update here when it's ready for review
@glassesUSA i made some good progress. I have a function that can generate
create 1 file, update 2 files and delete 1 file
I have two areas I'd like your input on. See if you agree and if there are any scenarios or behaviors that you want to suggest.
How about the prefix before the message should always be feat
if you add or update a file?
And if you only move or rename, it is refactor.
If you only delete files, then it is chore.
BTW I have an idea to implement pressing the button twice to go from feat to fix in a follow up. #50
I was wondering when it makes sense to apply the create x files bit.
I'm thinking:
create foo.js, bar.txt, fizz.js and buzz.js
create 1 file and delete 2 files
. This replaces the old "Various changes to x, y and z" message. create 5 files
or delete 5 files
. The more than 4 is easy to do initially. I'm thinking later generate the named files and if the message is more than 50 characters then regenerate a message using counts. #49
Sounds good to me!
@glassesUSA I've put through 2 PRs and have the code working well installed in my IDE
I'm not doing a release yet so that I have time to use it some more, but you can try it out by cloning the repo and running the following:
make install
make ext # build and install extension
For the second PR that was merged.
Please see the test cases for these functions for high-level message handling. See if you think I covered a good mix of cases.
_msgNamed,
_msgCount,
_msgFromChanges,
The _msgFromChanges
function uses a constant set at 5
and will use _msgCount
for 5 or more files.
https://github.com/MichaelCurrin/auto-commit-msg/blob/master/src/test/prepareCommitMsg.test.ts
In the first PR that was merged, I set up count.ts
module. There are a bunch of low-level tests for countMsg
here.
See https://github.com/MichaelCurrin/auto-commit-msg/blob/master/src/test/generate/count.test.ts
The countMsg
function is used internally by _msgCount
, so you'll see some overlap.
I've linked some follow-up issues here, in particular to add conv commit support.
This came in useful today
I didn't see a response but I have been using this code the last week and it works fine for me. So am making a new release and closing this issue.
Apologies was running a different repo that required a specific naming convention for requests so didn't have time to test. Glad it seems to be working!
Please see release with downloadable file
https://github.com/MichaelCurrin/auto-commit-msg/releases/tag/v0.20.0
e.g.
update 3 files in foo
update 16 files and delete 2 files
Relates to #13