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

Re: Filenames with trailing newlines wreak havoc

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 26 Mar 2013 21:47:34 +0200

Ben Reser wrote on Tue, Mar 26, 2013 at 12:03:43 -0700:
> On Tue, Mar 26, 2013 at 9:29 AM, Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
> > Fair enough. Infra would be interested in a pre-commit hook script that
> > checks for control characters in filenames and aborts the transaction.
>
> Use validate-files.py in the trunk tools/hook-scripts with a conf file like so:
>

We've noted on IRC that this might fail if /foo and /foo\n get modified
in the same revision.

> [repositories]
> * = newlines
>
> # Running any rule against a file with a newline in it will fail
> because we break the svnlook output by newlines.
> # So the filename will appear as non-existent. Hook will fail with an
> error about the file not existing in the transaction and the commit
> will fail.
> # It's not pretty but it stops the problem.
> [rule:newlines]
> pattern = *
> command = 'exit 0'
Received on 2013-03-26 20:48:11 CET

This is an archived mail posted to the Subversion Dev mailing list.