Can I set push-options (git push -o “…”) in git config?

两盒软妹~` 提交于 2019-12-06 06:02:32

What if you just define some aliases to do that?

Ex:

alias gp-doe='git push -o "r=joh.doe"'

You can use Git Aliases too.

This option is not configurable.

You can add the reviewer by Gerrit's CLI ssh -p 29418 $USER@$gerrithost gerrit set-reviewers $CHANGE -a $reviewer -p $project in Gerrit's hook patchset-created. The REST API POST /changes/{change-id}/reviewers can also do the job.

$reviewer can be a user or a group which contains one or more users.

This has become configurable in Git 2.16 (quoting release notes).

The "--push-option=" option to "git push" now defaults to a list of strings configured via push.pushOption variable.

So, when applied to Gerrit as for my use case, this should work to add reviewer to john.doe and publish draft comments on push time by default.

git config --add push.pushOption r=john.doe
git config --add push.pushOption publish-comments
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!