-
Notifications
You must be signed in to change notification settings - Fork 43
Passing -a or --commit-all parameter doesn't commit all files #217
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
Comments
Has been broken since at least 12.0.0 |
Repo seems a little bit inactive. Dropping a very friendly I think this should fix it if @viljuska 's solution is correct. |
Hi, I'm travelling at the moment, apologies for the slow response. PR looks fine to me |
Double checking the documentation it looks to me like it's not supposed to commit all files - it's supposed to commit whatever was staged. Are you saying we should change this? |
@TimothyJones Yknow, giving a little bit back :D In regards to your question - going by the documentation you're right. Perhaps having a separate option to not only commit what was staged but just everything in general could be considered? Though in that situation one may as well just stage everything first and then commit it all with existing tools. |
Ah, makes sense. I think a commit all option would be convenient, but also might be a bit of a footgun (since the existing behaviour of committing only what was explicitly staged would prevent people from accidentally including things they didn't mean to). Perhaps an option that commits everything (but with a warning documented about using it) could be added? |
Though that would likely introduce a breaking change as "commit all" would become "commit all staged" (as it is right now) and then a true "commit all" would be added. I'll try to find the time to adjust my existing PR. |
I don't think that's a breaking change - "commit all" has always been "commit all staged", we'd just be adding "stage and commit all" (as a new parameter) |
Describe the bug
There is an option to commit all tracked files on git by passing parameter -a or --commit-all, but it doesn't work. While inspecting the code, I noticed that in commit.js file when option commitAll is true, it passes empty string while it should either add dot (.) or -A to git commit.
Current behavior
It doesn't commit all files when passing option -a/--commit-all
Expected behavior
It should commit all files when passing option -a/--commit-all
Environment
commit-and-tag-version
version(s): 12.5.0Possible Solution
I tried changing this line to add a dot (.) and it commited all files then:
await runExecFile(
args,
'git',
['commit'].concat(verify, sign, signoff, args.commitAll ? ['.'] : toAdd, [
'-m',
${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}
,]),
);
The text was updated successfully, but these errors were encountered: