You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jay Foad <ja...@gmail.com> on 2009/09/03 12:50:46 UTC

funny error handling for inconsistent line endings

I have this in my ~/.subversion/config

[auto-props]
*.txt = svn:eol-style=native

If I try to "svn add" a file with inconsistent line endings, I get this:

$ echo -e "foo\r\nbar" > file.txt
$ svn add file.txt
svn: File 'file.txt' has inconsistent newlines
svn: Inconsistent line ending style
$ echo $?
1
foad@debian:~/qqq$ svn st file.txt
A      file.txt

So the "svn add" command has returned with an exit status of 1,
indicating failure, but it has succeeded in adding the file. This
seems wrong.

It is particularly annoying if you "svn add" a long list of files,
some of which have inconsistent line endings. You have to re-run the
same command many times to get it to succeed, because it will stop
with an error each time it gets to an inconsistent file, but the next
time you run it it will get further.

Thoughts?

Thanks,
Jay.

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

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

Re: funny error handling for inconsistent line endings

Posted by Julian Foad <ju...@wandisco.com>.
On Thu, 2009-09-03, Jay Foad wrote:
> > This is filed as
> >
> > http://subversion.tigris.org/issues/show_bug.cgi?id=2713
> >
> > and
> >
> > http://subversion.tigris.org/issues/show_bug.cgi?id=2925
> 
> Good point. Thanks!

I fixed issue #2713 in the trunk code at r39557 and marked #2925 as a
duplicate of it. The fix makes "svn add" fail cleanly, without adding
the inconsistent file. This should at least make it easier to deal with
because then you will just need to clean up the line endings and re-run
the add to continue until the next inconsistent file. (With this bug
present, you can re-run the add to continue with other files, but as
well as cleaning up the file you also have to set its properties
manually.)

The fix will come out in Subversion 1.7. It is technically easy to
back-port the fix to 1.6.x but I don't know if we will.

GUIs could skip all such inconsistent files but continue with the
others, and then give a summary of problems, or have an option to
"correct" the inconsistent line endings. I do not intend to work on
those sorts of behaviour changes in "svn".

- Julian

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

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

Re: funny error handling for inconsistent line endings

Posted by Jay Foad <ja...@gmail.com>.
> This is filed as
>
> http://subversion.tigris.org/issues/show_bug.cgi?id=2713
>
> and
>
> http://subversion.tigris.org/issues/show_bug.cgi?id=2925

Good point. Thanks!

Jay.

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

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

Re: funny error handling for inconsistent line endings

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 3, 2009, at 07:50, Jay Foad wrote:

> I have this in my ~/.subversion/config
>
> [auto-props]
> *.txt = svn:eol-style=native
>
> If I try to "svn add" a file with inconsistent line endings, I get  
> this:
>
> $ echo -e "foo\r\nbar" > file.txt
> $ svn add file.txt
> svn: File 'file.txt' has inconsistent newlines
> svn: Inconsistent line ending style
> $ echo $?
> 1
> foad@debian:~/qqq$ svn st file.txt
> A      file.txt
>
> So the "svn add" command has returned with an exit status of 1,
> indicating failure, but it has succeeded in adding the file. This
> seems wrong.
>
> It is particularly annoying if you "svn add" a long list of files,
> some of which have inconsistent line endings. You have to re-run the
> same command many times to get it to succeed, because it will stop
> with an error each time it gets to an inconsistent file, but the next
> time you run it it will get further.

This is filed as

http://subversion.tigris.org/issues/show_bug.cgi?id=2713

and

http://subversion.tigris.org/issues/show_bug.cgi?id=2925

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

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