Re: [fossil-users] How to gdiff two versions of a file?
On Wed, 02 Nov 2011 04:23:20 +0100, Gilles gilles.gana...@free.fr wrote: C:\Projectsfossil gdiff --from d4980ff4a7 --to 7c50b63ab5 Project1/Form1.vb = WinMerge opens, but files aren't displayed. Is there a way to check what parameters Fossil uses to call the gdiffer? Does it create two temporary names before calling the gdiffer, eg. with... gdiff-command=C:/Program Files/WinMerge/WinMergeU.exe ... it would simply do something like this: C:/Program Files/WinMerge/WinMergeU.exe file1 file2 ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] Getting a binary artifact
I've just tried: fossil artifact c06ece1cc56e4713435c0bd1f1b70627248b4b6b file.png And this outputs only 8 bytes of the png file. Maybe the artifact command assumes a text output? Regards, Lluís. ___ 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] Getting a binary artifact
On Wed, Nov 02, 2011 at 01:00:50PM +0100, Eduardo Morras wrote: Sorry to contact you directly Lluis, i can receive mail form list but can't post (my isp blacklisted this list) Weird. How could that happen? At 12:19 02/11/2011, Lluís Batlle i Rossell wrote: I've just tried: fossil artifact c06ece1cc56e4713435c0bd1f1b70627248b4b6b file.png And this outputs only 8 bytes of the png file. Maybe the artifact command assumes a text output? Do a cat file.png The filename 'file.png' has 8 bytes, perhaps you are getting only the filename. No no, the file has more bytes: $ wc -l file.png 12583 file.png $ sha1sum file.png 449e8639f9889bbff781ed916a49cb8394110f77 file.png $ fossil artifact 449e8639f9889bbff781ed916a49cb8394110f77 | wc -l 8 What do you think? ___ 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] Getting a binary artifact
2011/11/2 Lluís Batlle i Rossell virik...@gmail.com: On Wed, Nov 02, 2011 at 01:00:50PM +0100, Eduardo Morras wrote: Sorry to contact you directly Lluis, i can receive mail form list but can't post (my isp blacklisted this list) Weird. How could that happen? At 12:19 02/11/2011, Lluís Batlle i Rossell wrote: I've just tried: fossil artifact c06ece1cc56e4713435c0bd1f1b70627248b4b6b file.png And this outputs only 8 bytes of the png file. Maybe the artifact command assumes a text output? Do a cat file.png The filename 'file.png' has 8 bytes, perhaps you are getting only the filename. No no, the file has more bytes: $ wc -l file.png 12583 file.png $ sha1sum file.png 449e8639f9889bbff781ed916a49cb8394110f77 file.png $ fossil artifact 449e8639f9889bbff781ed916a49cb8394110f77 | wc -l 8 What do you think? ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users The artifact command uses fossil_puts to display the contents. Fossil puts uses strlen to determine the number of chars to be written. So for binary files with embedded nulls this will fail. Using fossil_puts in this case is arguably a mistake as it also does encoding conversion. You can work around it by providing a filename with the artifact command. Mark ___ 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] Getting a binary artifact
On Wed, Nov 2, 2011 at 2:35 PM, Mark Janssen mpc.jans...@gmail.com wrote: 2011/11/2 Lluís Batlle i Rossell virik...@gmail.com: On Wed, Nov 02, 2011 at 01:00:50PM +0100, Eduardo Morras wrote: Sorry to contact you directly Lluis, i can receive mail form list but can't post (my isp blacklisted this list) Weird. How could that happen? At 12:19 02/11/2011, Lluís Batlle i Rossell wrote: I've just tried: fossil artifact c06ece1cc56e4713435c0bd1f1b70627248b4b6b file.png And this outputs only 8 bytes of the png file. Maybe the artifact command assumes a text output? Do a cat file.png The filename 'file.png' has 8 bytes, perhaps you are getting only the filename. No no, the file has more bytes: $ wc -l file.png 12583 file.png $ sha1sum file.png 449e8639f9889bbff781ed916a49cb8394110f77 file.png $ fossil artifact 449e8639f9889bbff781ed916a49cb8394110f77 | wc -l 8 What do you think? ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users The artifact command uses fossil_puts to display the contents. Fossil puts uses strlen to determine the number of chars to be written. So for binary files with embedded nulls this will fail. Using fossil_puts in this case is arguably a mistake as it also does encoding conversion. You can work around it by providing a filename with the artifact command. Mark Following patch fixes the issue. Index: src/blob.c == --- src/blob.c +++ src/blob.c @@ -766,12 +766,11 @@ int blob_write_to_file(Blob *pBlob, const char *zFilename){ FILE *out; int wrote; if( zFilename[0]==0 || (zFilename[0]=='-' zFilename[1]==0) ){ -fossil_puts(blob_str(pBlob), 0); -return blob_size(pBlob); +return write(1, blob_str(pBlob) , blob_size(pBlob)); }else{ int i, nName; char *zName, zBuf[1000]; nName = strlen(zFilename); ___ 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] Getting a binary artifact
On Wed, Nov 2, 2011 at 9:41 AM, Mark Janssen mpc.jans...@gmail.com wrote: Following patch fixes the issue. This fixes viriketo's specific complaint, but it also creates a bunch of new problems for people running windows with non-UTF character sets. Index: src/blob.c == --- src/blob.c +++ src/blob.c @@ -766,12 +766,11 @@ int blob_write_to_file(Blob *pBlob, const char *zFilename){ FILE *out; int wrote; if( zFilename[0]==0 || (zFilename[0]=='-' zFilename[1]==0) ){ -fossil_puts(blob_str(pBlob), 0); -return blob_size(pBlob); +return write(1, blob_str(pBlob) , blob_size(pBlob)); }else{ int i, nName; char *zName, zBuf[1000]; nName = strlen(zFilename); ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users -- D. Richard Hipp d...@sqlite.org ___ 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] Getting a binary artifact
On Wed, Nov 2, 2011 at 3:02 PM, Richard Hipp d...@sqlite.org wrote: On Wed, Nov 2, 2011 at 9:41 AM, Mark Janssen mpc.jans...@gmail.com wrote: Following patch fixes the issue. This fixes viriketo's specific complaint, but it also creates a bunch of new problems for people running windows with non-UTF character sets. Index: src/blob.c == --- src/blob.c +++ src/blob.c @@ -766,12 +766,11 @@ int blob_write_to_file(Blob *pBlob, const char *zFilename){ FILE *out; int wrote; if( zFilename[0]==0 || (zFilename[0]=='-' zFilename[1]==0) ){ - fossil_puts(blob_str(pBlob), 0); - return blob_size(pBlob); + return write(1, blob_str(pBlob) , blob_size(pBlob)); }else{ int i, nName; char *zName, zBuf[1000]; nName = strlen(zFilename); ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users -- D. Richard Hipp d...@sqlite.org ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users Without wanting to open a huge can of worms, IMHO a DVCS should return artifacts unmodified (e.g. treat everything as a binary file). In my experience any automatic conversions are fragile and promote sloppiness and it quickly leads to the mess of guessing if an artifact is binary or text. If the encoding of a source file matters for non-UTF windows users they should store the file in the encoding that works for them or use ASCII only options to store non-ASCII chars (\u... for example). Mark ___ 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] Getting a binary artifact
On Wed, Nov 2, 2011 at 10:13 AM, Mark Janssen mpc.jans...@gmail.com wrote: Without wanting to open a huge can of worms, IMHO a DVCS should return artifacts unmodified (e.g. treat everything as a binary file). And Fossil does exactly that. It preserves all files exactly. But in many parts of the world, when you are running windows, you have to convert characters for display on the console. So, the generic routine for displaying text on the console - the routine that you modified - needs to convert to whatever character codes are used by the locale setting. Note that Fossil assumes that standard output is going to a console, not to a file. Conversions are appropriate on standard output. If you specify the filename for the artifact as the 3rd argument: fossil artifact abc123 somefile.jpg Then no conversions will occur. Only if you redirect standard output to a file: fossil artifact abc123 somefile.jpg Only then do conversions happen. And even then, the conversions only happen on windows - the two command give identical results on unix. The conversion of character encodings on standard output is necessary for international windows users. I agree that it is goofy, but that is the way it has to be. Fuss at Bill Gates, not me. In my experience any automatic conversions are fragile and promote sloppiness and it quickly leads to the mess of guessing if an artifact is binary or text. If the encoding of a source file matters for non-UTF windows users they should store the file in the encoding that works for them or use ASCII only options to store non-ASCII chars (\u... for example). Mark ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users -- D. Richard Hipp d...@sqlite.org ___ 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] Getting a binary artifact
On Wed, Nov 02, 2011 at 10:38:10AM -0400, Richard Hipp wrote: On Wed, Nov 2, 2011 at 10:13 AM, Mark Janssen mpc.jans...@gmail.com wrote: If you specify the filename for the artifact as the 3rd argument: fossil artifact abc123 somefile.jpg Then no conversions will occur. Only if you redirect standard output to a file: fossil artifact abc123 somefile.jpg Only then do conversions happen. And even then, the conversions only happen on windows - the two command give identical results on unix. I was on linux, the results were not identical. ___ 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] Getting a binary artifact
2011/11/2 Lluís Batlle i Rossell virik...@gmail.com I was on linux, the results were not identical. OK. I put in a patch to fix this. http://www.fossil-scm.org/fossil/ci/83a574b019?sbs=1 -- D. Richard Hipp d...@sqlite.org ___ 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] Getting a binary artifact
On Wed, Nov 02, 2011 at 11:24:37AM -0400, Richard Hipp wrote: 2011/11/2 Lluís Batlle i Rossell virik...@gmail.com I was on linux, the results were not identical. OK. I put in a patch to fix this. http://www.fossil-scm.org/fossil/ci/83a574b019?sbs=1 Thank you! ___ 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] How to gdiff two versions of a file?
On Wed, Nov 2, 2011 at 6:16 AM, Gilles gilles.gana...@free.fr wrote: On Wed, 02 Nov 2011 04:23:20 +0100, Gilles gilles.gana...@free.fr wrote: C:\Projectsfossil gdiff --from d4980ff4a7 --to 7c50b63ab5 Project1/Form1.vb = WinMerge opens, but files aren't displayed. Is there a way to check what parameters Fossil uses to call the gdiffer? Create a batch script with the line: echo %1% %2% %3% %4% %5% %6% %7% %8% %9% ___ 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] Getting a binary artifact
On Wed, Nov 2, 2011 at 3:38 PM, Richard Hipp d...@sqlite.org wrote: On Wed, Nov 2, 2011 at 10:13 AM, Mark Janssen mpc.jans...@gmail.com wrote: Without wanting to open a huge can of worms, IMHO a DVCS should return artifacts unmodified (e.g. treat everything as a binary file). And Fossil does exactly that. It preserves all files exactly. But in many parts of the world, when you are running windows, you have to convert characters for display on the console. So, the generic routine for displaying text on the console - the routine that you modified - needs to convert to whatever character codes are used by the locale setting. Note that Fossil assumes that standard output is going to a console, not to a file. Conversions are appropriate on standard output. I agree that console output for windows users for example of commit messages should be readable regardless of system encoding. I still think conversions are not appropriate for output of fossil artifact (you are asking for the artifact verbatim) This is also why I made the change in blob_write_to_file and not in fossil_puts. As I windows user myself, I expected fossil artifact uuid file to work. I would not be surprised if fossil wrappers use this on windows to display specific artifacts. Mark ___ 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] Getting a binary artifact
On Wed, Nov 2, 2011 at 2:27 PM, Mark Janssen mpc.jans...@gmail.com wrote: On Wed, Nov 2, 2011 at 3:38 PM, Richard Hipp d...@sqlite.org wrote: On Wed, Nov 2, 2011 at 10:13 AM, Mark Janssen mpc.jans...@gmail.com wrote: Without wanting to open a huge can of worms, IMHO a DVCS should return artifacts unmodified (e.g. treat everything as a binary file). And Fossil does exactly that. It preserves all files exactly. But in many parts of the world, when you are running windows, you have to convert characters for display on the console. So, the generic routine for displaying text on the console - the routine that you modified - needs to convert to whatever character codes are used by the locale setting. Note that Fossil assumes that standard output is going to a console, not to a file. Conversions are appropriate on standard output. I agree that console output for windows users for example of commit messages should be readable regardless of system encoding. I still think conversions are not appropriate for output of fossil artifact (you are asking for the artifact verbatim) This is also why I made the change in blob_write_to_file and not in fossil_puts. As I windows user myself, I expected fossil artifact uuid file to work. I would not be surprised if fossil wrappers use this on windows to display specific artifacts. But, if you requested the output of a text artifact, you would probably also expect to be able to read the artifact if it appeared on standard output, I suspect. With the patch I put in, you can now have both. On windows, it uses _isatty() to determine if the content is going to the console or to a file, and only converts if it is going to the console. Mark ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users -- D. Richard Hipp d...@sqlite.org ___ 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] Getting a binary artifact
On Wed, Nov 2, 2011 at 7:32 PM, Richard Hipp d...@sqlite.org wrote: On Wed, Nov 2, 2011 at 2:27 PM, Mark Janssen mpc.jans...@gmail.com wrote: On Wed, Nov 2, 2011 at 3:38 PM, Richard Hipp d...@sqlite.org wrote: On Wed, Nov 2, 2011 at 10:13 AM, Mark Janssen mpc.jans...@gmail.com wrote: Without wanting to open a huge can of worms, IMHO a DVCS should return artifacts unmodified (e.g. treat everything as a binary file). And Fossil does exactly that. It preserves all files exactly. But in many parts of the world, when you are running windows, you have to convert characters for display on the console. So, the generic routine for displaying text on the console - the routine that you modified - needs to convert to whatever character codes are used by the locale setting. Note that Fossil assumes that standard output is going to a console, not to a file. Conversions are appropriate on standard output. I agree that console output for windows users for example of commit messages should be readable regardless of system encoding. I still think conversions are not appropriate for output of fossil artifact (you are asking for the artifact verbatim) This is also why I made the change in blob_write_to_file and not in fossil_puts. As I windows user myself, I expected fossil artifact uuid file to work. I would not be surprised if fossil wrappers use this on windows to display specific artifacts. But, if you requested the output of a text artifact, you would probably also expect to be able to read the artifact if it appeared on standard output, I suspect. Nope, I would expect the artifact without changes, if I want a readable interpretation I would look for something like fossil cat or fossil artifact-as-readable-in-my-encoding. With the patch I put in, you can now have both. On windows, it uses _isatty() to determine if the content is going to the console or to a file, and only converts if it is going to the console. Mark ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users -- D. Richard Hipp d...@sqlite.org ___ 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] Getting a binary artifact
On 2011-11-02, at 14:32, Richard Hipp d...@sqlite.org wrote: On Wed, Nov 2, 2011 at 2:27 PM, Mark Janssen mpc.jans...@gmail.com wrote: On Wed, Nov 2, 2011 at 3:38 PM, Richard Hipp d...@sqlite.org wrote: On Wed, Nov 2, 2011 at 10:13 AM, Mark Janssen mpc.jans...@gmail.com wrote: Without wanting to open a huge can of worms, IMHO a DVCS should return artifacts unmodified (e.g. treat everything as a binary file). And Fossil does exactly that. It preserves all files exactly. But in many parts of the world, when you are running windows, you have to convert characters for display on the console. So, the generic routine for displaying text on the console - the routine that you modified - needs to convert to whatever character codes are used by the locale setting. Note that Fossil assumes that standard output is going to a console, not to a file. Conversions are appropriate on standard output. I agree that console output for windows users for example of commit messages should be readable regardless of system encoding. I still think conversions are not appropriate for output of fossil artifact (you are asking for the artifact verbatim) This is also why I made the change in blob_write_to_file and not in fossil_puts. As I windows user myself, I expected fossil artifact uuid file to work. I would not be surprised if fossil wrappers use this on windows to display specific artifacts. But, if you requested the output of a text artifact, you would probably also expect to be able to read the artifact if it appeared on standard output, I suspect. May be, i'm not sure what artifact really mean. But I think that If a file is flagged as binary, conversion should never happens anyway. With the patch I put in, you can now have both. On windows, it uses _isatty() to determine if the content is going to the console or to a file, and only converts if it is going to the console. -- Martin G. ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users