You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Bob Proulx <bo...@proulx.com> on 2009/03/09 23:12:43 UTC

EOL Check Hook Script?

Does anyone have a hook script that they have already written that
will check that the eol convention hasn't changed with a commit and
will reject it if it has changed?

On a project I am working on in a mixed environment everyone has
agreed that setting the right eol convention in their editor is easily
done.  But it is also easily forgotten too.  If we had a hook script
to check for this case then it could prevent commit accidents.  I am
aware of setting eol-style to native but since the working copy files
are different than the target files (e.g. md5sums, tarballs, etc.) I
would rather avoid doing it that way if possible.

Thanks,
Bob

Re: EOL Check Hook Script?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 12, 2009, at 02:31, Bob Proulx wrote:

> Ryan Schmidt wrote:
>> I didn't understand your reason for not wanting to use the existing
>> eol enforcement technology that Subversion already has (setting
>> svn:eol-style).
>
> One reason is that then I would need to have these other folks working
> on the project to set up their auto-props.  That is about as much
> trouble for me to get them to do as it is for me to get them to set up
> their editors with eol conventions.  If I could do one successfully
> then I would be able to do the other instead.  I would just set up
> their editors to be newline only and be done with it.
>
>> I would suggest that you set svn:eol-style to whatever value you like
>> best (be that native or LF or CRLF) on all files that need eol
>> enforcement. On each client, you set up auto-props to automatically
>> set that property on those types of files, by filename extension. And
>> in the server's pre-commit hook, you check that all committed files
>> with whatever filename extensions do have the property set, and if
>> not, exit and tell the user to set the property.
>
> Yes, I am well aware of that process.  But I was hoping to avoid it.
> I think I would rather do it differently.

By all means. :) Nothing prevents you from writing a pre-commit hook  
to enforce line ending style or any other aspect of your files. You  
could use "svnlook changed" to get a list of changed files. Then for  
each file whose name has a particular extension that you know to be a  
text file, you can use "svnlook cat" to get the contents of the file.  
You can analyze it with grep or some other tool to see if it contains  
only the line endings you want.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1313704

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: EOL Check Hook Script?

Posted by Jan Hendrik <li...@gmail.com>.
Concerning Re: EOL Check Hook Script?
David Weintraub wrote on 23 Mar 2009, 16:01, at least in part:

> On Mon, Mar 23, 2009 at 2:03 PM, Brad Stiles
> <br...@gmail.com> wrote: >> The problem is the fact that
> Windows insists on using "C:/Program >> Files" as a place where it
> puts all commands. > > What version of Windows is that?  I've been
> using it since 3.1, and > I've never seen Windows "insist" on any such
> thing.  "Default to" that > directory?  Yes.  But not insist.  All
> you have to do is change the > folder when running the install (or
> copy it somewhere else if you > forget, depending on the program).
>
> Okay,  you're correct that Windows doesn't insist. This can be changed
> via the registry, and I've done that because I hate the name. I would
> prefer C:/bin which shorter and doesn't have the space. Same with
> C:/Documents and Settings".
>
> However, Windows does not give you a choice when you install it on
> your PC where you're like to put programs, so changing it is
> difficult.  It requires I believe two or three registry entry changes
> and moving the already established C:/Program Files to a different
> directory. Hence, almost all Windows systems use C:/Program Files as
> the program directory.
>
> And yes, you can force the installation of many development programs
> to install into other directories, but again, if you look at the vast
> majority of developer installs, almost all programs sit in the
> C:/Program Files directory. Many people who should know better still
> do it because it does put all installed programs into a single
> directory instead of being scattered around their disk.

