Re: [fossil-users] Developing on Unix and Windows

2009-10-25 Thread Michael Richter
2009/10/24 altufa...@mail.com

 Last time I used vi, it showed ^M at end of each line... does the new
 version classify files as DOS/Unix and handles edits correctly?


vim (the most common vi variant in use nowadays) is incredibly
configurable.  I guarantee you that there's an option for handling pretty
much anything at the end of line.

Using the online help (*:help*, followed by */DOS*) might give you some
insight.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Developing on Unix and Windows

2009-10-24 Thread altufaltu
Last time I used vi, it showed ^M at end of each line... does the new version 
classify files as DOS/Unix and handles edits correctly?


- Altu


-Original Message-
From: Stephen De Gabrielle spdegabrie...@gmail.com
To: fossil-users@lists.fossil-scm.org
Sent: Fri, Oct 23, 2009 1:44 pm
Subject: Re: [fossil-users] Developing on Unix and Windows







vi
emacs

s.
On Fri, Oct 23, 2009 at 8:09 AM,  altufa...@mail.com wrote:
 I'm not much familiar with editors in unix. Are there good editors in
 unix that handle \r\n correctly?

 - Altu

 -Original Message-
 From: Joshua Paine jos...@letterblock.com
 To: fossil-users@lists.fossil-scm.org
 Sent: __aolWsbDateToL10n__Wed, 21 Oct 2009 11:42:47
 -0400__aolWsbDateToL10n__
 Subject: Re: [fossil-users] Developing on Unix and Windows

 On Wed, 2009-10-21 at 17:09 +0200, Ramon Ribó wrote:
   1- A TCL file is checked in on windows
   2- It is checked out on unix and line ending is \r\n

 When the file is created on Windows, it should be created using unix
 line endings. This is very easy to do in most editors. You can just set
 it as your default and no one gets hurt. Everything except Notepad can
 view it fine.

   1- I create a nice README or License file for my application in unix
   3- README files are open by the user (not by my that I use a
 wonderful
  convert-all editor). In Windows, they typically open with
 Notepad.
   4- The file is viewed as with one very long line

 Since your end users are not likely to checkout your code from fossil, I
 don't think fossil's behavior is very relevant here. Either create your
 README with windows line endings, or add some kind of conversion into
 your build process when you produce packages for end users.

 For source code, my experience is that unix endings work everywhere for
 running or viewing--except windows notepad. If there is any language
 available on both windows and linux where a file will run/compile on
 windows if it has windows endings *but not* if it has unix endings and
 likewise will run on linux only with unix endings, then I have some
 sympathy for your plight. Frankly, though, probably not enough that I
 would want to see such an ugly feature built into fossil.

 --
 Joshua Paine
 LetterBlock: Web applications built with joy
 http://letterblock.com/
 301-576-1920

 ___
 fossil-users mailing list
 fossil-users@lists.fossil-scm.org
 http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


 ___
 fossil-users mailing list
 fossil-users@lists.fossil-scm.org
 http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users




-- 

--
Stephen De Gabrielle
stephen.degabrie...@acm.org
Telephone +44 (0)20 85670911
Mobile+44 (0)79 85189045
http://www.degabrielle.name/stephen
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


 




___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Developing on Unix and Windows

2009-10-24 Thread Rüdiger Härtel
Am Samstag 24 Oktober 2009 schrieb Dmitry Chestnykh:
 Hi,

 Instead of making Fossil call filters, why not create scripts that
 call Fossil?

 my_commit:

 #!/bin/sh
 run_filter
 fossil commit %@

 my_checkout:

 #!/bin/sh
 fossil checkout %@
 run_filter


Yes, that also would be a solution.

Ruediger
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Developing on Unix and Windows

2009-10-23 Thread altufaltu
My proposal is to use an editor that is aware of DOS and UNIX line 
endings.

- Altu


