|
|
This
month's question - Summer 2008
Q: Hi Greg,
Hi Greg,
I committed a Perl script to my Subversion repository and want to check it out on a Linux machine and run it.
When I check it out, its execute bit isn't set, so I have to set it manually. Is there a way to configure Subversion to do that automatically? -- D.F.
A: Subversion includes a feature to do exactly what you want. Here is an example session with a non-executable Perl script. Notice that I use the svn propset command to set the svn:executable property on the file. Once this property is set, when Subversion checks the file out of the repository, it will set its execute bit automatically.
$ ls -l
total 2
-rw-r--r-- 1 glarkin glarkin 209 Jul 23 18:01 showtime.pl
$ svn propset svn:executable yes showtime.pl
property 'svn:executable' set on 'showtime.pl'
$ svn commit -m "Added exec prop" showtime.pl
Sending showtime.pl
Committed revision 2.
$ ls -l showtime.pl
-rwxr-xr-x 1 glarkin glarkin 209 Jul 23 18:01 showtime.pl
$ svn propget svn:executable showtime.pl
*
Finally, keep the following caveats in mind:
- This only works on filesystems that honor the executable bit, i.e. not NTFS, FAT32, etc.
- File properties are versioned, so don't forget to commit after changing them.
Regards,
Greg
Ask the Source is a regular feature of the SourceHosting.net
email newsletter, SourceHosting.news.
Do you have
a question
for The Source? Submit
one today, and we'll
review it for inclusion in a future edition of SourceHosting.news!
For a complete list of all "Ask The Source"
questions and answers, please visit the archives
page.
|
|
|