Admittedly it takes a little effort, yet without fiddling with the
registry one can achieve that to a high degree.  On all machines
here on C:\ there is just the OS, all applications go to a dedicated
separate partition (e.g. D:\), so everything is in one place and
"Program Files" can widely be ignored.  It is not complete, but
except for MSIE and Media Player and probably some other MS
stuff also shipping with the OS I know but one program which
quietly put everything into C:\ - even though it offered the choice of
a different location at install time (only that there just some sort of
pointer ended up while C:\ suddenly was out of place for the
program's 300MB database).

It's not perfect as still many installation routines drop some stuff
into the OS folders a/o Program Files on C:\, but from the issues
about dependency seeking on *nix systems I read know and then it
doesn't seem to be a perfect world either.

Documents & Settings can be moved from system
setup/environment btw, no registry tweaking needed.

Jan hendrik
---------------------------------------
Freedom quote:

     Those who won our independence by revolution were not cowards.
     They did not fear political change. They did not exalt order
     at the cost of liberty.
               -- Louis D. Brandeis (U.S. Supreme Court Justice, 1856-1941)
                  Whitney vs. California, 1927

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1392714

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: EOL Check Hook Script?

Posted by David Weintraub <qa...@gmail.com>.
On Mon, Mar 23, 2009 at 2:03 PM, Brad Stiles <br...@gmail.com> wrote:
>> The problem is the fact that Windows insists on using "C:/Program
>> Files" as a place where it puts all commands.
>
> What version of Windows is that?  I've been using it since 3.1, and
> I've never seen Windows "insist" on any such thing.  "Default to" that
> directory?  Yes.  But not insist.  All you have to do is change the
> folder when running the install (or copy it somewhere else if you
> forget, depending on the program).

Okay,  you're correct that Windows doesn't insist. This can be changed
via the registry, and I've done that because I hate the name. I would
prefer C:/bin which shorter and doesn't have the space. Same with
C:/Documents and Settings".

However, Windows does not give you a choice when you install it on
your PC where you're like to put programs, so changing it is
difficult.  It requires I believe two or three registry entry changes
and moving the already established C:/Program Files to a different
directory. Hence, almost all Windows systems use C:/Program Files as
the program directory.

And yes, you can force the installation of many development programs
to install into other directories, but again, if you look at the vast
majority of developer installs, almost all programs sit in the
C:/Program Files directory. Many people who should know better still
do it because it does put all installed programs into a single
directory instead of being scattered around their disk.

--
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1392212

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: EOL Check Hook Script?

Posted by Brad Stiles <br...@gmail.com>.
> The problem is the fact that Windows insists on using "C:/Program
> Files" as a place where it puts all commands.

What version of Windows is that?  I've been using it since 3.1, and
I've never seen Windows "insist" on any such thing.  "Default to" that
directory?  Yes.  But not insist.  All you have to do is change the
folder when running the install (or copy it somewhere else if you
forget, depending on the program).

> The space in Program Files causes problems with many programs because most programs use

> pre-commit-access-control-hook -svnlook 'C:/Program Files/Subversion/svnlook'

I've had better luck using double quotation marks around file names
than single ones.


/bs

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1391251

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: EOL Check Hook Script?

Posted by Tsahi Asher <ts...@yahoo.com>.
thanks for the answer. i no longer work for the company where i needed the script, so i forwarded your answer to another employee there. i hope it works out for him.

tsahi

 --
The day Micro$oft sells something that doesn't SUCK
is the day they start selling vacuum cleaners.
http://www.geocities.com/tsahi_75



----- Original Message ----
> From: David Weintraub <qa...@gmail.com>
> To: Tsahi Asher <ts...@yahoo.com>
> Cc: users@subversion.tigris.org
> Sent: Monday, March 23, 2009 5:30:35 PM
> Subject: Re: EOL Check Hook Script?
> 
> The problem is the fact that Windows insists on using "C:/Program
> Files" as a place where it puts all commands. The space in Program
> Files causes problems with many programs because most programs use
> spaces for separating command line parameters. It is the bane of my
> existence on Windows systems. One of the joys that Vista brought is
> moving this to a C:
> 
> You must either change SVN_LOOK on line #39 or use:
> 
> pre-commit-access-control-hook -svnlook 'C:/Program Files/Subversion/svnlook'
> 
> when you call my hook script in the pre-commit.bat file (Note the
> single quotes around the entire path to the svnlook command).
> 
> Also try putting the the following lines around line #552 of my
> program and see what this does:
> 
> print  "DEBUG: Checking for author\n";
> chomp ($author = qx($svnlookCmd author $option $repository));
> print  "DEBUG: Author = $author\n";
> 
> (The "chomp" line is line #552)  This will give you an additional
> error message. If you get the following:
> 
> DEBUG: Checking for author
> 'C:/Program' is not recognized as an internal or external
> command,operable  program or batch file."
> 
> Then, I know it is this line that is causing problems. If you don't
> get that far, it is likely the problem is in the pre-commit.bat
> trigger script.
> 
> On Sun, Mar 22, 2009 at 10:40 AM, Tsahi Asher wrote:
> > alright, checking for
> >
> > if errorlevel 1...
> >
> > instead of
> >
> > if not errorlevel 0...
> >
> > detected an error, but i still get the
> >
> >
> > "'C:/Program' is not recognized as an internal or external command,operable
> > program or batch file."
> >
> > error.
> >
> > tsahi
> > --
> > The day Micro$oft sells something that doesn't SUCK
> > is the day they start selling vacuum cleaners.
> > http://www.geocities.com/tsahi_75
> >
> >
> >
> > ----- Original Message ----
> >> From: David Weintraub 
> >> To: Tsahi Asher 
> >> Cc: users@subversion.tigris.org
> >> Sent: Thursday, March 19, 2009 4:42:06 PM
> >> Subject: Re: EOL Check Hook Script?
> >>
> >> Yes it does. The STDERR contains a list of why the hook fails, so this
> >> is returned to the user.
> >>
> >> On Thu, Mar 19, 2009 at 10:35 AM, Tsahi Asher wrote:
> >> >
> >> > Thanks for the answer. I already have a pre-commit.bat file, which runs 
> pretty
> >> good so fare, except for detecting that property on replaced files.
> >> >
> >> > What about the second issue? Does your script exit with a non-zero exit 
> code
> >> when one of the rules is not met?
> >> >
> >> > Tsahi
> >> >
> >> >  --
> >> > The day Micro$oft sells something that doesn't SUCK
> >> > is the day they start selling vacuum cleaners.
> >> > http://www.geocities.com/tsahi_75
> >> >
> >> >
> >> >
> >> > ----- Original Message ----
> >> >> From: David Weintraub
> >> >> To: Tsahi Asher
> >> >> Cc: users@subversion.tigris.org
> >> >> Sent: Thursday, March 19, 2009 4:25:38 PM
> >> >> Subject: Re: EOL Check Hook Script?
> >> >>
> >> >> The problem is that I am not that familiar with Windows or the Batch
> >> >> programming language. I also don't have access to a Windows system in
> >> >> order to do some testing.
> >> >>
> >> >> However, when you create a Subversion repository, there's a file
> >> >> called pre-commit.bat.tmpl (or something like that) that's created.
> >> >> You can use this as a template on how to create the pre-commit.bat
> >> >> trigger file you need. That's what I did with the pre-commit shell
> >> >> script that was created.
> >> >>
> >> >> I can't even find the pre-commit.bat.tmpl file in the repository.
> >> >>
> >> >> On Sun, Mar 15, 2009 at 5:39 AM, Tsahi Asher wrote:
> >> >> >
> >> >> > this accidentally almost solved my problem too. i need to enforce
> >> >> svn:needs-lock on .resx files. trying to run this on windows, though, has
> >> some
> >> >> side effects.
> >> >> > 1. the -svnlook parameter may receive a value with spaces in it, e.g.
> >> >> "C:/Program Files (x86)/Subversion/bin/svnlook". the script seems to be
> >> unaware
> >> >> of this, and as a result, i get a
> >> >> >
> >> >> > "'C:/Program' is not recognized as an internal or external 
> command,operable
> >> >> program or batch file.
> >> >> > The system cannot find the path specified.
> >> >> > The system cannot find the path specified.
> >> >> >
> >> >> > error. the path to svnlook should be sorrounded with quotes or 
> something.
> >> >> >
> >> >> > 2. the example pre-commit file in the zip has this after the call to the
> >> >> script:
> >> >> >
> >> >> > exit $?
> >> >> >
> >> >> > what does it mean? i tried to replace it with
> >> >> >
> >> >> > if not errorlevel 0 exit /b 1
> >> >> >
> >> >> > but it didn't exit the hook script, and continued to run another script 
> the
> >> >> pre-commit hook runs. what is the exit code your script uses when there is 
> a
> >> >> rule violation?
> >> >> >
> >> >> >
> >> >> > i'd be happy if you could fix those problems.
> >> >> >
> >> >> > here's my entire pre-commit.bat, translated to windows syntax:
> >> >> >
> >> >> > set REPOS=%1
> >> >> > set TXN=%2
> >> >> >
> >> >> > set CWD=%REPOS%/hooks
> >> >> > set SVNLOOK="C:/Program Files (x86)/Subversion/bin/svnlook"
> >> >> >
> >> >> > set ACCESS_HOOK=%CWD%/pre-commit-access-control-hook.pl
> >> >> > set CONTROL_FILE=%CWD%/control-file.ini
> >> >> >
> >> >> > rem PRE-COMMIT HOOK
> >> >> >
> >> >> > C:\Perl\bin\perl %ACCESS_HOOK% -svnlook %SVNLOOK% -file %CONTROL_FILE% 
> -t
> >> >> %TXN% %REPOS%
> >> >> >
> >> >> > if not errorlevel 0 (
> >> >> >  echo Goto TortoiseSVN settings ^> Edit button, add the following line 
> to
> >> >> [auto-props]: >&2
> >> >> >  echo *.resx = svn:needs-lock >&2
> >> >> >  echo and make sure you set >&2
> >> >> >  echo enable-auto-props = yes >&2
> >> >> >  exit /b 1
> >> >> > )
> >> >> >
> >> >> > and then it calls some other script, which is run even if the
> >> >> pre-commit-acces-control-hook fails. i do get the error message, e.g.
> >> >> >
> >> >> >  ERROR: Commit failed for the following reasons:
> >> >> >  Property "svn:needs-lock" needed for file
> >> >> "Fantasy.NET/trunk/Fantasy.Presentation/AboutBoxForm.resx".
> >> >> >         Must match string '*'.
> >> >> >
> >> >> > but the commit doesn't stop.
> >> >> >
> >> >> > thanks,
> >> >> > tsahi
> >> >> >
> >> >> > --
> >> >> > The day Micro$oft sells something that doesn't SUCK
> >> >> > is the day they start selling vacuum cleaners.
> >> >> > http://www.geocities.com/tsahi_75
> >> >> >
> >> >> >
> >> >> >
> >> >> > ----- Original Message ----
> >> >> >> From: Bob Proulx
> >> >> >> To: users@subversion.tigris.org
> >> >> >> Sent: Friday, March 13, 2009 9:30:40 AM
> >> >> >> Subject: Re: EOL Check Hook Script?
> >> >> >>
> >> >> >> David Weintraub wrote:
> >> >> >> > ou can download the hook script here:
> >> >> >> >
> >> >> >>
> >> >> >> Cool stuff.  Thanks for sharing!
> >> >> >>
> >> >> >> Bob
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >> >
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> --
> >> >> David Weintraub
> >> >> qazwart@gmail.com
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> --
> >> David Weintraub
> >> qazwart@gmail.com
> >>
> >> ------------------------------------------------------
> >> 
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1355764
> >>
> >> To unsubscribe from this discussion, e-mail:
> >> [users-unsubscribe@subversion.tigris.org].
> >
> > ------------------------------------------------------
> > 
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1381410
> >
> > To unsubscribe from this discussion, e-mail: 
> [users-unsubscribe@subversion.tigris.org].
> >
> 
> 
> 
> -- 
> --
> David Weintraub
> qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1431721

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: EOL Check Hook Script?

Posted by David Weintraub <qa...@gmail.com>.
The problem is the fact that Windows insists on using "C:/Program
Files" as a place where it puts all commands. The space in Program
Files causes problems with many programs because most programs use
spaces for separating command line parameters. It is the bane of my
existence on Windows systems. One of the joys that Vista brought is
moving this to a C:

You must either change SVN_LOOK on line #39 or use:

pre-commit-access-control-hook -svnlook 'C:/Program Files/Subversion/svnlook'

when you call my hook script in the pre-commit.bat file (Note the
single quotes around the entire path to the svnlook command).

Also try putting the the following lines around line #552 of my
program and see what this does:

print  "DEBUG: Checking for author\n";
chomp ($author = qx($svnlookCmd author $option $repository));
print  "DEBUG: Author = $author\n";

(The "chomp" line is line #552)  This will give you an additional
error message. If you get the following:

DEBUG: Checking for author
'C:/Program' is not recognized as an internal or external
command,operable  program or batch file."

Then, I know it is this line that is causing problems. If you don't
get that far, it is likely the problem is in the pre-commit.bat
trigger script.

On Sun, Mar 22, 2009 at 10:40 AM, Tsahi Asher <ts...@yahoo.com> wrote:
> alright, checking for
>
> if errorlevel 1...
>
> instead of
>
> if not errorlevel 0...
>
> detected an error, but i still get the
>
>
> "'C:/Program' is not recognized as an internal or external command,operable
> program or batch file."
>
> error.
>
> tsahi
> --
> The day Micro$oft sells something that doesn't SUCK
> is the day they start selling vacuum cleaners.
> http://www.geocities.com/tsahi_75
>
>
>
> ----- Original Message ----
>> From: David Weintraub <qa...@gmail.com>
>> To: Tsahi Asher <ts...@yahoo.com>
>> Cc: users@subversion.tigris.org
>> Sent: Thursday, March 19, 2009 4:42:06 PM
>> Subject: Re: EOL Check Hook Script?
>>
>> Yes it does. The STDERR contains a list of why the hook fails, so this
>> is returned to the user.
>>
>> On Thu, Mar 19, 2009 at 10:35 AM, Tsahi Asher wrote:
>> >
>> > Thanks for the answer. I already have a pre-commit.bat file, which runs pretty
>> good so fare, except for detecting that property on replaced files.
>> >
>> > What about the second issue? Does your script exit with a non-zero exit code
>> when one of the rules is not met?
>> >
>> > Tsahi
>> >
>> >  --
>> > The day Micro$oft sells something that doesn't SUCK
>> > is the day they start selling vacuum cleaners.
>> > http://www.geocities.com/tsahi_75
>> >
>> >
>> >
>> > ----- Original Message ----
>> >> From: David Weintraub
>> >> To: Tsahi Asher
>> >> Cc: users@subversion.tigris.org
>> >> Sent: Thursday, March 19, 2009 4:25:38 PM
>> >> Subject: Re: EOL Check Hook Script?
>> >>
>> >> The problem is that I am not that familiar with Windows or the Batch
>> >> programming language. I also don't have access to a Windows system in
>> >> order to do some testing.
>> >>
>> >> However, when you create a Subversion repository, there's a file
>> >> called pre-commit.bat.tmpl (or something like that) that's created.
>> >> You can use this as a template on how to create the pre-commit.bat
>> >> trigger file you need. That's what I did with the pre-commit shell
>> >> script that was created.
>> >>
>> >> I can't even find the pre-commit.bat.tmpl file in the repository.
>> >>
>> >> On Sun, Mar 15, 2009 at 5:39 AM, Tsahi Asher wrote:
>> >> >
>> >> > this accidentally almost solved my problem too. i need to enforce
>> >> svn:needs-lock on .resx files. trying to run this on windows, though, has
>> some
>> >> side effects.
>> >> > 1. the -svnlook parameter may receive a value with spaces in it, e.g.
>> >> "C:/Program Files (x86)/Subversion/bin/svnlook". the script seems to be
>> unaware
>> >> of this, and as a result, i get a
>> >> >
>> >> > "'C:/Program' is not recognized as an internal or external command,operable
>> >> program or batch file.
>> >> > The system cannot find the path specified.
>> >> > The system cannot find the path specified.
>> >> >
>> >> > error. the path to svnlook should be sorrounded with quotes or something.
>> >> >
>> >> > 2. the example pre-commit file in the zip has this after the call to the
>> >> script:
>> >> >
>> >> > exit $?
>> >> >
>> >> > what does it mean? i tried to replace it with
>> >> >
>> >> > if not errorlevel 0 exit /b 1
>> >> >
>> >> > but it didn't exit the hook script, and continued to run another script the
>> >> pre-commit hook runs. what is the exit code your script uses when there is a
>> >> rule violation?
>> >> >
>> >> >
>> >> > i'd be happy if you could fix those problems.
>> >> >
>> >> > here's my entire pre-commit.bat, translated to windows syntax:
>> >> >
>> >> > set REPOS=%1
>> >> > set TXN=%2
>> >> >
>> >> > set CWD=%REPOS%/hooks
>> >> > set SVNLOOK="C:/Program Files (x86)/Subversion/bin/svnlook"
>> >> >
>> >> > set ACCESS_HOOK=%CWD%/pre-commit-access-control-hook.pl
>> >> > set CONTROL_FILE=%CWD%/control-file.ini
>> >> >
>> >> > rem PRE-COMMIT HOOK
>> >> >
>> >> > C:\Perl\bin\perl %ACCESS_HOOK% -svnlook %SVNLOOK% -file %CONTROL_FILE% -t
>> >> %TXN% %REPOS%
>> >> >
>> >> > if not errorlevel 0 (
>> >> >  echo Goto TortoiseSVN settings ^> Edit button, add the following line to
>> >> [auto-props]: >&2
>> >> >  echo *.resx = svn:needs-lock >&2
>> >> >  echo and make sure you set >&2
>> >> >  echo enable-auto-props = yes >&2
>> >> >  exit /b 1
>> >> > )
>> >> >
>> >> > and then it calls some other script, which is run even if the
>> >> pre-commit-acces-control-hook fails. i do get the error message, e.g.
>> >> >
>> >> >  ERROR: Commit failed for the following reasons:
>> >> >  Property "svn:needs-lock" needed for file
>> >> "Fantasy.NET/trunk/Fantasy.Presentation/AboutBoxForm.resx".
>> >> >         Must match string '*'.
>> >> >
>> >> > but the commit doesn't stop.
>> >> >
>> >> > thanks,
>> >> > tsahi
>> >> >
>> >> > --
>> >> > The day Micro$oft sells something that doesn't SUCK
>> >> > is the day they start selling vacuum cleaners.
>> >> > http://www.geocities.com/tsahi_75
>> >> >
>> >> >
>> >> >
>> >> > ----- Original Message ----
>> >> >> From: Bob Proulx
>> >> >> To: users@subversion.tigris.org
>> >> >> Sent: Friday, March 13, 2009 9:30:40 AM
>> >> >> Subject: Re: EOL Check Hook Script?
>> >> >>
>> >> >> David Weintraub wrote:
>> >> >> > ou can download the hook script here:
>> >> >> >
>> >> >>
>> >> >> Cool stuff.  Thanks for sharing!
>> >> >>
>> >> >> Bob
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> --
>> >> David Weintraub
>> >> qazwart@gmail.com
>> >
>> >
>> >
>> >
>> >
>>
>>
>>
>> --
>> --
>> David Weintraub
>> qazwart@gmail.com
>>
>> ------------------------------------------------------
>> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1355764
>>
>> To unsubscribe from this discussion, e-mail:
>> [users-unsubscribe@subversion.tigris.org].
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1381410
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].
>



-- 
--
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1390436

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: EOL Check Hook Script?

Posted by Henrik Sundberg <st...@gmail.com>.
On Sun, Mar 22, 2009 at 3:40 PM, Tsahi Asher <ts...@yahoo.com> wrote:
> if not errorlevel 0...
>
> detected an error, but i still get the
>
>
> "'C:/Program' is not recognized as an internal or external command,operable
> program or batch file."
>
> error.

That is normal in Windows when forgetting to quote file names. The
real path is probably "C:\Program Files\"...
I.e., there is a space in the path.

/$

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1381813

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: EOL Check Hook Script?

Posted by Tsahi Asher <ts...@yahoo.com>.
alright, checking for

if errorlevel 1...

instead of

if not errorlevel 0...

detected an error, but i still get the 

 
"'C:/Program' is not recognized as an internal or external command,operable
program or batch file."

error.

tsahi
--
The day Micro$oft sells something that doesn't SUCK
is the day they start selling vacuum cleaners.
http://www.geocities.com/tsahi_75



----- Original Message ----
> From: David Weintraub <qa...@gmail.com>
> To: Tsahi Asher <ts...@yahoo.com>
> Cc: users@subversion.tigris.org
> Sent: Thursday, March 19, 2009 4:42:06 PM
> Subject: Re: EOL Check Hook Script?
> 
> Yes it does. The STDERR contains a list of why the hook fails, so this
> is returned to the user.
> 
> On Thu, Mar 19, 2009 at 10:35 AM, Tsahi Asher wrote:
> >
> > Thanks for the answer. I already have a pre-commit.bat file, which runs pretty 
> good so fare, except for detecting that property on replaced files.
> >
> > What about the second issue? Does your script exit with a non-zero exit code 
> when one of the rules is not met?
> >
> > Tsahi
> >
> >  --
> > The day Micro$oft sells something that doesn't SUCK
> > is the day they start selling vacuum cleaners.
> > http://www.geocities.com/tsahi_75
> >
> >
> >
> > ----- Original Message ----
> >> From: David Weintraub 
> >> To: Tsahi Asher 
> >> Cc: users@subversion.tigris.org
> >> Sent: Thursday, March 19, 2009 4:25:38 PM
> >> Subject: Re: EOL Check Hook Script?
> >>
> >> The problem is that I am not that familiar with Windows or the Batch
> >> programming language. I also don't have access to a Windows system in
> >> order to do some testing.
> >>
> >> However, when you create a Subversion repository, there's a file
> >> called pre-commit.bat.tmpl (or something like that) that's created.
> >> You can use this as a template on how to create the pre-commit.bat
> >> trigger file you need. That's what I did with the pre-commit shell
> >> script that was created.
> >>
> >> I can't even find the pre-commit.bat.tmpl file in the repository.
> >>
> >> On Sun, Mar 15, 2009 at 5:39 AM, Tsahi Asher wrote:
> >> >
> >> > this accidentally almost solved my problem too. i need to enforce
> >> svn:needs-lock on .resx files. trying to run this on windows, though, has 
> some
> >> side effects.
> >> > 1. the -svnlook parameter may receive a value with spaces in it, e.g.
> >> "C:/Program Files (x86)/Subversion/bin/svnlook". the script seems to be 
> unaware
> >> of this, and as a result, i get a
> >> >
> >> > "'C:/Program' is not recognized as an internal or external command,operable
> >> program or batch file.
> >> > The system cannot find the path specified.
> >> > The system cannot find the path specified.
> >> >
> >> > error. the path to svnlook should be sorrounded with quotes or something.
> >> >
> >> > 2. the example pre-commit file in the zip has this after the call to the
> >> script:
> >> >
> >> > exit $?
> >> >
> >> > what does it mean? i tried to replace it with
> >> >
> >> > if not errorlevel 0 exit /b 1
> >> >
> >> > but it didn't exit the hook script, and continued to run another script the
> >> pre-commit hook runs. what is the exit code your script uses when there is a
> >> rule violation?
> >> >
> >> >
> >> > i'd be happy if you could fix those problems.
> >> >
> >> > here's my entire pre-commit.bat, translated to windows syntax:
> >> >
> >> > set REPOS=%1
> >> > set TXN=%2
> >> >
> >> > set CWD=%REPOS%/hooks
> >> > set SVNLOOK="C:/Program Files (x86)/Subversion/bin/svnlook"
> >> >
> >> > set ACCESS_HOOK=%CWD%/pre-commit-access-control-hook.pl
> >> > set CONTROL_FILE=%CWD%/control-file.ini
> >> >
> >> > rem PRE-COMMIT HOOK
> >> >
> >> > C:\Perl\bin\perl %ACCESS_HOOK% -svnlook %SVNLOOK% -file %CONTROL_FILE% -t
> >> %TXN% %REPOS%
> >> >
> >> > if not errorlevel 0 (
> >> >  echo Goto TortoiseSVN settings ^> Edit button, add the following line to
> >> [auto-props]: >&2
> >> >  echo *.resx = svn:needs-lock >&2
> >> >  echo and make sure you set >&2
> >> >  echo enable-auto-props = yes >&2
> >> >  exit /b 1
> >> > )
> >> >
> >> > and then it calls some other script, which is run even if the
> >> pre-commit-acces-control-hook fails. i do get the error message, e.g.
> >> >
> >> >  ERROR: Commit failed for the following reasons:
> >> >  Property "svn:needs-lock" needed for file
> >> "Fantasy.NET/trunk/Fantasy.Presentation/AboutBoxForm.resx".
> >> >         Must match string '*'.
> >> >
> >> > but the commit doesn't stop.
> >> >
> >> > thanks,
> >> > tsahi
> >> >
> >> > --
> >> > The day Micro$oft sells something that doesn't SUCK
> >> > is the day they start selling vacuum cleaners.
> >> > http://www.geocities.com/tsahi_75
> >> >
> >> >
> >> >
> >> > ----- Original Message ----
> >> >> From: Bob Proulx
> >> >> To: users@subversion.tigris.org
> >> >> Sent: Friday, March 13, 2009 9:30:40 AM
> >> >> Subject: Re: EOL Check Hook Script?
> >> >>
> >> >> David Weintraub wrote:
> >> >> > ou can download the hook script here:
> >> >> >
> >> >>
> >> >> Cool stuff.  Thanks for sharing!
> >> >>
> >> >> Bob
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> --
> >> David Weintraub
> >> qazwart@gmail.com
> >
> >
> >
> >
> >
> 
> 
> 
> -- 
> --
> David Weintraub
> qazwart@gmail.com
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1355764
> 
> To unsubscribe from this discussion, e-mail: 
> [users-unsubscribe@subversion.tigris.org].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1381410

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: EOL Check Hook Script?

Posted by David Weintraub <qa...@gmail.com>.
Yes it does. The STDERR contains a list of why the hook fails, so this
is returned to the user.

On Thu, Mar 19, 2009 at 10:35 AM, Tsahi Asher <ts...@yahoo.com> wrote:
>
> Thanks for the answer. I already have a pre-commit.bat file, which runs pretty good so fare, except for detecting that property on replaced files.
>
> What about the second issue? Does your script exit with a non-zero exit code when one of the rules is not met?
>
> Tsahi
>
>  --
> The day Micro$oft sells something that doesn't SUCK
> is the day they start selling vacuum cleaners.
> http://www.geocities.com/tsahi_75
>
>
>
> ----- Original Message ----
>> From: David Weintraub <qa...@gmail.com>
>> To: Tsahi Asher <ts...@yahoo.com>
>> Cc: users@subversion.tigris.org
>> Sent: Thursday, March 19, 2009 4:25:38 PM
>> Subject: Re: EOL Check Hook Script?
>>
>> The problem is that I am not that familiar with Windows or the Batch
>> programming language. I also don't have access to a Windows system in
>> order to do some testing.
>>
>> However, when you create a Subversion repository, there's a file
>> called pre-commit.bat.tmpl (or something like that) that's created.
>> You can use this as a template on how to create the pre-commit.bat
>> trigger file you need. That's what I did with the pre-commit shell
>> script that was created.
>>
>> I can't even find the pre-commit.bat.tmpl file in the repository.
>>
>> On Sun, Mar 15, 2009 at 5:39 AM, Tsahi Asher wrote:
>> >
>> > this accidentally almost solved my problem too. i need to enforce
>> svn:needs-lock on .resx files. trying to run this on windows, though, has some
>> side effects.
>> > 1. the -svnlook parameter may receive a value with spaces in it, e.g.
>> "C:/Program Files (x86)/Subversion/bin/svnlook". the script seems to be unaware
>> of this, and as a result, i get a
>> >
>> > "'C:/Program' is not recognized as an internal or external command,operable
>> program or batch file.
>> > The system cannot find the path specified.
>> > The system cannot find the path specified.
>> >
>> > error. the path to svnlook should be sorrounded with quotes or something.
>> >
>> > 2. the example pre-commit file in the zip has this after the call to the
>> script:
>> >
>> > exit $?
>> >
>> > what does it mean? i tried to replace it with
>> >
>> > if not errorlevel 0 exit /b 1
>> >
>> > but it didn't exit the hook script, and continued to run another script the
>> pre-commit hook runs. what is the exit code your script uses when there is a
>> rule violation?
>> >
>> >
>> > i'd be happy if you could fix those problems.
>> >
>> > here's my entire pre-commit.bat, translated to windows syntax:
>> >
>> > set REPOS=%1
>> > set TXN=%2
>> >
>> > set CWD=%REPOS%/hooks
>> > set SVNLOOK="C:/Program Files (x86)/Subversion/bin/svnlook"
>> >
>> > set ACCESS_HOOK=%CWD%/pre-commit-access-control-hook.pl
>> > set CONTROL_FILE=%CWD%/control-file.ini
>> >
>> > rem PRE-COMMIT HOOK
>> >
>> > C:\Perl\bin\perl %ACCESS_HOOK% -svnlook %SVNLOOK% -file %CONTROL_FILE% -t
>> %TXN% %REPOS%
>> >
>> > if not errorlevel 0 (
>> >  echo Goto TortoiseSVN settings ^> Edit button, add the following line to
>> [auto-props]: >&2
>> >  echo *.resx = svn:needs-lock >&2
>> >  echo and make sure you set >&2
>> >  echo enable-auto-props = yes >&2
>> >  exit /b 1
>> > )
>> >
>> > and then it calls some other script, which is run even if the
>> pre-commit-acces-control-hook fails. i do get the error message, e.g.
>> >
>> >  ERROR: Commit failed for the following reasons:
>> >  Property "svn:needs-lock" needed for file
>> "Fantasy.NET/trunk/Fantasy.Presentation/AboutBoxForm.resx".
>> >         Must match string '*'.
>> >
>> > but the commit doesn't stop.
>> >
>> > thanks,
>> > tsahi
>> >
>> > --
>> > The day Micro$oft sells something that doesn't SUCK
>> > is the day they start selling vacuum cleaners.
>> > http://www.geocities.com/tsahi_75
>> >
>> >
>> >
>> > ----- Original Message ----
>> >> From: Bob Proulx
>> >> To: users@subversion.tigris.org
>> >> Sent: Friday, March 13, 2009 9:30:40 AM
>> >> Subject: Re: EOL Check Hook Script?
>> >>
>> >> David Weintraub wrote:
>> >> > ou can download the hook script here:
>> >> >
>> >>
>> >> Cool stuff.  Thanks for sharing!
>> >>
>> >> Bob
>> >
>> >
>> >
>> >
>> >
>>
>>
>>
>> --
>> --
>> David Weintraub
>> qazwart@gmail.com
>
>
>
>
>



-- 
--
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1355764

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: EOL Check Hook Script?

Posted by Tsahi Asher <ts...@yahoo.com>.
Thanks for the answer. I already have a pre-commit.bat file, which runs pretty good so fare, except for detecting that property on replaced files.

What about the second issue? Does your script exit with a non-zero exit code when one of the rules is not met?

Tsahi

 --
The day Micro$oft sells something that doesn't SUCK
is the day they start selling vacuum cleaners.
http://www.geocities.com/tsahi_75



----- Original Message ----
> From: David Weintraub <qa...@gmail.com>
> To: Tsahi Asher <ts...@yahoo.com>
> Cc: users@subversion.tigris.org
> Sent: Thursday, March 19, 2009 4:25:38 PM
> Subject: Re: EOL Check Hook Script?
> 
> The problem is that I am not that familiar with Windows or the Batch
> programming language. I also don't have access to a Windows system in
> order to do some testing.
> 
> However, when you create a Subversion repository, there's a file
> called pre-commit.bat.tmpl (or something like that) that's created.
> You can use this as a template on how to create the pre-commit.bat
> trigger file you need. That's what I did with the pre-commit shell
> script that was created.
> 
> I can't even find the pre-commit.bat.tmpl file in the repository.
> 
> On Sun, Mar 15, 2009 at 5:39 AM, Tsahi Asher wrote:
> >
> > this accidentally almost solved my problem too. i need to enforce 
> svn:needs-lock on .resx files. trying to run this on windows, though, has some 
> side effects.
> > 1. the -svnlook parameter may receive a value with spaces in it, e.g. 
> "C:/Program Files (x86)/Subversion/bin/svnlook". the script seems to be unaware 
> of this, and as a result, i get a
> >
> > "'C:/Program' is not recognized as an internal or external command,operable 
> program or batch file.
> > The system cannot find the path specified.
> > The system cannot find the path specified.
> >
> > error. the path to svnlook should be sorrounded with quotes or something.
> >
> > 2. the example pre-commit file in the zip has this after the call to the 
> script:
> >
> > exit $?
> >
> > what does it mean? i tried to replace it with
> >
> > if not errorlevel 0 exit /b 1
> >
> > but it didn't exit the hook script, and continued to run another script the 
> pre-commit hook runs. what is the exit code your script uses when there is a 
> rule violation?
> >
> >
> > i'd be happy if you could fix those problems.
> >
> > here's my entire pre-commit.bat, translated to windows syntax:
> >
> > set REPOS=%1
> > set TXN=%2
> >
> > set CWD=%REPOS%/hooks
> > set SVNLOOK="C:/Program Files (x86)/Subversion/bin/svnlook"
> >
> > set ACCESS_HOOK=%CWD%/pre-commit-access-control-hook.pl
> > set CONTROL_FILE=%CWD%/control-file.ini
> >
> > rem PRE-COMMIT HOOK
> >
> > C:\Perl\bin\perl %ACCESS_HOOK% -svnlook %SVNLOOK% -file %CONTROL_FILE% -t 
> %TXN% %REPOS%
> >
> > if not errorlevel 0 (
> >  echo Goto TortoiseSVN settings ^> Edit button, add the following line to 
> [auto-props]: >&2
> >  echo *.resx = svn:needs-lock >&2
> >  echo and make sure you set >&2
> >  echo enable-auto-props = yes >&2
> >  exit /b 1
> > )
> >
> > and then it calls some other script, which is run even if the 
> pre-commit-acces-control-hook fails. i do get the error message, e.g.
> >
> >  ERROR: Commit failed for the following reasons:
> >  Property "svn:needs-lock" needed for file 
> "Fantasy.NET/trunk/Fantasy.Presentation/AboutBoxForm.resx".
> >         Must match string '*'.
> >
> > but the commit doesn't stop.
> >
> > thanks,
> > tsahi
> >
> > --
> > The day Micro$oft sells something that doesn't SUCK
> > is the day they start selling vacuum cleaners.
> > http://www.geocities.com/tsahi_75
> >
> >
> >
> > ----- Original Message ----
> >> From: Bob Proulx 
> >> To: users@subversion.tigris.org
> >> Sent: Friday, March 13, 2009 9:30:40 AM
> >> Subject: Re: EOL Check Hook Script?
> >>
> >> David Weintraub wrote:
> >> > ou can download the hook script here:
> >> > 
> >>
> >> Cool stuff.  Thanks for sharing!
> >>
> >> Bob
> >
> >
> >
> >
> >
> 
> 
> 
> -- 
> --
> David Weintraub
> qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1355730

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: EOL Check Hook Script?

Posted by David Weintraub <qa...@gmail.com>.
The problem is that I am not that familiar with Windows or the Batch
programming language. I also don't have access to a Windows system in
order to do some testing.

However, when you create a Subversion repository, there's a file
called pre-commit.bat.tmpl (or something like that) that's created.
You can use this as a template on how to create the pre-commit.bat
trigger file you need. That's what I did with the pre-commit shell
script that was created.

I can't even find the pre-commit.bat.tmpl file in the repository.

On Sun, Mar 15, 2009 at 5:39 AM, Tsahi Asher <ts...@yahoo.com> wrote:
>
> this accidentally almost solved my problem too. i need to enforce svn:needs-lock on .resx files. trying to run this on windows, though, has some side effects.
> 1. the -svnlook parameter may receive a value with spaces in it, e.g. "C:/Program Files (x86)/Subversion/bin/svnlook". the script seems to be unaware of this, and as a result, i get a
>
> "'C:/Program' is not recognized as an internal or external command,operable program or batch file.
> The system cannot find the path specified.
> The system cannot find the path specified.
>
> error. the path to svnlook should be sorrounded with quotes or something.
>
> 2. the example pre-commit file in the zip has this after the call to the script:
>
> exit $?
>
> what does it mean? i tried to replace it with
>
> if not errorlevel 0 exit /b 1
>
> but it didn't exit the hook script, and continued to run another script the pre-commit hook runs. what is the exit code your script uses when there is a rule violation?
>
>
> i'd be happy if you could fix those problems.
>
> here's my entire pre-commit.bat, translated to windows syntax:
>
> set REPOS=%1
> set TXN=%2
>
> set CWD=%REPOS%/hooks
> set SVNLOOK="C:/Program Files (x86)/Subversion/bin/svnlook"
>
> set ACCESS_HOOK=%CWD%/pre-commit-access-control-hook.pl
> set CONTROL_FILE=%CWD%/control-file.ini
>
> rem PRE-COMMIT HOOK
>
> C:\Perl\bin\perl %ACCESS_HOOK% -svnlook %SVNLOOK% -file %CONTROL_FILE% -t %TXN% %REPOS%
>
> if not errorlevel 0 (
>  echo Goto TortoiseSVN settings ^> Edit button, add the following line to [auto-props]: >&2
>  echo *.resx = svn:needs-lock >&2
>  echo and make sure you set >&2
>  echo enable-auto-props = yes >&2
>  exit /b 1
> )
>
> and then it calls some other script, which is run even if the pre-commit-acces-control-hook fails. i do get the error message, e.g.
>
>  ERROR: Commit failed for the following reasons:
>  Property "svn:needs-lock" needed for file "Fantasy.NET/trunk/Fantasy.Presentation/AboutBoxForm.resx".
>         Must match string '*'.
>
> but the commit doesn't stop.
>
> thanks,
> tsahi
>
> --
> The day Micro$oft sells something that doesn't SUCK
> is the day they start selling vacuum cleaners.
> http://www.geocities.com/tsahi_75
>
>
>
> ----- Original Message ----
>> From: Bob Proulx <bo...@proulx.com>
>> To: users@subversion.tigris.org
>> Sent: Friday, March 13, 2009 9:30:40 AM
>> Subject: Re: EOL Check Hook Script?
>>
>> David Weintraub wrote:
>> > ou can download the hook script here:
>> > <http://dl.getdropbox.com/u/433257/hooks.zip>
>>
>> Cool stuff.  Thanks for sharing!
>>
>> Bob
>
>
>
>
>



-- 
--
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1355700

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: EOL Check Hook Script?

Posted by Tsahi Asher <ts...@yahoo.com>.
this accidentally almost solved my problem too. i need to enforce svn:needs-lock on .resx files. trying to run this on windows, though, has some side effects.
1. the -svnlook parameter may receive a value with spaces in it, e.g. "C:/Program Files (x86)/Subversion/bin/svnlook". the script seems to be unaware of this, and as a result, i get a

"'C:/Program' is not recognized as an internal or external command,operable program or batch file.
The system cannot find the path specified.
The system cannot find the path specified.

error. the path to svnlook should be sorrounded with quotes or something.

2. the example pre-commit file in the zip has this after the call to the script:

exit $?

what does it mean? i tried to replace it with 

if not errorlevel 0 exit /b 1

but it didn't exit the hook script, and continued to run another script the pre-commit hook runs. what is the exit code your script uses when there is a rule violation?

 
i'd be happy if you could fix those problems.

here's my entire pre-commit.bat, translated to windows syntax:

set REPOS=%1
set TXN=%2

set CWD=%REPOS%/hooks
set SVNLOOK="C:/Program Files (x86)/Subversion/bin/svnlook"

set ACCESS_HOOK=%CWD%/pre-commit-access-control-hook.pl
set CONTROL_FILE=%CWD%/control-file.ini

rem PRE-COMMIT HOOK

C:\Perl\bin\perl %ACCESS_HOOK% -svnlook %SVNLOOK% -file %CONTROL_FILE% -t %TXN% %REPOS%

if not errorlevel 0 (
  echo Goto TortoiseSVN settings ^> Edit button, add the following line to [auto-props]: >&2 
  echo *.resx = svn:needs-lock >&2
  echo and make sure you set >&2
  echo enable-auto-props = yes >&2
  exit /b 1
)

and then it calls some other script, which is run even if the pre-commit-acces-control-hook fails. i do get the error message, e.g. 

 ERROR: Commit failed for the following reasons:  
 Property "svn:needs-lock" needed for file "Fantasy.NET/trunk/Fantasy.Presentation/AboutBoxForm.resx".  
         Must match string '*'.  

but the commit doesn't stop.

thanks,
tsahi

--
The day Micro$oft sells something that doesn't SUCK
is the day they start selling vacuum cleaners.
http://www.geocities.com/tsahi_75



----- Original Message ----
> From: Bob Proulx <bo...@proulx.com>
> To: users@subversion.tigris.org
> Sent: Friday, March 13, 2009 9:30:40 AM
> Subject: Re: EOL Check Hook Script?
> 
> David Weintraub wrote:
> > ou can download the hook script here:
> > <http://dl.getdropbox.com/u/433257/hooks.zip>
> 
> Cool stuff.  Thanks for sharing!
> 
> Bob

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1326120

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: EOL Check Hook Script?

Posted by Bob Proulx <bo...@proulx.com>.
David Weintraub wrote:
> ou can download the hook script here:
> <http://dl.getdropbox.com/u/433257/hooks.zip>

Cool stuff.  Thanks for sharing!

Bob

Re: EOL Check Hook Script?

Posted by David Weintraub <qa...@gmail.com>.
I have a pre-commit hook that among other things, allows you to force
the setting of various properties. For example, I force the setting of
svn:eol-style = LF in all *.sh and *.pl files. If you create a file,
and that property is not set, I reject the commit.

This "encourages" our developers to set auto-properties and keeps the
correct line endings on our files.

You can set svn:eol-style en mass, then use this hook to make sure all
new files have the svn:eol-style property set.

ou can download the hook script here:
<http://dl.getdropbox.com/u/433257/hooks.zip>

On Thu, Mar 12, 2009 at 3:31 AM, Bob Proulx <bo...@proulx.com> wrote:
> Ryan Schmidt wrote:
>> I didn't understand your reason for not wanting to use the existing
>> eol enforcement technology that Subversion already has (setting
>> svn:eol-style).
>
> One reason is that then I would need to have these other folks working
> on the project to set up their auto-props.  That is about as much
> trouble for me to get them to do as it is for me to get them to set up
> their editors with eol conventions.  If I could do one successfully
> then I would be able to do the other instead.  I would just set up
> their editors to be newline only and be done with it.


--
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1313438

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


Re: EOL Check Hook Script?

Posted by Bob Proulx <bo...@proulx.com>.
Ryan Schmidt wrote:
> I didn't understand your reason for not wanting to use the existing  
> eol enforcement technology that Subversion already has (setting  
> svn:eol-style).

One reason is that then I would need to have these other folks working
on the project to set up their auto-props.  That is about as much
trouble for me to get them to do as it is for me to get them to set up
their editors with eol conventions.  If I could do one successfully
then I would be able to do the other instead.  I would just set up
their editors to be newline only and be done with it.

> I would suggest that you set svn:eol-style to whatever value you like  
> best (be that native or LF or CRLF) on all files that need eol  
> enforcement. On each client, you set up auto-props to automatically  
> set that property on those types of files, by filename extension. And  
> in the server's pre-commit hook, you check that all committed files  
> with whatever filename extensions do have the property set, and if  
> not, exit and tell the user to set the property.

Yes, I am well aware of that process.  But I was hoping to avoid it.
I think I would rather do it differently.

Thanks for your feedback anyway.

Bob

Re: EOL Check Hook Script?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 9, 2009, at 18:12, Bob Proulx wrote:

> Does anyone have a hook script that they have already written that
> will check that the eol convention hasn't changed with a commit and
> will reject it if it has changed?
>
> On a project I am working on in a mixed environment everyone has
> agreed that setting the right eol convention in their editor is easily
> done.  But it is also easily forgotten too.  If we had a hook script
> to check for this case then it could prevent commit accidents.  I am
> aware of setting eol-style to native but since the working copy files
> are different than the target files (e.g. md5sums, tarballs, etc.) I
> would rather avoid doing it that way if possible.

I didn't understand your reason for not wanting to use the existing  
eol enforcement technology that Subversion already has (setting  
svn:eol-style).

I would suggest that you set svn:eol-style to whatever value you like  
best (be that native or LF or CRLF) on all files that need eol  
enforcement. On each client, you set up auto-props to automatically  
set that property on those types of files, by filename extension. And  
in the server's pre-commit hook, you check that all committed files  
with whatever filename extensions do have the property set, and if  
not, exit and tell the user to set the property.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1301323

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].