In my team, we use gerrit for code review.
As you know, gerrit uses the magical 'refs/for/*'.
Since I do not want to type
git push origin HEAD:refs/for/*
every time I push to remote,
I tried to change my git repository's config like below.
git config remote.origin.push refs/heads/*:refs/for/*
Changing config works well in bash,
but it fails in my zsh with an error like below.
zsh: no matches found: refs/heads/*:refs/for/*
I think that using an asterisk in zsh is somewhat different with bash,
but I cannot know exactly what the problem is.
How can I solve this problem? or impossible in zsh?
Thanks in advance.
By default when bash fails to glob it puts the whole pattern into the arguments unchanged. When zsh fails to glob it does not run command at all which I find more convenient in most cases. Both shells can be configured, zsh has at least three other modes: do like bash, remove pattern from arguments and remove pattern from arguments unless there are no patterns with match. These behaviors are achieved by unsetting NOMATCH
or setting CSH_NULL_GLOB
or NULL_GLOB
respectively.
I would suggest keeping current behavior and using various escaping methods: 'refs/heads/*:refs/for/*'
(double quotes also work) or refs/heads/\*:refs/for/\*
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With