[sysadmin-bin] Allow notes
- From: Andrea Veri <av src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Allow notes
- Date: Thu, 6 Feb 2014 15:27:20 +0000 (UTC)
commit 78fc6cb524546603d6e3e541aeb8d876dab1f1cb
Author: Ray Strode <rstrode redhat com>
Date: Fri Jul 20 14:40:07 2012 -0400
Allow notes
Notes give a way for a developer to "clear the error" on an
erroneous commit that has already been commited to version control.
Right now, we disallow all ref types that aren't branches or tags.
This commit enable notes ref types as well.
https://bugzilla.gnome.org/show_bug.cgi?id=680339
git/pre-receive-check-policy | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/git/pre-receive-check-policy b/git/pre-receive-check-policy
index c1a0ab0..c352295 100755
--- a/git/pre-receive-check-policy
+++ b/git/pre-receive-check-policy
@@ -266,6 +266,43 @@ check_ref_update() {
EOF
exit 1
;;
+ refs/notes/*)
+ # notes (addendums to existing commits)
+ notename=${refname#refs/notes/}
+
+ case $change_type in
+ create)
+ ;;
+ delete)
+ if [ "x$notename" = xcommits ] ; then
+ cat <<- EOF >&2
+ ---
+ You are trying to delete the note 'commits'.
+ ---
+ EOF
+ exit 1
+ fi
+ ;;
+ update)
+ if [ "`git merge-base $oldrev $newrev`" != $oldrev ] && ! forced ; then
+ # Non-fast-forward update. Right now we have
+ # receive.denyNonFastforwards in the git configs for
+ # our repositories anyways, but catching it here would
+ # allow overriding without having to change the config
+ # temporarily.
+ cat <<- EOF >&2
+ ---
+ You are trying to update the note '$notename' in a way that is not
+ a fast-forward update. Please see:
+
+ http://live.gnome.org/Git/Help/NonFastForward
+ ---
+ EOF
+ exit 1
+ fi
+ ;;
+ esac
+ ;;
*)
# Something else
cat <<- EOF >&2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]