-Original Message-
From: Ramon Ribó ram...@compassis.com
To: fossil-users@lists.fossil-scm.org
Sent: __aolWsbDateToL10n__Wed, 21 Oct 2009 16:36:47 
+0200__aolWsbDateToL10n__
Subject: Re: [fossil-users] Developing on Unix and Windows

  Hello,

   The conversion of line endings does not affect at all to its sha1 
checksum
as it is only an input/output filter. The internal representation of
the file inside
fossil continues to be unique.

   Some files need conversion and some other no. In cvs, when adding a 
file
it is necessary to specify for every file if it is ascii or not. This
property is stored
with the file. An alternative could be that the user defined some
extensions that
need filtering. For example:

fossil settings ascii-extensions .tcl .c .cc

  The problem is that, if fossil does not provide some facility for
this, it is very
difficult or impossible to implement the solution externally to fossil
as an script
or something.

In any case, what is your proposal for using fossil to manage a 
program
both in unix and windows?


2009/10/21 D. Richard Hipp d...@hwaci.com:

 On Oct 21, 2009, at 7:57 AM, Ramon Ribó wrote:

  Hello,

  When developing the same program on Unix and on Windows, cvs
 automatically converts the line
 end of the files to the appropriates for every platform. In this way,
 if we commit a file in windows that
 contains \r\n as line ends, we can checkout this file on unix and 
it
 will have \n line ends.

  As I see, fossil does not change the line endings of the ascii
 files. If we try to work as is, I see several
 problems, for example, scripts begin with #! on unix do not work if
 they have \r\n as line end

  What is the opinion of the fossil users  developers on this? What
 is the suggested method for developing
 the same program in both unix and windows? will fossil be modified in
 the future to contain an automatic
 translation of line endings?


 Fossil was designed with file integrity in mind.  The identifier for a
 file is its SHA1 checksum.  If you start changing line-endings, that
 changes the SHA1 checksum, and the identity of the file.

 Furthermore, some file formats are broken by changing line endings.
 Certainly most binary file formats (GIFs, JPEGs) cannot tolerate line-
 ending changes.  But even some text formats (for example the fossil
 manifest file) require a specific line ending.


 D. Richard Hipp
 d...@hwaci.com



 ___
 fossil-users mailing list
 fossil-users@lists.fossil-scm.org
 http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Developing on Unix and Windows

2009-10-21 Thread Michael McDaniel
On Wed, Oct 21, 2009 at 01:57:36PM +0200, Ramon Ribó wrote:
   Hello,
 
   When developing the same program on Unix and on Windows, cvs
 automatically converts the line
 end of the files to the appropriates for every platform. In this way,
 if we commit a file in windows that
 contains \r\n as line ends, we can checkout this file on unix and it
 will have \n line ends.
 
   As I see, fossil does not change the line endings of the ascii
 files. If we try to work as is, I see several
 problems, for example, scripts begin with #! on unix do not work if
 they have \r\n as line end
 
   What is the opinion of the fossil users  developers on this? What
 is the suggested method for developing
 the same program in both unix and windows? will fossil be modified in
 the future to contain an automatic
 translation of line endings?
___

 I can see where an explicit flag, say  --convert-eol, which changes
 the end of line according to platform,  could be convenient.  Maybe
 allow vars in 'fossil settings' to explicitly configure the eol you
 want.

 I would definitely not want default behaviour to change any
 file.

~Michael
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Developing on Unix and Windows

2009-10-21 Thread D. Richard Hipp

On Oct 21, 2009, at 10:36 AM, Ramon Ribó wrote:

   In any case, what is your proposal for using fossil to manage a  
 program
 both in unix and windows?


Simple: Use a text editor on windows that understands \n-only line  
endings.  I understand that they are plentiful.

D. Richard Hipp
d...@hwaci.com



___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Developing on Unix and Windows

2009-10-21 Thread Joshua Paine
On Wed, 2009-10-21 at 16:36 +0200, Ramon Ribó wrote:
In any case, what is your proposal for using fossil to manage a program
 both in unix and windows?

