You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by N D <ni...@gmail.com> on 2008/10/13 12:17:06 UTC

File Content Type/Executablitiy?

Hi all,

I build my application using a unix shell script. I commited this script
into my svn repo. using Eclips IDE. The problem was that when this script
was checked out from svn it did not run properly and terminated at places
where it was syntactically correct. I suppose this is becaue of the ^M
characters / end of line characters not recognized.

The soulution that i thought of is to commit the build script from the linux
system, using --encoding ASCII option. This is working for me.

But as I was going thorugh the manual again, I got to see the section 'File
Content Type' where in this problem has mentioned. What I remember read
there is 'set the svn:mime to native' . But I have not tried this yet.

Can any one please comment/give insight on which of the above is more
correct and should be used?

Re: File Content Type/Executablitiy?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Oct 13, 2008, at 07:17, N D wrote:

> I build my application using a unix shell script. I commited this  
> script into my svn repo. using Eclips IDE. The problem was that  
> when this script was checked out from svn it did not run properly  
> and terminated at places where it was syntactically correct. I  
> suppose this is becaue of the ^M characters / end of line  
> characters not recognized.
>
> The soulution that i thought of is to commit the build script from  
> the linux system, using --encoding ASCII option. This is working  
> for me.
>
> But as I was going thorugh the manual again, I got to see the  
> section 'File Content Type' where in this problem has mentioned.  
> What I remember read there is 'set the svn:mime to native' . But I  
> have not tried this yet.

It sounds like you've confused two properties...

The one property is svn:mime-type which sets the file's MIME type.  
For shell scripts, text/plain is probably fine, and that's the  
default, so you don't need to set this property. But if you were  
committing e.g. an HTML file, you might want to set svn:mime-type to  
text/html.

The other property is svn:eol-style which indicates what line ending  
translation you want Subversion to perform. The default (when this  
property is not set) is that Subversion does no translation. But for  
text files like shell scripts that you want to check out and edit on  
both Windows and Linux, a good value for svn:eol-style is native,  
which means that if you check out on Windows, you get a file with  
CRLF (DOS-style) line endings, and if you check out on Linux, you get  
a file with LF (UNIX-style) line endings.

--encoding ASCII is irrelevant; on both Windows and Linux your file  
is still ASCII; what differed was the line ending characters.

A third property is svn:executable, which you should probably set (to  
any value; Subversion will normalize the value to "*") on scripts  
that you want to be able to directly execute. When the Subversion  
client sees this property during checkout or update, it will set the  
executable bit on the file if the OS supports it.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: File Content Type/Executablitiy?

Posted by David Weintraub <qa...@gmail.com>.
There are a few properties that can be placed on your file that will
solve this issue:

svn:eol-style="LF" or svn:eol-style="native"
svn:executable="*"

When Subversion sees the svn:eol-style property on the file set to
either native or LF, it automatically converts all ^M Windows style
line endings  (Which are <CR><LF>) to Unix style line endings (Which
is a plain <LF>).

When Subversion sees the svn:executable property on a file, it makes
sure on Unix like systems that it sets the execute bit when checking
out.

You can use a pre-commit hook to insure that these two properties are
on your shell scripts before permitting checking in the files. And,
you can use the auto-properties in your $HOME/.subversion/config file
to make sure these properties are automatically set when you create a
new shell script.

See <http://svnbook.red-bean.com/en/1.5/svn.advanced.props.html> for
information about Subversion properties and
<http://svnbook.red-bean.com/en/1.5/svn.ref.properties.html>.
--
David Weintraub
qazwart@gmail.com



On Mon, Oct 13, 2008 at 8:17 AM, N D <ni...@gmail.com> wrote:
> Hi all,
>
> I build my application using a unix shell script. I commited this script
> into my svn repo. using Eclips IDE. The problem was that when this script
> was checked out from svn it did not run properly and terminated at places
> where it was syntactically correct. I suppose this is becaue of the ^M
> characters / end of line characters not recognized.
>
> The soulution that i thought of is to commit the build script from the linux
> system, using --encoding ASCII option. This is working for me.
>
> But as I was going thorugh the manual again, I got to see the section 'File
> Content Type' where in this problem has mentioned. What I remember read
> there is 'set the svn:mime to native' . But I have not tried this yet.
>
> Can any one please comment/give insight on which of the above is more
> correct and should be used?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: File Content Type/Executablitiy?

Posted by David Weintraub <qa...@gmail.com>.
There are a few properties that can be placed on your file that will
solve this issue:

svn:eol-style="LF" or svn:eol-style="native"
svn:executable="*"

When Subversion sees the svn:eol-style property on the file set to
either native or LF, it automatically converts all ^M Windows style
line endings  (Which are <CR><LF>) to Unix style line endings (Which
is a plain <LF>).

When Subversion sees the svn:executable property on a file, it makes
sure on Unix like systems that it sets the execute bit when checking
out.

You can use a pre-commit hook to insure that these two properties are
on your shell scripts before permitting checking in the files. And,
you can use the auto-properties in your $HOME/.subversion/config file
to make sure these properties are automatically set when you create a
new shell script.

See <http://svnbook.red-bean.com/en/1.5/svn.advanced.props.html> for
information about Subversion properties and
<http://svnbook.red-bean.com/en/1.5/svn.ref.properties.html#svn.ref.properties.versioned-props>
for more information.

--
David Weintraub
qazwart@gmail.com



On Mon, Oct 13, 2008 at 8:17 AM, N D <ni...@gmail.com> wrote:
> Hi all,
>
> I build my application using a unix shell script. I commited this script
> into my svn repo. using Eclips IDE. The problem was that when this script
> was checked out from svn it did not run properly and terminated at places
> where it was syntactically correct. I suppose this is becaue of the ^M
> characters / end of line characters not recognized.
>
> The soulution that i thought of is to commit the build script from the linux
> system, using --encoding ASCII option. This is working for me.
>
> But as I was going thorugh the manual again, I got to see the section 'File
> Content Type' where in this problem has mentioned. What I remember read
> there is 'set the svn:mime to native' . But I have not tried this yet.
>
> Can any one please comment/give insight on which of the above is more
> correct and should be used?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org