[Spacewalk-devel] Commits should reference public bugzillas

Jan Pazdziora jpazdziora at redhat.com
Wed Apr 8 05:03:02 EDT 2009


if you like me in the past committed a fix to Spacewalk repo
referencing bugzilla which is not public, you might find the following
code useful. Just add it to .git/hooks/commit-msg and do
chmod a+x .git/hooks/commit-msg.

bugzilla_id=$( perl -lne 'if (/^(\d+) -/) { print $1 } exit' $1)
if [ -n "$bugzilla_id" ] ; then
	if GET "https://bugzilla.redhat.com/show_bug.cgi?id=$bugzilla_id&ctype=xml" | grep -q '<bug error="NotPermitted">' ; then
		echo "Bugzilla [$bugzilla_id] does not seem to be public. Aborting."
		exit 1

Jan Pazdziora
Senior Software Engineer, Satellite Engineering, Red Hat

More information about the Spacewalk-devel mailing list