Task #4202 (closed)
Opened 9 years ago
Closed 9 years ago
[SCM] Write hook to prevent write to master, etc
| Reported by: | jamoore | Owned by: | jamoore |
|---|---|---|---|
| Priority: | minor | Milestone: | OMERO-Beta4.3 |
| Component: | Trac | Version: | n.a. |
| Keywords: | n.a. | Cc: | cxallan |
| Resources: | n.a. | Referenced By: | n.a. |
| References: | n.a. | Remaining Time: | 0.0d |
| Sprint: | 2011-02-10 (5) |
Description
To enforce our policies about writing to the "release" branches, there should be a post-receive hook.
Change History (4)
comment:1 Changed 9 years ago by jmoore
- Status changed from new to accepted
comment:2 Changed 9 years ago by jmoore
- Status changed from accepted to new
comment:3 Changed 9 years ago by jmoore
- Cc cxallan added
- Component changed from General to Trac
- Status changed from new to assigned
comment:4 Changed 9 years ago by jmoore
- Remaining Time changed from 0.25 to 0
- Resolution set to fixed
- Status changed from assigned to closed
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
Added the following to the bottom of the default update hook:
deny_user(){ if test \! \( "$USER" = "jmoore" -o "$USER" = "cxallan" \); then echo "" echo "********************************************" echo "Modification not allowed to $refname by $USER" echo "Instead, use branch: $1" echo "********************************************" echo "" exit 1 fi } case "$refname" in refs/heads/master) deny_user develop;; refs/heads/4_2) deny_user dev_4_2;; refs/heads/4_1) deny_user dev_4_1;; esacthe names can of course be changed, but for the moment, this should hopefully prevent any accidental commits.