Is it possible to run Gerrit's commit-msg script standalone, not as hook?
I have no Gerrit hook installed I have simple commit I would like to check the Change-id of the commit Is it possible to get the change id by running some command, for example ./commit-msg xyz ? I don't want to use Eclipse. I don't want to configure hook.
The commit-msg script assumes to be run as Git hook (see example file). Therefore, it makes couple of assumptions. Executing it stand-alone (you just could have tried that, right?) fails with sed: : No such file or directory Thus, no, you cannot run this standalone. You might be able to fix it to work when called manually, but I'm unsure about your motivation. You sound like you don't want to install anything, but git-review is a nice helper.
You don't need to manually install the commit-msg hook in every repository you clone. You can configure Git to do this job for you automatically. When you execute the clone command Git copies a repository template located at: Linux = /usr/share/git-core/templates Windows = C:/Program Files (x86)/Git/share/git-core/templates If you add the commit-msg hook to the template it will be installed automatically for every cloned repository. However, the best thing to do is the following: Create a personal template (e.g. $HOME/.git-templates) Install the commit-msg in $HOME/.git-templates/hooks Configure Git to use your personal template: git config --global init.templatedir $HOME/.git-templates
Shibboleth protected Gerrit installation
gerrit hooks - automatically push upstream for review
How to specify ID when use set-reviewers
Redirect loop when connecting to Gerrit
Customize gerrit home page:logo and color
Gerrit mistakenly deleted tables Any solution?
What's the role of Change-Id in commit message
Unpublish gerrit change
how to cherry pick a patch with all its dependencies?
Purge Abandoned Change-Ids from Gerrit for good
Gerrit behaviour to find change-id in last paragraph
Gerrit Code review tool
finding out Gerrit server version when having URL
Creating folders in gerrit base path?
How to get patchset “Author” out of Gerrit?
Gerrit code/peer review data extraction