[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: restricting git commits to the debian subdirectory?



On Wednesday 23 June 2010 17:16:41 Eric Cooper wrote:
> I maintain both the upstream and Debian version of a program in a git
> repo, using "upstream" and "master" branches, git-buildpackage, etc.
> 
> Occasionally I forget which branch I'm on and commit upstream changes
> to the master branch by mistake.
> 
> Is there a way to tell git that when I'm on the master branch, I
> should only be allowed to commit files in the debian/ subdirectory?

I suggest a pre-commit hook that checks your branch, then possibly checks your 
diff, then possibly rejects the commit.

The example script checks all commits, but I think you should be able to 
determine what branch you are on with (git symbolic-ref HEAD).
-- 
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: