Re: [fossil-users] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Stephan Beal
On Wed, Oct 5, 2011 at 11:20 PM, Matt Welland estifo...@gmail.com wrote:

 fossil: unable to open file /tmp/mrwellan/testing/test/foo.txt for
 writing

 The remainder of the message confused the developer (and me for that
 matter).


chmod 0644 foo.txt

:-?

or rm?

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Matt Welland
On Thu, Oct 6, 2011 at 12:07 AM, Stephan Beal sgb...@googlemail.com wrote:

 On Wed, Oct 5, 2011 at 11:20 PM, Matt Welland estifo...@gmail.com wrote:

 fossil: unable to open file /tmp/mrwellan/testing/test/foo.txt for
 writing

 The remainder of the message confused the developer (and me for that
 matter).


 chmod 0644 foo.txt

 :-?

 or rm?


Of course it is easy to fix. But why expose your users to all the
distracting and irrelevant junk in the error message? If possible report the
fact that the file can't be opened and stop.

The end user was confused by the message and resorted to asking me to figure
it out and even I was confused  by the message for a few minutes.

My suggestion to fossil developers is to keep the errors from fossil clean
and relevant. But it is only a suggestion.

-- 
 - stephan beal
 http://wanderinghorse.net/home/stephan/

 ___
 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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Stephan Beal
On Thu, Oct 6, 2011 at 6:28 PM, Matt Welland estifo...@gmail.com wrote:

 Of course it is easy to fix. But why expose your users to all the
 distracting and irrelevant junk in the error message? If possible report the
 fact that the file can't be opened and stop.

 The end user was confused by the message and resorted to asking me to
 figure it out and even I was confused  by the message for a few minutes.


i would have been, too.


 My suggestion to fossil developers is to keep the errors from fossil clean
 and relevant. But it is only a suggestion.


If you can suggest a concrete solution, i'll take a look at implementing it.
i'm not familiar with that particular code, so an immediate plan doesn't
spring to mind. Can you do a mock-up fossil session which demonstrates what
a user should see in that case?

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Stephan Beal
On Thu, Oct 6, 2011 at 7:03 PM, Matt Welland estifo...@gmail.com wrote:

 UPDATE undo SET content=:c, existsflag=1, isExe=0, isLink=0 redoflag=NOT
 redoflag WHERE pathname='foo.txt'


what version are you using? The current code has a command between isLink=0
redoflag...

db_prepare(q,
   UPDATE undo SET content=:c, existsflag=%d, isExe=%d, isLink=%d,
  redoflag=NOT redoflag
WHERE pathname=%Q,
   new_exists, new_exe, new_link, zPathname
);

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Stephan Beal
On Thu, Oct 6, 2011 at 7:21 PM, Stephan Beal sgb...@googlemail.com wrote:

 what version are you using? The current code has a command between isLink=0
 redoflag...


command == comma, of course

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Richard Hipp
On Wed, Oct 5, 2011 at 4:16 PM, Matt Welland estifo...@gmail.com wrote:

 Rolling back prior filesystem changes...
 UNDO foo.txt
 fossil: SQLITE_ERROR: near redoflag: syntax error
 fossil: near redoflag: syntax error
 UPDATE undo SET content=:c, existsflag=1, isExe=0, isLink=0 redoflag=NOT
 redoflag WHERE pathname='foo.txt'


The problem was fixed here:

www.fossil-scm.org/fossil/ci/be956c3c88fd

This fix should be in version 1.19.






 ___
 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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Matt Welland
Ah, cool!! I assumed the SQLITE error was somehow related to the
non-writablitiy of the file. I'll read more carefully and dig a little
deeper next time so the feedback can be of higher quality.

On Thu, Oct 6, 2011 at 10:27 AM, Richard Hipp d...@sqlite.org wrote:



 On Wed, Oct 5, 2011 at 4:16 PM, Matt Welland estifo...@gmail.com wrote:

 Rolling back prior filesystem changes...
 UNDO foo.txt
 fossil: SQLITE_ERROR: near redoflag: syntax error
 fossil: near redoflag: syntax error
 UPDATE undo SET content=:c, existsflag=1, isExe=0, isLink=0 redoflag=NOT
 redoflag WHERE pathname='foo.txt'


 The problem was fixed here:

 www.fossil-scm.org/fossil/ci/be956c3c88fd

 This fix should be in version 1.19.






 ___
 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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Matt Welland
Hmmm I have 1.19 but still see the problem since I built from source
before it was released? It might be a little clearer to ensure the 1.19 is
only in the files from the checkin prior to the release.

chlr11723 fossil version
This is fossil version 1.19 [24c16584cc] 2011-08-26 14:59:43 UTC

But:

chlr11723 strings ~/bin/fossil | grep 'UPDATE undo SET content'
UPDATE undo SET content=:c, existsflag=%d, isExe=%d, isLink=%d redoflag=NOT
redoflag WHERE pathname=%Q

===
BTW: I edited the binary (just replaced the space with a comma) and as
expected it works fine:

chlr11723 ./fossil update
Autosync:  file:///tmp/mrwellan/testing/test2.fossil
Bytes  Cards  Artifacts Deltas
Sent: 130  1  0  0
Received: 354  8  0  0
Total network traffic: 245 bytes sent, 445 bytes received
UPDATE foo.txt
./fossil: unable to open file /tmp/mrwellan/testing/test/foo.txt for
writing
Rolling back prior filesystem changes...
UNDO foo.txt
chlr11723

On Thu, Oct 6, 2011 at 10:34 AM, Matt Welland estifo...@gmail.com wrote:

 Ah, cool!! I assumed the SQLITE error was somehow related to the
 non-writablitiy of the file. I'll read more carefully and dig a little
 deeper next time so the feedback can be of higher quality.


 On Thu, Oct 6, 2011 at 10:27 AM, Richard Hipp d...@sqlite.org wrote:



 On Wed, Oct 5, 2011 at 4:16 PM, Matt Welland estifo...@gmail.com wrote:

 Rolling back prior filesystem changes...
 UNDO foo.txt
 fossil: SQLITE_ERROR: near redoflag: syntax error
 fossil: near redoflag: syntax error
 UPDATE undo SET content=:c, existsflag=1, isExe=0, isLink=0 redoflag=NOT
 redoflag WHERE pathname='foo.txt'


 The problem was fixed here:

 www.fossil-scm.org/fossil/ci/be956c3c88fd

 This fix should be in version 1.19.






 ___
 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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Dmitry Chestnykh
On Oct 6, 2011, at 19:03 , Matt Welland wrote:

 fossil: SQLITE_ERROR: near redoflag: syntax error
 fossil: near redoflag: syntax error
 UPDATE undo SET content=:c, existsflag=1, isExe=0, isLink=0 redoflag=NOT 
 redoflag WHERE pathname='foo.txt'

Is this from later trunk version? I fixed this error a few weeks before.

--
Dmitry Chestnykh

___
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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Stephan Beal
On Thu, Oct 6, 2011 at 7:34 PM, Matt Welland estifo...@gmail.com wrote:

 carefully and dig a little deeper next time so the feedback can be of
 higher quality.


LOL! That is quite possibly the best please excuse me i've ever seen
posted on a list. That one's of put-it-on-a-t-shirt quality. :)

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Dmitry Chestnykh
On Oct 6, 2011, at 19:49 , Matt Welland wrote:

 Hmmm I have 1.19 but still see the problem since I built from source 
 before it was released? It might be a little clearer to ensure the 1.19 is 
 only in the files from the checkin prior to the release.
 
 chlr11723 fossil version
 This is fossil version 1.19 [24c16584cc] 2011-08-26 14:59:43 UTC

The released version (from Downloads page) is:
This is fossil version 1.19 [6517b5c857] 2011-09-01 18:25:19 UTC

 BTW: I edited the binary (just replaced the space with a comma) and as 
 expected it works fine:

Nice patch! :-) If you use symlinks, though, there are a few more fixes for 
them, so you may want to recompile from trunk. If not, I think this version is 
fine.

--
Dmitry Chestnykh

___
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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-06 Thread Stephan Beal
On Thu, Oct 6, 2011 at 7:34 PM, Matt Welland estifo...@gmail.com wrote:

 Ah, cool!! I assumed the SQLITE error was somehow related to the
 non-writablitiy of the file.


BTW: the file was not updated because fossil bailed out because of the SQL
error. From a user's perspective, the SQL error might not have seemed fatal,
and therefore not the source of the problem (i.e. your reaction was
perfectly understandable, IMO), but fossil always fails fast - if you ever
see it emit an error, then it aborted whatever it was trying to do (before
it changes anything, more often than not, though a checkout could
theoretically fail and still update some of the files).

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-05 Thread Dmitry Chestnykh
 A developer accidentally (and naively) checked in a file with no write 
 permissions.
 
 On changing the file and checking it in others could not do an update and 
 would get something like this:
 
  fossil update
 UPDATE foo.txt
 fossil: unable to open file /tmp/mrwellan/testing/test/foo.txt for writing
 Rolling back prior filesystem changes...
 UNDO foo.txt
 fossil: SQLITE_ERROR: near redoflag: syntax error
 fossil: near redoflag: syntax error
 UPDATE undo SET content=:c, existsflag=1, isExe=0, isLink=0 redoflag=NOT 
 redoflag WHERE pathname='foo.txt'

Fossil doesn't track permissions apart from executable bit (and symlink bit in 
trunk), so I'm not sure how it's even possible to get a file from the repo 
without write permissions:

The optional 3rd argument defines any special access permissions associated 
with the file. The only special code currently defined is x which means that 
the file is executable. All files are always readable and writable. This can be 
expressed by w permission if desired but is optional.

http://www.fossil-scm.org/index.html/doc/trunk/www/fileformat.wiki

--
Dmitry Chestnykh

___
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] fossil should know to open up perms on a file prior to update if no write access.

2011-10-05 Thread Matt Welland
My description was a bit off. The developer who initially checked in the
file without write permission is the one who cannot do the update. The
problem is not that fossil is storing or handling the perms wrong. The issue
is that a controlled file with no write permission causes fossil to barf on
an update.

It would have been fine if only the initial message was displayed:

fossil: unable to open file /tmp/mrwellan/testing/test/foo.txt for
writing

The remainder of the message confused the developer (and me for that
matter).

Matt
-=-
On Wed, Oct 5, 2011 at 1:25 PM, Dmitry Chestnykh dmi...@codingrobots.comwrote:

  A developer accidentally (and naively) checked in a file with no write
 permissions.
 
  On changing the file and checking it in others could not do an update and
 would get something like this:
 
   fossil update
  UPDATE foo.txt
  fossil: unable to open file /tmp/mrwellan/testing/test/foo.txt for
 writing
  Rolling back prior filesystem changes...
  UNDO foo.txt
  fossil: SQLITE_ERROR: near redoflag: syntax error
  fossil: near redoflag: syntax error
  UPDATE undo SET content=:c, existsflag=1, isExe=0, isLink=0 redoflag=NOT
 redoflag WHERE pathname='foo.txt'

 Fossil doesn't track permissions apart from executable bit (and symlink bit
 in trunk), so I'm not sure how it's even possible to get a file from the
 repo without write permissions:

 The optional 3rd argument defines any special access permissions
 associated with the file. The only special code currently defined is x
 which means that the file is executable. All files are always readable and
 writable. This can be expressed by w permission if desired but is
 optional.

 http://www.fossil-scm.org/index.html/doc/trunk/www/fileformat.wiki

 --
 Dmitry Chestnykh

 ___
 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