Use a competent text editor? Essentially every text editor meant for
programmers can trivially convert line endings or edit in either mode.

I'm all-Linux now, but when I developed on Windows I just set my editor
to use unix line endings.

-- 
Joshua Paine  
LetterBlock: Web applications built with joy  
http://letterblock.com/  
301-576-1920

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Developing on Unix and Windows

2009-10-21 Thread Ramon Ribó
  Please, do not oversimplify the situation. Just one example:

  1- A TCL file is checked in on windows

  2- It is checked out on unix and line ending is \r\n

  3- Many TCL files start with:

#!/bin/sh
# the next line restarts using wish \
exec wish $0 $@

  4- chmod +x $file

  5- This file is NOT going to execute on Unix

Second example:

  1- I create a nice README or License file for my application in unix

  2- I checkout in Windows

  3- README files are open by the user (not by my that I use a wonderful
 convert-all editor). In Windows, they typically open with Notepad.

  4- The file is viewed as with one very long line


  I am sure that I can find much more examples.



2009/10/21 Joshua Paine jos...@letterblock.com:
 On Wed, 2009-10-21 at 16:36 +0200, Ramon Ribó wrote:
    In any case, what is your proposal for using fossil to manage a program
 both in unix and windows?

 Use a competent text editor? Essentially every text editor meant for
 programmers can trivially convert line endings or edit in either mode.

 I'm all-Linux now, but when I developed on Windows I just set my editor
 to use unix line endings.

 --
 Joshua Paine
 LetterBlock: Web applications built with joy
 http://letterblock.com/
 301-576-1920

 ___
 fossil-users mailing list
 fossil-users@lists.fossil-scm.org
 http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Developing on Unix and Windows

2009-10-21 Thread Ramon Ribó
 Frankly, though, probably not enough that I
 would want to see such an ugly feature built into fossil.

I also like beautiful things and hate ugly things. But life is
sometimes difficult and it is better to fix problems instead
of workaround them.

An alternative solution could be:

fossil settings read-write-filter my_proc

where my__proc could be one executable, a shell script or anything
that could be started with start on windows.

It would take 3 arguments: read_or_write, the file name and the contents and
would return the modified contents.

Then, in the tools directory or in contrib it should be possible to provide
several examples of my_proc

A typical script for unix could be:

#!/bin/sh -f

read_write=$1
filename=$2
contents=$3

extension=${filename##*.}

if [ $extension = txt ] ; then
if [ $read_write = read ] ; then
echo $contents | unix2dos
else
echo $contents | dos2unix
fi
else
echo $contents
fi



2009/10/21 Joshua Paine jos...@letterblock.com:
 On Wed, 2009-10-21 at 17:09 +0200, Ramon Ribó wrote:
   1- A TCL file is checked in on windows
   2- It is checked out on unix and line ending is \r\n

 When the file is created on Windows, it should be created using unix
 line endings. This is very easy to do in most editors. You can just set
 it as your default and no one gets hurt. Everything except Notepad can
 view it fine.

   1- I create a nice README or License file for my application in unix
   3- README files are open by the user (not by my that I use a wonderful
      convert-all editor). In Windows, they typically open with Notepad.
   4- The file is viewed as with one very long line

 Since your end users are not likely to checkout your code from fossil, I
 don't think fossil's behavior is very relevant here. Either create your
 README with windows line endings, or add some kind of conversion into
 your build process when you produce packages for end users.

 For source code, my experience is that unix endings work everywhere for
 running or viewing--except windows notepad. If there is any language
 available on both windows and linux where a file will run/compile on
 windows if it has windows endings *but not* if it has unix endings and
 likewise will run on linux only with unix endings, then I have some
 sympathy for your plight. Frankly, though, probably not enough that I
 would want to see such an ugly feature built into fossil.

 --
 Joshua Paine
 LetterBlock: Web applications built with joy
 http://letterblock.com/
 301-576-1920

 ___
 fossil-users mailing list
 fossil-users@lists.fossil-scm.org
 http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users