pre-commit-hook

Escaping a backslash in Batch File using FINDSTR

In my svn Pre commit hooks I use findstr to block certain file types beign committed. I now want to extend this to directories, in the first instance \obj\ directories however I am having problems with the Regular expression and escaping the \ of the dir Currently I have "C:\Program Files\VisualSVN Server\bin\svnlook.exe" changed -t ...

Subversion Tagging and Security

I have set up an SVN repository from scratch, and I have successfully tagged some of my releases using the SVN copy command. I used the SSPI auth plugin for apache, so our developers just hit the server with their network credentials, and everything works nicely. I have created an AuthZ authorization file, added our developers to group...

How do I create a SVN Commit Message Template and Hook to Verify

I'm using Visual SVN Server and Tortoise SVN (client) for source control. I would like all developers to standardize on a consistent format for checkin notes. For Example I want their Commit Message to default to... Synopsis: Developer Name: (pre-populated) Reviewed By: [Bug Id]: [Change Bug State]: Known Issues: Affected Files:...

How can i get access to the SVN pre-commit message using SharpSVN?

i see that all I can set to is %repos% and %txn% how can I use those to get to the commit message (in my case, so i can parse out the ticket number so i can see if it exists in the bug database before committing to it) ...

Subversion: how to remove property on commit

My situation is this: I have a Subversion server set up at my home, and we also use Subversion at the company where I work. At work, we use the lock/edit/unlock model (mainly because we are transitioning from Visual SourceSafe and it's easier for the moment). At the moment this is achieved by setting the 'needs-lock' property on all ad...

How can I access the commited file from a Subversion pre-commit hook in Perl?

I need to do the following: Write pre-commit hook in Perl Hook should check all files being committed for presence of some text, and fail if that text is not found Basically, I need an example of Perl hook that reads files being committed. I am really looking for some elegant solution with the least amount of code. Notes: Hook sho...

SVN pre-commit script to check for mkdir

I wrote the following pre-commit script for SVN to validate that a user has submitted the minimum amount of information on a file commit. However, when trying to add/delete a directory, now it is failing. I know why it's failing obviously, I just didn't realize the pre-commit script was called on every action. How do I filter for the act...

Pre Commit Hook for JSLint in Mercurial and Git

I want to run JSLint before a commit into either a Mercurial or Git repo is done. I want this as an automatic step that is set up instead of relying on the developer (mainly me) remembering to run JSLint before-hand. I normally run JSLint while developing, but want to specify a contract on JS files that they pass JSLint before being com...

Use the commit message in a CVS pre-commit hook

Is it possible to use the commit message in a pre-commit hook in CVS? The CVS server is running remotely, and I access it using pserver. Ideally, I want to allow the commit if the files pass the filter or the commit message contains certain text. I don't have a choice to use another versioning system. ...

How to set a trigger to prevent commits to SVN with mergeinfo property?

I'd like to avoid creating svn mergeinfo property on anything but the root of branches. We have a trunk branch and some other branches. Assuming I know absolutely nothing about svn triggers, what steps do I need to follow to setup a pre-commit hook that prevents additions of mergeinfo properties to anything but the root of branches? Th...

How to implement SVN pre-commit hook with best performance?

We have the following tools in place: Subversion (Version 1.5.9) Polarion (version 3.2.2) Polarion is based on Subversion, so on every action that changes anything (which is often the case), Polarion will use a Subversion commit to change anything. All things are currently stored in one and only one repository, so every commit of eve...

How to access file information in a pre-commit hook using SharpSVN

Hi Everyone, I am new to SharpSVN and SVN in general. I am trying to implement a pre-commit hook that when the user commits a certain type of XML file; I am going to need to intercept the file and analyze it to ensure they included certain elements before I allow the file to be committed. Since it seems that SVN submits two arguments; ...

Subversion hook for setting properties

Please, help me with hook script on server which set svn:mime-type to application/octet-stream on all new and existing files automatically on each commit from working copy to repository. (I need it to prevent subversion auto merge files on conflict.) My platform is Windows. ...

Automatically add svn keyword properties for new files (server-side)

I want to add svn properties (like svn:keyword=Id Date Rev Author;) to files on commits on new files. For this to work there may be two main options: client-side, altering the autoprops in the svn client configuration Server-sode, do some magic with commit-hooks The client side is not always desirable, as control over the client se...

SVN pre-commit hook to reject Python files with inconsistent tab usage

The Python interpreter can be started with -tt to raise a TabError exception if the interpreted file has inconsistent tab usage. I'm trying to write a pre-commit hook for SVN that rejects files that raise this exception. I can pass the file being committed to python -tt but my problem is that the file is also executed, besides being che...

Git pre-commit hook : changed/added files

I am writing a pre-commit hook. I want to run php -l against all files with .php extension. However I am stuck. I need to obtain a list of new/changed files that are staged. deleted files should be excluded. I have tried using git diff and git ls-files, but I think I need a hand here. ...

How do you access the commit message in a Mercurial in-process hook?

I've been trying def debug_hook(ui, repo, **kwargs): changectx = repo[None] ui.status('change.desc: %s\n' % changectx.description()) return True But it always prints an empty string. Is this because it is a precommit hook and the message isn't available yet? Or am I just missing something obvious? ...

svnlook always returns an error and no output

I'm running this small C# test program launched from a pre-commit batch file private static int Test(string[] args) { var processStartInfo = new ProcessStartInfo { FileName = "svnlook.exe", UseShellExecute = false, ErrorDialog = false, CreateNoWindow = true, RedirectStandardOutput = true, ...

Add comment to subversion commit automatically

I've already got my subversion repository set up to require comments of a minimum length to accept a commit. However, I'd like to start tagging those comments with information from our bug tracking system when committed. I've already got the scripts set up to pull data from the bug tracker and just need a way to get that info into the su...

CSSTidy, HTMLTidy, JSlint pre-commit hooks(Hg) - automation tools

I am looking for a way to test/validate my html, css, js before they are committed to a repository. Is there any way to automate this process. Ideally, I would like to have the ability to exclude certain files (js libraries for example). ...