[OpenStack-Infra] gerrit idempotent ids on revert?
Jeremy Stanley
fungi at yuggoth.org
Fri Jan 31 16:29:30 UTC 2014
On 2014-01-31 14:10:04 +0100 (+0100), Monty Taylor wrote:
> On 01/31/2014 01:44 PM, Sean Dague wrote:
> > Question: is there any way to get gerrit to generate the
> > idempotent ids on a revert through the web ui?
> >
> > Because today it does not. So if you want to amend the commit
> > message it means you end up pushing a second change.
>
> I believe there may be a way to do this - fungi and I talked a
> little while ago about doing something with different hooks. But I
> think we stopped thinking about it.
The issue runs deeper than that, unfortunately...
https://launchpad.net/bugs/1200215
Git itself does not run commit hooks when editing commit messages
*unless* as a result of the git commit command itself. Other git
operations which generate a commit message (and when in interactive
mode throw you into an editor session) such as revert, cherry-pick,
merge and so on do not and have no equivalent hook type either. I
did investigate modifying the commit message template instead to
solve this, but unfortunately all of the template text starts out
commented and would have to be manually uncommented. Read through
'man 5 githooks' for additional enlightenment--when it says
something is called by "git commit" it really means *just that*.
I agree it would be nice if Gerrit were to at least do something to
address this internally in their own tooling when it comes to a
button in a WebUI though....
http://code.google.com/p/gerrit/issues/detail?id=843
Here are some more interesting related discussions which eventually
lead nowhere but help illustrate that the situation is not as simple
as you might think...
http://git.661346.n2.nabble.com/git-revert-doesn-t-run-commit-msg-hook-td7559622.html
http://git.661346.n2.nabble.com/cherry-pick-pre-commit-hook-td5815961.html
--
Jeremy Stanley
More information about the OpenStack-Infra
mailing list