Re: Automatically exclude hunks from the commit
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Jul 20, 2010, 05:36 UTC
- Message-ID
- <51F8E66E-9CDD-466A-8411-38CA8431D8AC@wincent.com>
- In-Reply-To
- <4C4511C8.8090405@workspacewhiz.com>
El 20/07/2010, a las 05:02, Joshua Jensen escribió:
> I have some files I update frequently where I have some normally commented out debug code purposely uncommented during development. Git's hunk-level staging saves the day. I can stage everything but the debug code without issue. > > This got me to thinking. Is there a better way? Is there a facility in Git where I could mark a hunk as 'permanently frozen unstaged'? Anything marked as such would never be staged for commit. I could rest assured I would never accidentally commit my debug code, be it extra printfs or a development server or a password or so on.
A custom pre-commit hook might be of some use here. You could create one which rejects changes which are obviously debug code.
Cheers, Wincent