You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, when a pre_commit hook is configured, our commit will fail. It would be helpful to have a way to pass something like --retry so we won't need to enter the message again.
Good point. Since this is a cli, we don't really have any place to store this commit over time. Would it be just the last 1 commit that you'd want cached?
Yeah, at first that would be the case. The use case would be to re-run it after fixing the tests or coverage. If you want to give me some direction and tell me how or where to store it I may give it a try and add that functionality myself. Something like @kentcdodds wrote on his article.
I'd love this feature. Having to fill out the prompts again because of a long error is super annoying. I'd want it to show me the message before it commits though.
Where can we store this info? A text file cache in the repo? We'd need to add it to .gitignore but at least then the cash would go with the repo if it gets moved.
Gave it a bit more thought. We can do this simply by have a filesystem based cache in the user's home directory.
The cache keys will be a paths to repo roots, the value will be a serialized command that was going to be executed. I will work on this soon. I think we can offer it w/o a breaking change or .gitignore changes. Sure if you move a folder around you'll lose the ability to use the retry command between moves, but that probably an ok tradeoff.
This will be released as an undocumented feature in 2.7.0. I will add tests and docs in 2.7.1 but wanted to see if you folks could test it. You can use it but running git cz --retry.
Ok, looks like it was me just being dumb and forgetting that Object.assign isn't available in node 0.12. Using lodash's alternative for now. This fix is released as 2.7.1. Would appreciate any feedback!
One thing to note. If using from a npm script defined on package.json. The syntax required double --, as npm requires -- for passing args to npm run and the --retry being the argument itself:
npm run commit -- --retry
commit only being an alias to git-cz on node-modules/bin
Activity
jimthedev commentedon Feb 8, 2016
Good point. Since this is a cli, we don't really have any place to store this commit over time. Would it be just the last 1 commit that you'd want cached?
lricoy commentedon Feb 10, 2016
Yeah, at first that would be the case. The use case would be to re-run it after fixing the tests or coverage. If you want to give me some direction and tell me how or where to store it I may give it a try and add that functionality myself. Something like @kentcdodds wrote on his article.
kentcdodds commentedon Feb 10, 2016
I'd love this feature. Having to fill out the prompts again because of a long error is super annoying. I'd want it to show me the message before it commits though.
jimthedev commentedon Feb 10, 2016
Where can we store this info? A text file cache in the repo? We'd need to add it to .gitignore but at least then the cash would go with the repo if it gets moved.
kentcdodds commentedon Feb 10, 2016
Yeah, put it in the repo and document the need to gitignore it
jimthedev commentedon Mar 10, 2016
Gave it a bit more thought. We can do this simply by have a filesystem based cache in the user's home directory.
The cache keys will be a paths to repo roots, the value will be a serialized command that was going to be executed. I will work on this soon. I think we can offer it w/o a breaking change or .gitignore changes. Sure if you move a folder around you'll lose the ability to use the retry command between moves, but that probably an ok tradeoff.
kentcdodds commentedon Mar 10, 2016
What if you used the temp directory instead? That way you don't put more stuff in the already-too-full user home...
jimthedev commentedon Mar 10, 2016
I'm thinking of using home-or-tmp.
On Wed, Mar 9, 2016 at 8:19 PM Kent C. Dodds notifications@github.com
wrote:
jimthedev commentedon Mar 10, 2016
This will be released as an undocumented feature in 2.7.0. I will add tests and docs in 2.7.1 but wanted to see if you folks could test it. You can use it but running
git cz --retry.lricoy commentedon Mar 10, 2016
I will take a look right away.
jimthedev commentedon Mar 10, 2016
Looks like the node 0.12 build failed. @lricoy I'll have to look at it before 2.7.0 releases
fix(cache): use lodash assign for better node 0.12 support
jimthedev commentedon Mar 10, 2016
Ok, looks like it was me just being dumb and forgetting that Object.assign isn't available in node 0.12. Using lodash's alternative for now. This fix is released as 2.7.1. Would appreciate any feedback!
jimthedev commentedon Mar 10, 2016
This is in the docs as of f1c719f
lricoy commentedon Mar 11, 2016
It worked fine for me @jimthedev
jimthedev commentedon Mar 11, 2016
@lricoy Great. Thanks!
lricoy commentedon Mar 11, 2016
One thing to note. If using from a npm script defined on package.json. The syntax required double
--, as npm requires--for passing args tonpm runand the--retrybeing the argument itself:npm run commit -- --retrycommit only being an alias to git-cz on node-modules/bin
kentcdodds commentedon Mar 11, 2016
See also: https://github.com/bahmutov/npm-quick-run :-)
lricoy commentedon Mar 11, 2016
Cool @kentcdodds . Thanks for the tip 😄
docs(retry): Updated docs to include how to run --retry from a npm sc…
docs(retry): Updated docs to show ways to run --retry