Re: [fossil-users] fossil artifact not complaining
Guys, thanks for the debate, but the fix for this problem has already been checked in: http://www.fossil-scm.org/fossil/fdiff?v1=36f6acb63&v2=740078778803fa2b It prints "not found: NAME" or "ambiguous name: NAME" as appropriate. -- 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 artifact not complaining
hmm, on Fri, Feb 10, 2012 at 04:08:03PM +0100, Stephan Beal said that > Because i'm pedantic ;). i prefer "could not resolve" because that is > actually what is happening: we are asking the fossil internals to convert > the user-provided symbol name into its internal form (an integer). We are > not asking fossil to search for a specific artifact, only to resolve its > symbolic name into another form. i think we are getting into a linguistic issue here, resolving is searching by its nature :] but i am fine with any verb.. > [stephan@hamsun:~/cvs/fossil/fossil]$ ./fossil artifact abcdcafe > ./fossil: Could not resolve artifact [abcdcafe] > [stephan@hamsun:~/cvs/fossil/fossil]$ echo $? > 1 you called the pedantic card, so i call and raise :] artifact takes as argument symbolic names as well and those are not inside brackets: fossil artifact tip fossil artifact tiptiptip but i see the commit is in already so this thread became academic :] -f -- name a psychological rock group? pink freud! ___ 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 artifact not complaining
hmm, on Fri, Feb 10, 2012 at 07:00:54PM +0400, Konstantin Khomoutov said that > Sorry for another bikeshedding plug, but if we recall how perror() > works, a more Unix-way approach to error reporting whould be reverse > the static and varying parts, so that the error message becomes: > > no such artifact: abcdcafe yes, this is good as well of course :] -f -- after two weeks of dieting, all i lost was two weeks. ___ 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 artifact not complaining
On Fri, Feb 10, 2012 at 3:35 PM, frantisek holop wrote: > how about: > > $ ./fossil artifact abcdcafe > ./fossil: abcdcafe: no such artifact > Because i'm pedantic ;). i prefer "could not resolve" because that is actually what is happening: we are asking the fossil internals to convert the user-provided symbol name into its internal form (an integer). We are not asking fossil to search for a specific artifact, only to resolve its symbolic name into another form. It would be simple to provide the artifact name in the output, in which case i would propose: [stephan@hamsun:~/cvs/fossil/fossil]$ ./fossil artifact abcdcafe ./fossil: Could not resolve artifact [abcdcafe] [stephan@hamsun:~/cvs/fossil/fossil]$ echo $? 1 i prefer that over: ... artifact: abcdcafe because the colon implies that a more specific description follows, and that's not what's happening here. But of course those are just pedantic opinions. i don't feel strongly about it one way or the other. The current patch looks like: [stephan@hamsun:~/cvs/fossil/fossil]$ f diff Index: src/content.c == --- src/content.c +++ src/content.c @@ -322,10 +322,14 @@ const char *zFile; db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); if( g.argc!=4 && g.argc!=3 ) usage("ARTIFACT-ID ?FILENAME? ?OPTIONS?"); zFile = g.argc==4 ? g.argv[3] : "-"; rid = name_to_rid(g.argv[2]); + if(0==rid){ +fossil_fatal("Could not resolve artifact [%s]",g.argv[2]) + /*does not return*/; + } content_get(rid, &content); blob_write_to_file(&content, zFile); } :-? -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___ 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 artifact not complaining
On Fri, 10 Feb 2012 15:35:13 +0100 frantisek holop wrote: > > > I think it should be fixed to a better behaviour (the command to > > > emit an error > > > and not overwrite the file). > > > > > > > i've patched this locally to do: > > > > [stephan@hamsun:~/cvs/fossil/fossil]$ ./fossil artifact abcdcafe > > ./fossil: Could not resolve artifact name/ID. > > how about: > > $ ./fossil artifact abcdcafe > ./fossil: abcdcafe: no such artifact Sorry for another bikeshedding plug, but if we recall how perror() works, a more Unix-way approach to error reporting whould be reverse the static and varying parts, so that the error message becomes: no such artifact: abcdcafe ___ 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 artifact not complaining
hmm, on Fri, Feb 10, 2012 at 02:12:18PM +0100, Stephan Beal said that > 2012/2/10 Lluís Batlle i Rossell > > > I think it should be fixed to a better behaviour (the command to emit an > > error > > and not overwrite the file). > > > > i've patched this locally to do: > > [stephan@hamsun:~/cvs/fossil/fossil]$ ./fossil artifact abcdcafe > ./fossil: Could not resolve artifact name/ID. how about: $ ./fossil artifact abcdcafe ./fossil: abcdcafe: no such artifact -f -- courage is fear that has said its prayers. ___ 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 artifact not complaining
2012/2/10 Lluís Batlle i Rossell > I think it should be fixed to a better behaviour (the command to emit an > error > and not overwrite the file). > i've patched this locally to do: [stephan@hamsun:~/cvs/fossil/fossil]$ ./fossil artifact abcdcafe ./fossil: Could not resolve artifact name/ID. [stephan@hamsun:~/cvs/fossil/fossil]$ echo $? 1 If there are no objections i'll commit it. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] fossil artifact not complaining
Hello, "fossil artifact", if given a wrong artifact, does not complain at all. $ fossil artifact asdfasdfasdf File.hpp $ echo $? 0 This writes (or overwrites) a 0-bytes File.hpp silently. I think it should be fixed to a better behaviour (the command to emit an error and not overwrite the file). 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