[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Warn if files match list of extensions

From: Bob Archer <bob.archer_at_amsi.com>
Date: Fri, 28 Aug 2009 09:48:39 -0400

> A rather frequent problem I have encountered is that users accidentally
> add exe and dll files to the repository. I have cut down on this quite
> a bit by setting up svn:ignore properties for directories such as bin
> and obj, but it still happens rather often.
>
> There are times when this is necessary, so I don't want to definitively
> block committing files with those extensions.
>
> It seems to me that any server side repository hook would only be
> effective in *blocking* commits. I don't see how a warning can be
> issued through a repository hook.

When your hook fails you can return an error message. That message will be displayed to the client. There are lots of discussion about this on the svn mail list. Since this is really a server side issue you may want to ask for assistance there. However, I think some of the sample scripts include how to do this.

> However, I noticed that with the bugtraq properties configured, TSVN
> gives a nice warning if a commit message does not reference a ticket.
> This is exactly the type of warning message that I would like! But I
> would like the message to be displayed when a file matches a list of
> extensions.
>
> For example, the property might be:
>
> tsvn:warniffileextension = exe, dll
>
> The warning box would say:
>
> "You are trying to commit a file with extension %s. Are you sure you
> want to commit this file?"
>
> Is that a possible enhancement?

Of course, this would only work if you users ONLY used TSVN. The hook script will work even if they use the command line svn or subclipse or Ankha.

You might also want to look at adding .exe and .dll as global includes. Unfortunately this is a client side setting. But, you could have your pre-commit hook include in the message a suggestion to your user to do that.

Of course, if you add these ignores to all the folders in your project there is a very small chance of them being added.

BOb

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2388264

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-08-28 15:48:53 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.