Re: [fossil-users] Latest stable release or dev release does not compile with option: --static
On Wed, 30 Jan 2013, Jan Nijtmans wrote: 2013/1/29 Stephan Beal: On Tue, Jan 29, 2013 at 9:00 AM, K. Fossil user wrote: Latest stable release or dev release does not compile with option: --static ... Like networking libs, it will produce warnings like: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking Those are only warnings, the executable should work fine. I tried it, and encountered 2 minor problems on Linux: - strcmp from the static C library cannot be used, it should be replaced by fossil_strcmp everywhere. (that's a good idea anyway, as strcmp is locale-dependant) Fossil's TCL support also appears to use dlopen() [snip] The first problem is fixed now on trunk, the second one should be easy to fix (for someone who understands the build system better than I do). [FYI] An optimized (-O2) default build with entered substitution -Dstrcmp=fossil_strcmp fails (SIGSEG) on i686 GNU/Linux Reading symbols from /home/sg/fossil/build/fossil...done. (gdb) set args clean --force (gdb) run Starting program: /home/sg/fossil/build/fossil clean --force Program received signal SIGSEGV, Segmentation fault. fossil_strcmp (zA=0xb452 force, zB=0x0) at ../src/printf.c:908 908 b = *zB++; (gdb) bt #0 fossil_strcmp (zA=0xb452 force, zB=0x0) at ../src/printf.c:908 #1 0x0808d73c in find_option (zLong=0x815454b quiet, zShort=0x0, hasArg=0) at ../src/main.c:865 #2 0x080902ca in main (argc=3, argv=0xb294) at ../src/main.c:510 (gdb) detach Detaching from program: /home/sg/fossil/build/fossil, process 18084 (gdb) q % ./fossil version This is fossil version 1.25 [7ac0fd9d11] 2013-01-30 10:03:19 UTC The -O0 build does parse the same option without the issue. Sergei ___ 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] Latest stable release or dev release does not compile with option: --static
On Wed, 30 Jan 2013, Jan Nijtmans wrote: 2013/1/30 Richard Hipp wrote: I'm uncomfortable with this change. If we need to use fossil_strcmp() everywhere (which surprises me, since strcmp() should *not* be subject to localization) then we should do so explicitly, and not depend on preprocessor magic, as the preprocessor magic will likely cause maintenance headaches down the road, and/or introduce subtle bugs such as the above. I'm open to other suggestions how to fix this. The problem was noticed on 64-bit Ubuntu, it might be 64-bit specific (I'm not near that machine now). I agree that it would be better to rename strcmp-fossil_strcmp everywhere, but I don't think you want to do that in sqlite as well, therefore I came up with the macro. AFAIS, fossil_strcmp() != strcmp() http://fossil-scm.org/index.html/artifact/eda142ab1e3e0a0213d522c5b7a22831023cab0f?ln=898-902 # plain STRCMP (3) % for i in str{,n}cmp;do echo -n $i - ;grep $i src/*.c|egrep -v (sqlite3|fossil)_$i|wc -l;done strcmp - 143 strncmp - 210 I would undo magic and rename nothing :-) Sergei ___ 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] Latest stable release or dev release does not compile with option: --static
On Wed, 30 Jan 2013, K. Fossil user wrote: People would like to use a DVCS everywhere with any distro with the SAME binary, not the one specific to a distro. First, I do not say that build process for a static executable should fail. But at least such process is not trivial (it was given a lot of reasons here). [FYI] Incidentally, there is another opinion, Never use static linking! http://www.akkadia.org/drepper/no_static_linking.html SYNOPSIS https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Developer_Guide/lib.compatibility.static.html Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] Compile Fossil with Tiny C Compiler
Hi [The below is thanking -static issue] I search through the list for /Fabrice Bellard/ and found nothing. His famous Tiny C Compiler (http://en.wikipedia.org/wiki/Tiny_C_Compiler http://bellard.org/tcc/) is well-known in Tcl community and they know its strengths. I want to share here my 2-minutes experiment (below is cp from a terminal): Make the very virgin environment sg@...:build fossil clean -f sg@...:build ../configure --quiet --json --markdown sg@...:build ccache -Cc Cleared cache Cleaned cache Build Fossil with `tcc' and run it -- sg@...:build time make -s BCC=tcc TCC=tcc ./fossil version ../src/diffcmd.c:290: warning: assignment makes pointer from integer without a cast ../src/diffcmd.c:447: warning: assignment makes pointer from integer without a cast ../src/diffcmd.c:449: warning: assignment makes pointer from integer without a cast ../src/rebuild.c:849: warning: assignment from incompatible pointer type ../src/vfile.c:467: warning: assignment from incompatible pointer type ../src/sqlite3.c:20089: warning: assignment makes pointer from integer without a cast ../src/sqlite3.c:43635: warning: assignment makes pointer from integer without a cast real 0m1.926s user 0m1.776s sys 0m0.680s This is fossil version 1.25 [8027c7e648] 2013-01-30 18:14:26 UTC It took 2 seconds on my laptop and I've got working copy of Fossil! Make again a virgin --- sg@...:build ccache -Cc Cleared cache Cleaned cache sg@...:build make clean rm -rf bld/* fossil Build Fossil with `gcc' (no `ccache') and run it sg@...:build time make -s ./fossil version real 1m8.647s user 1m2.852s sys 0m4.760s This is fossil version 1.25 [8027c7e648] 2013-01-30 18:14:26 UTC Yep, it takes about 1 minute. So, I use `ccache'. Though, no warnings :-) Just clean (but do not break ccache caches) --- sg@...:build make clean rm -rf bld/* fossil Repeat build and run with `gcc' + `ccache' -- sg@...:build time make -s ./fossil version real 0m7.823s user 0m6.016s sys 0m1.784s This is fossil version 1.25 [8027c7e648] 2013-01-30 18:14:26 UTC It took ~8 seconds. What `tcc' I used here -- sg@...:build tcc -v tcc version 0.9.24 Afterwords -- I like to see how `tcc' compile sqlite3.c in a second :-) Why this here? IMHO, it is cool, and if you pack `jimsh0' with `autosetup', perhaps, some one can try to pack `tcc' with some ... autobuild. BTW, there is Windows binary distribution of `tcc': http://bellard.org/tcc/ http://download.savannah.nongnu.org/releases/tinycc/tcc-0.9.25-win32-bin.zip but, I have no chance to try it. WARNING! Thus, I installed the built fossil with `tcc' under /usr/local/bin, I do not test the build heavily! Regards, Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] warning fix
Fix for: ../src/http_transport.c: In function ‘test_ssh_far_side_cmd’: ../src/http_transport.c:271:13: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result] Sergei Index: src/http_transport.c == --- src/http_transport.c +++ src/http_transport.c @@ -266,11 +266,11 @@ while( isizeof(zLine) ){ got = read(0, zLine+i, 1); if( got==0 ) return; if( zLine[i]=='\n' ){ zLine[i] = 0; - system(zLine); + if( system(zLine)==-1 ) return; i = 0; }else{ i++; } } ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] build error: 'Global' has no member named 'dontKeepUrl'
Hi Could you, please, add it to main.c:Global: Thanks Sergei --- checkout: 75e483899e28a533c7f17bb179acd9c10e9f3b60 2013-02-21 08:15:41 UTC tags: trunk comment: unused variables (user: jan.nijtmans) changes: None. Already up-to-date ../src/http_transport.c: In function ‘test_ssh_far_side_cmd’: ../src/http_transport.c:271: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result ../src/json.c: In function ‘json_g_to_json’: ../src/json.c:1402: error: ‘Global’ has no member named ‘dontKeepUrl’ make: *** [bld/json.o] Error 1 ___ 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] build error: 'Global' has no member named 'dontKeepUrl'
On Thu, 21 Feb 2013, Jan Nijtmans wrote: 2013/2/21 Sergei Gavrikov sergei.gavri...@gmail.com: Hi Could you, please, add it to main.c:Global: Thanks Sergei The actual commit which removed it was one earlier: 03:51:10 [6d6740dcca] Improved handling for remote repository passwords: When prompting for the password, also ask the user whether or not to remember the password, as browsers typically do for their password cache. (user: drh tags: trunk) See: https://www.fossil-scm.org/index.html/fdiff?v1=bc91379546130792v2=be285f713732c242 Ah, Jan, I did not mean your commit broke build (though it looks like I did), I just cut that from a build output and sent.. Sorry, next time I will dig deeper. Fixed now. Thank you! Sergei Regards, jan Nijtmans ___ 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] looking for guinea pigs for new help functionality
On Thu, 21 Feb 2013, Stephan Beal wrote: Hiho, i'm looking for guinea pigs again :), this time with minor enhancements to the online help system: support for web page-specific help. (Most pages don't have any useful help at the moment, though.) To try it out, check out the 'help-www' branch: http://fossil-scm.org/index.html/timeline?r=help-www [snip, see details http://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg11361.html] If you have suggestions for improving this feature (and they don't require a complete overhaul of the built-in help mechanism), please feel free to voice them. Hi All looks great for me. Thanks for that new built-in help topics (very useful, otherwise users have to grep this list or Fossil sources). $0.02 - I would avoid that output of the base /help URL begins itself too long (more than 1/2 of screen in $BROWSER), I would just add SEE ALSO link on a bottom the Fossil's help page (as man does). - Perhaps, it is logical to list new topics in the list Available pages with / prefix as /access_log, /admin_sql and so on. Regards, Sergei -- - 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] looking for guinea pigs for new help functionality
On Fri, 22 Feb 2013, Stephan Beal wrote: On Fri, Feb 22, 2013 at 8:06 AM, Sergei Gavrikov sergei.gavri...@gmail.com wrote: $0.02 Good morning, Sergei! - I would avoid that output of the base /help URL begins itself too long (more than 1/2 of screen in $BROWSER), I would just add SEE ALSO link on a bottom the Fossil's help page (as man does). i'm not sure what you mean by that. I mean that new /help web page will be extra informative when you add new volume Available pages to it. Perhaps, it is not big issue for developers, but other can think then that Fossil is too complex in every day usage :-) fossil help help is something man man which points on all help topics (or manuals) Perhaps /helpx would be good place for extra help topics, but of course, I do not resist on that. - Perhaps, it is logical to list new topics in the list Available pages with / prefix as /access_log, /admin_sql and so on. At first it did, but it's really distracting to look at when this is enabled. To turn it back on, edit main.c, line 1129, and replace (z+1) with (z), then you'll see what i mean. Maybe it's just a matter of personal taste. Agreed. Thanks for the feedback! Thanks for new features! Sergei -- - 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] looking for guinea pigs for new help functionality
On Fri, 22 Feb 2013, Stephan Beal wrote: On Fri, Feb 22, 2013 at 10:11 AM, Sergei Gavrikov wrote: I mean that new /help web page will be extra informative when you add new volume Available pages to it. Perhaps, it is not big issue for developers, but other can think then that Fossil is too complex in every day usage :-) The current version of the branch separates the help into Available commands and Available pages. Or did you mean another level of separation? Perhaps /helpx would be good place for extra help topics, but of course, I do not resist on that. It might be interesting to toggle the display of the auxiliary (help --aux) commands and /www pages on and off with a JavaScript button. i don't really want to split them into separate pages because it makes searching for a command more difficult if you don't know off-hand which set it belongs to. Yes, I did mean to keep Available pages section on a separate page (e.g. /helpx), but if things become more complex (searching) *I revoke* this request. And really, JavaScript controls to hide/show extra topics is the best solution! Sergei -- - 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] Side-by-side diff and non-English text
Hi Has anyone seen a broken output on the side-by-side diff pages for non-English texts? I mean UTF-8 non-English texts (Russian in my case) and of course the latest Fossil builds. If such an issue exists and it is a limitation the sbs's algorithm, what do you think, Is it good idea to add new Fossil setting to manage the default behavior the sbs for vdiff, fdiff, and time-line's on-click events, i.e. set sbs=1 or sbs=0 by a request/setting? As I could see sbs=1 is default behavior for vdiff and fdiff. Or may be I did miss some setting?! If I did, please, share a hint here. Thanks, Sergei ___ 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] Side-by-side diff and non-English text
On Wed, 27 Feb 2013, Joe Mistachkin wrote: Sergei Gavrikov wrote: Has anyone seen a broken output on the side-by-side diff pages for non-English texts? Do you have an example that is viewable online? Find, please, a test http://chiselapp.com/user/sg/repository/pangrams Look at side-by-side diff views from 2nd to 3rd check-in and from 3rd to 4th. For example http://chiselapp.com/user/sg/repository/pangrams/fdiff?v1=edab872a806e8d4cv2=6936fca46ff9d180 Left-side hunk: 30 Right-side hunks: 29, 81, 126, 137 Of course, unified diff has no such quirks. If such an issue exists and it is a limitation the sbs's algorithm, what do you think, Is it good idea to add new Fossil setting to manage the default behavior the sbs for vdiff, fdiff, and time-line's on-click events, i.e. set sbs=1 or sbs=0 by a request/setting? Personally, I think it might be nice to have such a setting, even if the side-by-side diff works perfectly for all cases. For now, I patch only 4-lines to get sbs=0 by default info.c |6 +++--- timeline.c |2 +- 2 files changed, 4 insertions(+), 4 deletions(-) But perhaps, I missed other places. Sergei -- Joe Mistachkin ___ 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] Side-by-side diff and non-English text
On Thu, 28 Feb 2013, Richard Hipp wrote: On Thu, Feb 28, 2013 at 4:20 AM, Jan Nijtmans jan.nijtm...@gmail.com wrote: 2013/2/28 Sergei Gavrikov sergei.gavri...@gmail.com: On Wed, 27 Feb 2013, Joe Mistachkin wrote: Do you have an example that is viewable online? Find, please, a test http://chiselapp.com/user/sg/repository/pangrams Look at side-by-side diff views from 2nd to 3rd check-in and from 3rd to 4th. It looks like the span class=diffrm, which is inserted, is dropped in the middle of a 2-byte UTF-8 character, splitting it in two invalid characters. That should never be done! Fixed here: http://www.fossil-scm.org/fossil/info/e2b3490676 Thank you. Unfortunately, splitting did not go away. As chiselapp.com has not got this workaround yet, I created two test repositories (Lorem Ipsum in Greek and Russian, UTF-8 encoded): (1) https://chiselapp.com/user/sg/repository/lipsum (2) http://91.208.39.24:8080/lipsum The second service is managed by the latest Fossil (+ e2b3490676) Please, compare results https://chiselapp.com/user/sg/repository/lipsum/vdiff?from=8b0984ab46648f58to=121bf8035b966861 http://91.208.39.24:8080/lipsum/vdiff?from=8b0984ab46648f58to=121bf8035b966861 Sergei___ 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] Side-by-side diff and non-English text
On Mon, 4 Mar 2013, Jan Nijtmans wrote: 2013/3/4 Jan Nijtmans jan.nijtm...@gmail.com: It still isn't correct in all cases. See: https://www.fossil-scm.org/index.html/info/256815f9c5 I see that's fixed now too. Thanks Richard! (not visible on fossil-scm.org yet, until it's fossil version is upgraded) It seems for me I reached the limit of request for the Subject, :-) Nevertheless, I would venture http://91.208.39.24:8080/lipsum It is under 'now-trunk'. Right side http://91.208.39.24:8080/lipsum/vdiff?from=16acb2846d84b028to=6a58f2dd9ada9a81 Left side http://91.208.39.24:8080/lipsum/vdiff?from=6a58f2dd9ada9a81to=8b0984ab46648f58 May be it is not possible to manage all cases? In any case thanks for all previous workarounds! Sergei Regards, Jan Nijtmans ___ 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] TH1 bomb
On Wed, 8 May 2013, Stephan Beal wrote: On Wed, May 8, 2013 at 6:37 PM, Stephan Beal sgb...@googlemail.com wrote: _Seems_ (without having looked at the code yet) to be an over-eager loop in Th_ErrorMessage. i'll have a look at it this evening. My suspicion was wrong but the backtrace lead to the problem: out-of-bounds access to an array element. This commit fixes it: http://fossil-scm.org/index.html/info/05ec4ed3c4 and everything seems to work as before, except that: [stephan@host:~/cvs/fossil/fossil]$ ./fossil test-th-eval info TH_ERROR: Expected sub-command instead of a segfault. Please try that out and report any problems. Thank you! The issue went away. Sergei -- - 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] Side-by-side diff improvement
On Fri, 5 Jul 2013, Joel Bruick wrote: Hi all, I've committed a pretty big changeto the diff code(http://www.fossil-scm.org/index.html/info/4081a91c84) , and I'd like some other people to take a look at it/test it out before it (maybe/hopefully) gets merged into the trunk. The purpose of this commit is, as the commit message says, to support arbitrary line lengths with synced horizontal scrolling in side-by-side diffs. Here's an example of it in action on a test copy of the Fossil repo: http://joelface.com/fossil/fdiff?v1=98aec3c55155011bv2=d74d0c320c455abdsbs=1(you can click anywhere inside a diff and use the left/right arrow keys to scroll) Thank you! I looked for this for months. At the end, sbs diff does not break long UTF-8 lines http://91.208.39.24:8080/lipsum/vdiff?from=6a58f2dd9ada9a81to=8b0984ab46648f58sbs=1 New sbs diff engine with scroll bars looks great (tested on Linux: Firefox Google Chrome). I could not live without it. Sergei ___ 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] survey: your top 5 most-used fossil CLI commands?
It seems for me it's good to know and the less-used commands :-) Yesterday I checked my list as % history | gawk \ '{if($2==f||$2==fossil)s[$3]++}END{for(i in s)print s[i],i}'|sort -Vr Sergei On Tue, 3 Sep 2013, Stephan Beal wrote: On Tue, Sep 3, 2013 at 9:08 PM, Ross Berteig r...@cheshireeng.com wrote: I wonder how hard it would be for fossil to (optionally) keep the statistics you are interested in? That's an interesting question. Keeping them locally would be very little work, actually. Add a table keyed by fossil command, and simply count invocations of each command. The table could be global (wherever global settings are actually stored), per-repository, or per-checkout. Per repo is not easy because a rebuild removes any non-core tables and it wouldn't be worth the trouble to make all this stuff syncable. Adding a table to the checkout (which will be lost on a close) will be easy to do. That's a very good idea. Added to my list. Thanks! -- - 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] TH1: expr {42.0/0}
Hi I found that TH1 does not catch Divide by 0 under certain conditions (if numerator or denominator (or both) are floating-point numbers) and quite hangs Fossil: % fossil test-th-eval expr {42/0} TH_ERROR: Divide by 0: 42 # TH1 hangs Fossil % fossil test-th-eval expr {42.0/0} % fossil test-th-eval expr {42/0.0} % fossil test-th-eval expr {42.0/0.0} % tclsh expr {42.0/0} Inf Is that expected behavior that TH1 does not catch INF? More precisely to say that TH1 takes 'Inf' literally :-) There are another minor things in TH1 like 0/0 or 0.0/0 (-NAN), but at the least those do not hang Fossil. Perhaps, it is not big issue, but I thought it was worth to say about. Thanks for Fossil! Sergei ___ 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] TH1: expr {42.0/0}
On Sat, 28 Dec 2013, Joe Mistachkin wrote: Sergei Gavrikov wrote: I found that TH1 does not catch Divide by 0 under certain conditions (if numerator or denominator (or both) are floating-point numbers) and quite hangs Fossil: Thanks for the report. Fixed here: https://www.fossil-scm.org/index.html/info/479b3de1d2 Sorry for delayed answer. Thank you for this fix. One thing that I found today, there are a few early returns in exprEval() which can cause memory leaks (nLeft, nRight stay allocated after return). I would say 'goto' is the simplest workaround to fix those lines, but, please, take a look. $.02: It seems to me it is worth to add to test_th_eval() an assert for nOutstagingMalloc==0, then it will be more easier to catch the leaks in a future % ./fossil test-th-eval expr 42%0 TH_ERROR: Modulo by 0: 42 fossil: ../src/th_main.c:1255: test_th_eval: Assertion `nOutstandingMalloc==0' failed. Aborted Without this check all tests from test/th1.test does pass without any noise. Sergei Index: src/th_main.c == --- src/th_main.c +++ src/th_main.c @@ -1249,6 +1249,8 @@ Th_FossilInit(TH_INIT_DEFAULT); rc = Th_Eval(g.interp, 0, g.argv[2], -1); zRc = Th_ReturnCodeName(rc, 1); fossil_print(%s%s%s\n, zRc, zRc ? : : , Th_GetResult(g.interp, 0)); Th_PrintTraceLog(); + Th_DeleteInterp(g.interp); + assert( nOutstandingMalloc==0 ); } ___ 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] TH1: expr {42.0/0}
On Fri, 3 Jan 2014, Joe Mistachkin wrote: Sergei Gavrikov wrote: Sorry for delayed answer. Thank you for this fix. One thing that I found today, there are a few early returns in exprEval() which can cause memory leaks (nLeft, nRight stay allocated after return). I would say 'goto' is ^ ^^ Must read zLeft, zRight the simplest workaround to fix those lines, but, please, take a look. Thanks [again] for the report. Fixed here: https://www.fossil-scm.org/index.html/info/60acb3183d Thank you! Sergei -- Joe Mistachkin ___ 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] TH1: set v 0; unset v; info exists v;
Hi Excuse my batch mails on TH1 :-) And although they say that TH1 is the scripting language for web pages ... [http://en.wikipedia.org/wiki/TH1] TH1 is great tool for other tasks. And as I play with TH1 in these days my scripts find some things. New one SYNOPSIS % ./fossil version This is fossil version 1.28 [da90bbe591] 2014-01-04 16:17:47 UTC % ./fossil test-th-eval 'set v 1; unset v; info exists v' 1 We expect 0. No issues with unset % ./fossil test-th-eval 'set v 1; unset v; expr $v+0' TH_ERROR: no such variable: v It seems this was introduced with Th_ExistsVar() http://fossil-scm.org/index.html/artifact/a561c58c237b3eb43eaf55e6f9cc6a9b8a26e5d1?ln=1154-1159 (check-in http://fossil-scm.org/index.html/info/4f8c8975bc). As I could see Th_ExistsVar() does miss a test for pValue-zData as Th_GetVar() does http://fossil-scm.org/index.html/artifact/a561c58c237b3eb43eaf55e6f9cc6a9b8a26e5d1?ln=1142-1149. Right? Could you, please, fix that? Thanks for Fossil and TH1. Sergei ___ 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] TH1: set v 0; unset v; info exists v;
On Sun, 5 Jan 2014, Sergei Gavrikov wrote: [no lyrics] % ./fossil version This is fossil version 1.28 [da90bbe591] 2014-01-04 16:17:47 UTC % ./fossil test-th-eval 'set v 1; unset v; info exists v' 1 We expect 0. No issues with unset % ./fossil test-th-eval 'set v 1; unset v; expr $v+0' TH_ERROR: no such variable: v Hm, unset % ./fossil test-th-eval 'unset absent' absent Th_UnsetVar() creates (creatok=1), then unset variable. So, unset never raise an error. It is okay? With patch below TH1 behaves like TCL % ./fossil test-th-eval 'unset absent' TH_ERROR: no such variable: absent % ./fossil test-th-eval 'set v 1; unset v; info exists v' 0 Sergei --- src/th.c +++ src/th.c @@ -1154,11 +1154,12 @@ /* ** Return true if variable (zVar, nVar) exists. */ int Th_ExistsVar(Th_Interp *interp, const char *zVar, int nVar){ - return thFindValue(interp, zVar, nVar, 0, 0)!=0; + Th_Variable *pValue = thFindValue(interp, zVar, nVar, 0, 0); + return pValue!=0 pValue-zData!=0; } /* ** String (zVar, nVar) must contain the name of a scalar variable or ** array member. If the variable does not exist it is created. The @@ -1240,11 +1241,11 @@ ** in the interpreter result and TH_ERROR is returned. */ int Th_UnsetVar(Th_Interp *interp, const char *zVar, int nVar){ Th_Variable *pValue; - pValue = thFindValue(interp, zVar, nVar, 1, 1); + pValue = thFindValue(interp, zVar, nVar, 0, 1); if( !pValue ){ return TH_ERROR; } Th_Free(interp, pValue-zData); ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] OT: TH1 shell
Hi http://chiselapp.com/user/sg/repository/thsh/index it is a tiny TH shell. Main goal was to keep original Fossil TH core (th.c and th_lang.c) without any changes and provide TH1 shell with alone source (th_shell.c, 391 lines in C). Only new one command was added [source] to interact with system, and a few TCL-like globals, argv0, argv (if that specified), th_interactive, and th_version. The main function to read TH sources is Th_EvalFile(). Even interactive prompt uses it, `thsh' in interactive mode just does process an input from stdin with Th_EvalFile(). The shell can report about errors on exit more verbosely like TCL does $ echo foo | thsh no such command: foo while executing foo (line 1) or $ echo foo foo $ thsh foo no such command: foo while executing foo (file foo line 1) As ::argv0, ::argv are supported by default, sha-bang scripts work as expected (!# /usr/bin/env thsh). Interactive shell knowns how to deal with two globals ::th_prompt1 and ::th_prompt2 if that set, default `thsh' prompt is % % set ::th_prompt1 [list puts {th }] puts {th } th proc hello args { set hello hello } th hello hello th About [info complete]. TH lacks this command, but if Th_Eval() returns (rc==TH_ERROR nResult==0) this means that there was no close brace, quote, or bracket in a program and this fact was used to build simple interactive shell. In 'Th1 shell' project I also use `makeheaders' and `translate' *AS IS*. Those programs are neat code filters/generators! With `translate' you can easy to add new TH procedures or embed TH code in your C sources. Once again, my goal was to use TH core without any modifications, so it should be easy to keep the shell up to date: cp ../fossil/src/th.[ch] ../fossil/src/th_lang.c src/ make TH1 shell is really tiny shell (static build with musl libc) $ size -t bld/*.o text data bss dec hex filename 6128 0 0612817f0 bld/th_lang.o 13124 432 0 1355634f4 bld/th.o 2943 8 42955 b8b bld/th_shell.o 22195 440 4 22639586f (TOTALS) $ size thsh text data bss dec hex filename 44693 8403552 49085bfbd thsh and you can use TH by its first appointment, test/glue code in embedded systems. At least `thsh' (IMHO) provides more comfortable way to run TH scripts on *nix than 'fossil test-th-eval', of course, I may be wrong. Please, excuse this OFF-TOPIC. I thought that `thsh' would help someone to learn or play with TH language. Sergei ___ 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] TH1: set v 0; unset v; info exists v;
On Sun, 5 Jan 2014, Joe Mistachkin wrote: Sergei Gavrikov wrote: It seems this was introduced with Th_ExistsVar() http://fossil-scm.org/index.html/artifact/a561c58c237b3eb43eaf55e6f9cc6a9b8a 26e5d1?ln=1154-1159 (check-in http://fossil-scm.org/index.html/info/4f8c8975bc). As I could see Th_ExistsVar() does miss a test for pValue-zData as Th_GetVar() does http://fossil-scm.org/index.html/artifact/a561c58c237b3eb43eaf55e6f9cc6a9b8a 26e5d1?ln=1142-1149. Right? Could you, please, fix that? Sergei Gavrikov also wrote: Th_UnsetVar() creates (creatok=1), then unset variable. So, unset never raise an error. It is okay? Thanks for the report(s). Fixed here: https://www.fossil-scm.org/index.html/info/7164f52baa And here: https://www.fossil-scm.org/index.html/info/99bdfa0b95 Thank you for the fixes! I'm sorry, but, I found yet another issue with Th_ExistsVar(). If a variable is not exists, Th_ExistsVar() does clear TH stack trace: # Expect {foo}, but get nothing {}. catch foo; info exists bar; set ::th_stack_trace Call path: Th_ExistsVar() - thFindValue() - Th_ErrorMessage() - ... Th_SetVar(interp, (char *)::th_stack_trace, -1, 0, 0); Unfortunately, there is no way to fix this without changing an interface function thFindVal(). As I could see thFindValue() cannot silent return 0 (not found, no care) it always calls Th_ErrorMeesage() on fails. I tested some workaround, it does not change default behavior and other Th_*Var() are happy, please, look on a draft patch (original comments have not been fixed). Could we expand 'arrayok' flag to a bitfield flag or that is ugly thing? Thank you for your time. Sergei Index: src/th.c == --- src/th.c +++ src/th.c @@ -1042,10 +1042,16 @@ *pnInner = nInner; *pisGlobal = isGlobal; return TH_OK; } +#define FV_ArrayOk0x0001 +#define FV_NoError0x8000 + +#define FIND_ARRAYOK 0x0001 +#define FIND_NOERROR 0x8000 + /* ** Input string (zVar, nVar) contains a variable name. This function locates ** the Th_Variable structure associated with the named variable. The ** variable name may be a global or local scalar or array variable ** @@ -1060,11 +1066,11 @@ static Th_Variable *thFindValue( Th_Interp *interp, const char *zVar, /* Pointer to variable name */ int nVar, /* Number of bytes at nVar */ int create,/* If true, create the variable if not found */ - int arrayok/* If true, an array is Ok. Otherwise array==error */ + int flags ){ const char *zOuter; int nOuter; const char *zInner; int nInner; @@ -1114,20 +1120,22 @@ pValue = Th_Malloc(interp, sizeof(Th_Variable)); pValue-nRef = 1; pEntry-pData = (void *)pValue; } }else{ -if( pValue-pHash !arrayok ){ +if( pValue-pHash (flagsFV_ArrayOk)!=FIND_ARRAYOK ){ Th_ErrorMessage(interp, variable is an array:, zOuter, nOuter); return 0; } } return pValue; no_such_var: - Th_ErrorMessage(interp, no such variable:, zVar, nVar); + if( (flagsFV_NoError)!=FIND_NOERROR ){ +Th_ErrorMessage(interp, no such variable:, zVar, nVar); + } return 0; } /* ** String (zVar, nVar) must contain the name of a scalar variable or @@ -1154,11 +1162,11 @@ /* ** Return true if variable (zVar, nVar) exists. */ int Th_ExistsVar(Th_Interp *interp, const char *zVar, int nVar){ - Th_Variable *pValue = thFindValue(interp, zVar, nVar, 0, 0); + Th_Variable *pValue = thFindValue(interp, zVar, nVar, 0, FIND_NOERROR); return pValue pValue-zData; } /* ** String (zVar, nVar) must contain the name of a scalar variable or Index: test/th1.test == --- test/th1.test +++ test/th1.test @@ -132,10 +132,15 @@ ### fossil test-th-eval set var 1; unset var; expr {\$var+0} test th1-info-exists-5 {$RESULT eq {TH_ERROR: no such variable: var}} + +### + +fossil test-th-eval catch foo; info exists bar; set ::th_stack_trace +test th1-info-exists-6 {$RESULT eq {foo}} ### fossil test-th-eval set var 1; unset var test th1-unset-1 {$RESULT eq {var}} ___ 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] TH1: set v 0; unset v; info exists v;
On Thu, 9 Jan 2014, Joe Mistachkin wrote: Sergei Gavrikov wrote: Thank you for the fixes! I'm sorry, but, I found yet another issue with Th_ExistsVar(). If a variable is not exists, Th_ExistsVar() does clear TH stack trace: Thanks again, fixed here: https://www.fossil-scm.org/index.html/info/9765b03759 Thank you! Sergei ___ 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] Version 1.28 release?
../configure --quietmake -s test|sed -ne '/Final result:/,$p' Cannot run this test within an open checkout Cannot run this test within an open checkout Cannot run this test within an open checkout * Final result: 2 errors out of 18915 tests * Failures: merge-utf-24-23 merge-utf-24-32 cp ../manifest* .fossil close mv manifest* ..make -s test|sed -ne '/Final result:/,$p' * Final result: 27 errors out of 18957 tests * Failures: merge-utf-24-23 merge-utf-24-32 merge5-10 merge5-50 merge5-72 merge5-90 merge5-91 merge5-100 merge5-101 merge5-102 merge5-110 merge5-120 merge5-121 merge5-122 merge5-123 merge5-130 merge5-131 merge5-132 merge5-133 merge5-134 merge5-135 merge5-136 merge5-140 merge5-141 merge5-142 th1-setting-5 th1-setting-6 uname -a Linux ** 3.2.0-56-generic #86-Ubuntu SMP Wed Oct 23 17:31:43 UTC 2013 i686 i686 i386 GNU/Linux Sergei ___ 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] TH1: set v 0; unset v; info exists v;
Sergei Gavrikov wrote: As I could see Th_ExistsVar() does miss a test for pValue-zData as Th_GetVar() does http://fossil-scm.org/index.html/artifact/a561c58c237b3eb43eaf55e6f9cc6a9b8a26e5d1?ln=1142-1149. It looks like the same check is needed for Th_UnsetVar() too. # Expect {TH_ERROR: no such variable: i}, but got {i} % fossil test-th-eval 'set i 0; unset i; unset i' i Sergei Index: src/th.c == --- src/th.c +++ src/th.c @@ -1251,10 +1251,14 @@ Th_Variable *pValue; pValue = thFindValue(interp, zVar, nVar, 0, 1, 0); if( !pValue ){ return TH_ERROR; + } + if( !pValue-zData ){ +Th_ErrorMessage(interp, no such variable:, zVar, nVar); +return TH_ERROR; } Th_Free(interp, pValue-zData); pValue-zData = 0; if( pValue-pHash ){ Index: test/th1.test == --- test/th1.test +++ test/th1.test @@ -147,5 +147,10 @@ ### fossil test-th-eval unset var test th1-unset-2 {$RESULT eq {TH_ERROR: no such variable: var}} + +### + +fossil test-th-eval set var 1; unset var; unset var +test th1-unset-3 {$RESULT eq {TH_ERROR: no such variable: var}} ___ 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] TH1: set v 0; unset v; info exists v;
On Mon, 13 Jan 2014, Joe Mistachkin wrote: Sergei Gavrikov wrote: It looks like the same check is needed for Th_UnsetVar() too. Actually, the issue with Th_UnsetVar was slightly different; however, it should be fixed now: http://www.fossil-scm.org/index.html/info/1ebe4b02e4 Really. Thank you for your look on this. But, please, try comment-out http://fossil-scm.org/index.html/artifact/4d39579b42eb0d11?ln=381-389 I have got a few assertion fails in th1.test (and the last test failed). If to have that assert is bad idea, then at the least we have to have fossil_warning() there. Sergei ___ 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 import --git --incremental regression?
Hi After this http://fossil-scm.org/index.html/info/1aef260f4c check-in I cannot do incremental import anymore (I get the second dup trunk). An imported git project is simple and has 'master' branch only. After that I did revert this check-in the latest Fossil build does incremental import for the same git repository great. What a reason could be? Can anybody confirm this? Sergei ___ 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] TH1: string sub-sommands (first, last)
On Wed, 15 Jan 2014, Joe Mistachkin wrote: All the issues should be fixed now: https://www.fossil-scm.org/index.html/vdiff?from=d0d7ca17a46a0832to=f61958b 183db741bsbs=1 Thank you! Also thanks for 'th1UnsetVar' work. Sergei ___ 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 import --git --incremental regression?
On Thu, 16 Jan 2014, Sergei Gavrikov wrote: After this http://fossil-scm.org/index.html/info/1aef260f4c check-in I cannot do incremental import anymore (I get the second dup trunk). An imported git project is simple and has 'master' branch only. After that I did revert this check-in the latest Fossil build does incremental import for the same git repository great. What a reason could be? Can anybody confirm this? Excuse word regression. s/regression/fix/. However, new handling of timezone offset begins new timeline as the previous imports have been done before this check-in. Sergei ___ 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 import --git --incremental regression?
On Fri, 17 Jan 2014, Sergei Gavrikov wrote: Excuse word regression. s/regression/fix/. However, new handling of timezone offset begins new timeline as the previous imports have been done before this check-in. If you fall in the same trap, the next filter did restore the previous Fossil import logic for me: sed -e '/^\(tagger\|committer\)/s/ [+-][0-9]\{4\}$/ +/' Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] TH1: expr -2147483648
Hi, There is an issue in Th_SetResultInt(), it can not interpret INT_MIN value: % fossil test-th-eval 'expr -2147483648' -( % fossil test-th-eval 'expr {-2147483647-1}' -( % fossil test-th-eval 'expr {-2147483648+0}' TH_ERROR: expected number, got: -( It seems those iVal%10, iVal/10, and iVal%10 have to be (unsigned)iVal op 10. Sergei ___ 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] TH1: expr -2147483648
On Tue, 4 Feb 2014, Joe Mistachkin wrote: This should now be fixed, along with another issue. Thanks! Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] TH: unary bitwise operator
Hi [FYI] % fossil test-th-eval 'expr ~1234' fossil: ../src/th.c:2002: exprEval: Assertion `!Internal error' failed. Sergei Index: src/th.c == --- src/th.c +++ src/th.c @@ -1996,10 +1996,11 @@ case OP_BITWISE_OR: iRes = iLeft|iRight; break; case OP_LOGICAL_AND: iRes = iLeftiRight; break; case OP_LOGICAL_OR: iRes = iLeft||iRight; break; case OP_UNARY_MINUS: iRes = -iLeft;break; case OP_UNARY_PLUS: iRes = +iLeft;break; +case OP_BITWISE_NOT: iRes = ~iLeft;break; case OP_LOGICAL_NOT: iRes = !iLeft;break; default: assert(!Internal error); } Th_SetResultInt(interp, iRes); }else if( rc==TH_OK eArgType==ARG_NUMBER ){ ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] TH1: support for octal and hexadecimal numbers in expressions
Hi I have a small patch (it is attached just for reference) to make TH1 use the integers also in other formats (hexadecimal and octal forms). For example, we would use the same expressions then % expr {010+10+0x10} 34 Could we add such a support in Fossil TH1? I believe the TH1 stands for Test Harness 1 and I use TH1 core with the extensions in my embedded projects and it is pity that I cannot just type 0x... :-) Could anyone take a look on the workaround, please? Well, Th_ToInt() become itself a bit more slow, but I think it is still more fast than strtoll(). At the least, I can say that the patch does not break the existing Fossil TH1 tests. Thanks for Fossil! SergeiIndex: src/th.c == --- src/th.c +++ src/th.c @@ -1867,10 +1867,12 @@ {|, OP_BITWISE_OR,10, ARG_INTEGER}, {0,0,0,0} }; +int th_ishexdig(char c); + /* ** The first part of the string (zInput,nInput) contains a number. ** Set *pnVarname to the number of bytes in the numeric string. */ static int thNextNumber( @@ -1877,15 +1879,20 @@ Th_Interp *interp, const char *zInput, int nInput, int *pnLiteral ){ - int i; + int i = 0; int seenDot = 0; - for(i=0; inInput; i++){ + int (*isdigit)(char) = th_isdigit; + if( nInput2 zInput[0]=='0' (zInput[1]=='x' || zInput[1]=='X') ){ +i=2; +isdigit = th_ishexdig; + } + for(; inInput; i++){ char c = zInput[i]; -if( (seenDot || c!='.') !th_isdigit(c) ) break; +if( (seenDot || c!='.') !isdigit(c) ) break; if( c=='.' ) seenDot = 1; } *pnLiteral = i; return TH_OK; } @@ -2411,11 +2418,12 @@ ** '\f' 0x0C ** '\r' 0x0D ** ** Whitespace characters have the 0x01 flag set. Decimal digits have the ** 0x2 flag set. Single byte printable characters have the 0x4 flag set. -** Alphabet characters have the 0x8 bit set. +** Alphabet characters have the 0x8 bit set. Hexadecimal digits have the +** 0x20 flag set. Octal digits have the 0x40 flag set. ** ** The special list characters have the 0x10 flag set ** **{ } [ ] \ ; ' ** @@ -2424,14 +2432,14 @@ */ static unsigned char aCharProp[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, /* 0x0. */ 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x1. */ 5, 4, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x2. */ - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 20, 4, 4, 4, 4, /* 0x3. */ - 4, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x4. */ +102,102,102,102,102,102,102,102,102,102, 4, 20, 4, 4, 4, 4, /* 0x3. */ + 4, 44, 44, 44, 44, 44, 44, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x4. */ 12, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 20, 20, 20, 4, 4, /* 0x5. */ - 4, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x6. */ + 4, 44, 44, 44, 44, 44, 44, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x6. */ 12, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 20, 4, 20, 4, 4, /* 0x7. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x8. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xA. */ @@ -2455,10 +2463,16 @@ return (aCharProp[(unsigned char)c] 0x11); } int th_isalnum(char c){ return (aCharProp[(unsigned char)c] 0x0A); } +int th_ishexdig(char c){ + return (aCharProp[(unsigned char)c] 0x20); +} +int th_isoctdig(char c){ + return (aCharProp[(unsigned char)c] 0x40); +} #ifndef LONGDOUBLE_TYPE # define LONGDOUBLE_TYPE long double #endif @@ -2571,24 +2585,43 @@ ** interpreter result too. */ int Th_ToInt(Th_Interp *interp, const char *z, int n, int *piOut){ int i = 0; int iOut = 0; + int base = 10; + int (*isdigit)(char) = th_isdigit; if( n0 ){ n = th_strlen(z); } if( n0 (z[0]=='-' || z[0]=='+') ){ i = 1; } + if( n2 z[i]=='0' (z[i+1]=='x' || z[i+1]=='X') ){ +i += 2; +base = 16; +isdigit = th_ishexdig; + }else if( n1 z[i]=='0' ){ +i += 1; +base = 8; +isdigit = th_isoctdig; + } for(; in; i++){ -if( !th_isdigit(z[i]) ){ +int shift; +if( !isdigit(z[i]) ){ Th_ErrorMessage(interp, expected integer, got: \, z, n); return TH_ERROR; } -iOut = iOut * 10 + (z[i] - 48); +if( z[i]='a' ){ + shift = 87; +}else if( z[i]='A' ){ + shift = 55; +}else{ + shift = 48; +} +iOut = iOut * base + (z[i] - shift); } if( n0 z[0]=='-' ){ iOut *= -1; } ___ 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] TH1: support for octal and hexadecimal numbers in expressions
On Thu, 3 Apr 2014, Jan Nijtmans wrote: 2014-04-03 14:05 GMT+02:00 Sergei Gavrikov sergei.gavri...@gmail.com: Could anyone take a look on the workaround, please? Well, Th_ToInt() become itself a bit more slow, but I think it is still more fast than strtoll(). At the least, I can say that the patch does not break the existing Fossil TH1 tests. I'm not fond of allowing a 0-prefix for octal numbers, better restrict it to 0o, which is more consistent with 0x for hex. Yes, Tcl 8.x allows it now, but in future Tcl versions it will most likely being abandoned. See: http://www.tcl.tk/cgi-bin/tct/tip/114 Good point. Thak you. With new patch TH1 works as Tcl 8.5 % expr {0o10+10+0x10} 34 % expr {0O10+10+0X10} 34 % expr {0o77+99+0xff} 417 Other than that, it looks good to me. Thanks you for review! SergeiIndex: src/th.c == --- src/th.c +++ src/th.c @@ -1867,10 +1867,13 @@ {|, OP_BITWISE_OR,10, ARG_INTEGER}, {0,0,0,0} }; +int th_ishexdig(char c); /* 0x* and 0X* */ +int th_isoctdig(char c); /* 0o* and 0O* */ + /* ** The first part of the string (zInput,nInput) contains a number. ** Set *pnVarname to the number of bytes in the numeric string. */ static int thNextNumber( @@ -1877,15 +1880,26 @@ Th_Interp *interp, const char *zInput, int nInput, int *pnLiteral ){ - int i; + int i = 0; int seenDot = 0; - for(i=0; inInput; i++){ + int (*isdigit)(char) = th_isdigit; + if( nInput2 ){ +if( zInput[0]=='0' (zInput[1]=='x' || zInput[1]=='X') ){ + i=2; + isdigit = th_ishexdig; +} +if( zInput[0]=='0' (zInput[1]=='o' || zInput[1]=='O') ){ + i=2; + isdigit = th_isoctdig; +} + } + for(; inInput; i++){ char c = zInput[i]; -if( (seenDot || c!='.') !th_isdigit(c) ) break; +if( (seenDot || c!='.') !isdigit(c) ) break; if( c=='.' ) seenDot = 1; } *pnLiteral = i; return TH_OK; } @@ -2411,11 +2425,12 @@ ** '\f' 0x0C ** '\r' 0x0D ** ** Whitespace characters have the 0x01 flag set. Decimal digits have the ** 0x2 flag set. Single byte printable characters have the 0x4 flag set. -** Alphabet characters have the 0x8 bit set. +** Alphabet characters have the 0x8 bit set. Hexadecimal digits have the +** 0x20 flag set. Octal digits have the 0x40 flag set. ** ** The special list characters have the 0x10 flag set ** **{ } [ ] \ ; ' ** @@ -2424,14 +2439,14 @@ */ static unsigned char aCharProp[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, /* 0x0. */ 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x1. */ 5, 4, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, /* 0x2. */ - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 20, 4, 4, 4, 4, /* 0x3. */ - 4, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x4. */ +102,102,102,102,102,102,102,102,102,102, 4, 20, 4, 4, 4, 4, /* 0x3. */ + 4, 44, 44, 44, 44, 44, 44, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x4. */ 12, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 20, 20, 20, 4, 4, /* 0x5. */ - 4, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x6. */ + 4, 44, 44, 44, 44, 44, 44, 12,12, 12, 12, 12, 12, 12, 12, 12, /* 0x6. */ 12, 12, 12, 12, 12, 12, 12, 12,12, 12, 12, 20, 4, 20, 4, 4, /* 0x7. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x8. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9. */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xA. */ @@ -2455,10 +2470,16 @@ return (aCharProp[(unsigned char)c] 0x11); } int th_isalnum(char c){ return (aCharProp[(unsigned char)c] 0x0A); } +int th_ishexdig(char c){ + return (aCharProp[(unsigned char)c] 0x20); +} +int th_isoctdig(char c){ + return (aCharProp[(unsigned char)c] 0x40); +} #ifndef LONGDOUBLE_TYPE # define LONGDOUBLE_TYPE long double #endif @@ -2571,24 +2592,46 @@ ** interpreter result too. */ int Th_ToInt(Th_Interp *interp, const char *z, int n, int *piOut){ int i = 0; int iOut = 0; + int base = 10; + int (*isdigit)(char) = th_isdigit; if( n0 ){ n = th_strlen(z); } if( n0 (z[0]=='-' || z[0]=='+') ){ i = 1; + } + if( n2 ){ +if( z[i]=='0' (z[i+1]=='x' || z[i+1]=='X') ){ + i += 2; + base = 16; + isdigit = th_ishexdig; +} +if( z[i]=='0' (z[i+1]=='o' || z[i+1]=='O') ){ + i += 2; + base = 8; + isdigit = th_isoctdig; +} } for(; in; i++){ -if( !th_isdigit(z[i]) ){ +int shift; +if( !isdigit(z[i]) ){ Th_ErrorMessage(interp, expected integer, got: \, z, n); return TH_ERROR; } -iOut = iOut * 10 + (z[i] - 48); +if( z[i]='a' ){ + shift = 87; +}else if( z[i]='A' ){ + shift = 55; +}else{ + shift = 48; +} +iOut
Re: [fossil-users] TH1: support for octal and hexadecimal numbers in expressions
On Thu, 3 Apr 2014, Jan Nijtmans wrote: 2014-04-03 15:10 GMT+02:00 Sergei Gavrikov sergei.gavri...@gmail.com: Good point. Thak you. With new patch TH1 works as Tcl 8.5 While on it, I added binary as well. http://www.fossil-scm.org/index.html/info/1f6734c30b Thanks! Sure, '0b' also will be helpful for folk who need to move the bits. However, TH does trig on such typos expr 0+0b2 expr 0+0o8 So, for the new three things I would enter three new bit sets for aCharProp[]. Sergei ___ 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] TH1: support for octal and hexadecimal numbers in expressions
On Thu, 3 Apr 2014, Sergei Gavrikov wrote: TH does trig on such typos expr 0+0b2 expr 0+0o8 I mean % fossil test-th-eval 'expr 0+0b2' fossil: ../src/th.c:2140: exprMakeTree: Assertion `!apToken[jj] || !apToken[0]' failed. Aborted So, for the new three things I would enter three new bit sets for aCharProp[]. Jan, excuse me that was mistaken guess on the bit sets, the reason was my miss in src/th.c:thNexNumber(). The fix is attached. Thank you. SergeiIndex: src/th.c == --- src/th.c +++ src/th.c @@ -1879,31 +1879,35 @@ int nInput, int *pnLiteral ){ int i = 0; int seenDot = 0; + int seenPfx = 0; int (*isdigit)(char) = th_isdigit; if( nInput2 ){ if( zInput[0]=='0' (zInput[1]=='x' || zInput[1]=='X') ){ i=2; + seenPfx = 1; isdigit = th_ishexdig; } if( zInput[0]=='0' (zInput[1]=='o' || zInput[1]=='O') ){ i=2; + seenPfx = 1; isdigit = th_isoctdig; } if( zInput[0]=='0' (zInput[1]=='b' || zInput[1]=='B') ){ i=2; + seenPfx = 1; isdigit = th_isbindig; } } for(; inInput; i++){ char c = zInput[i]; if( (seenDot || c!='.') !isdigit(c) ) break; if( c=='.' ) seenDot = 1; } - *pnLiteral = i; + *pnLiteral = i - (seenPfx ? 2 : 0); return TH_OK; } /* ** Free an expression tree. ___ 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] TH1: support for octal and hexadecimal numbers in expressions
On Thu, 3 Apr 2014, Sergei Gavrikov wrote: The fix is attached. ^^^ Please, forget it! Sorry. Sergei ___ 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] TH1: support for octal and hexadecimal numbers in expressions
On Fri, 4 Apr 2014, Jan Nijtmans wrote: An additional issue is that binary/octal/hex numbers cannot contain dots, so they must be handled separately anyway. Done here: http://fossil-scm.org/index.html/info/a306f771d8 [the issues went away] Thank you very much! Now we have the comfortable way to manage any numbers on embedded targets. Regards, Sergei ___ 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] TH1: support for octal and hexadecimal numbers in expressions
On Fri, 4 Apr 2014, Sergei Gavrikov wrote: On Fri, 4 Apr 2014, Jan Nijtmans wrote: An additional issue is that binary/octal/hex numbers cannot contain dots, so they must be handled separately anyway. Done here: http://fossil-scm.org/index.html/info/a306f771d8 [the issues went away] Thank you very much! Now we have the comfortable way to manage any numbers on embedded targets. Hi Jan I found one exception, if there is digit 'b' (only) on the second position (only) in a hexadecimal number % fossil test-th-eval 'expr 0+0xb' 11 % fossil test-th-eval 'expr 0+0x0b' 0 % fossil test-th-eval 'expr 0+0x00b' 11 % fossil test-th-eval 'expr 0+0xbc' 188 % fossil test-th-eval 'expr 0+0x0bc' TH_ERROR: expected number, got: 0x0bc % fossil test-th-eval 'expr 0+0x00bc' 188 First, I thought that (0b) somehow shadows (0x), but this expressions also fail % fossil test-th-eval 'expr 0+0xab' 0 % fossil test-th-eval 'expr 0+0xabc' TH_ERROR: expected number, got: 0xabc Could you, please, take a look on this puzzle? Sergei ___ 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] TH1: support for octal and hexadecimal numbers in expressions
On Mon, 7 Apr 2014, Jan Nijtmans wrote: 2014-04-07 19:34 GMT+02:00 Sergei Gavrikov wrote: Could you, please, take a look on this puzzle? fossil-scm.org/index.html/info/b153caf67e Thanks! Regards, Sergei ___ 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 latest, /dir?ci=trunk issue
Hi SYNOPSIS i. ./fossil version This is fossil version 1.28 [b18f3a5cfb] 2014-04-08 09:37:43 UTC ii. ./fossil ui -P iii. Click on [Code] tab (http://localhost:/dir?ci=trunk) iv. Now if I try to open any directory, e.g. www/ I get an error no such checkin: b18f3a5cfb8bf40e265d4743191453cf44ab7d33www as it forms the spurious request http://localhost:/dir?name=ci=b18f3a5cfb8bf40e265d4743191453cf44ab7d33www Can anybody confirm this? Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] TH1: make TH1 be more verbose on parse error
Hi SYNOPSIS % fossil test-th-eval set x y; set z \ TH_ERROR: y % fossil test-th-eval set x y; set z { TH_ERROR: y % fossil test-th-eval set x y; set z [ TH_ERROR: y Take a look on src/th.c:thNextWord(), please. Could we make TH be more verbose there? See $.02 patch. ./fossil test-th-eval set x y; set z \ TH_ERROR: parse error ./fossil test-th-eval set x y; set z { TH_ERROR: parse error ./fossil test-th-eval set x y; set z [ TH_ERROR: parse error The second variant of such a report would be Th_ErrorMessage(interp, parse error: \, zInput, nInput); ./fossil test-th-eval set x y; set z { TH_ERROR: parse error: { But I like the first short report, parse error, as such a text let us to get an easy way to implement TCL-like [info complete] command or just TH procedure proc info_complete script { set err [catch [list uplevel 1 $script] errMsg] expr {! ($err $errMsg eq parse error)} } And this is useful to make TH1 interactive shell. Hope, I miss nothing. Thanks for Fossil and TH1! Sergei Index: src/th.c == --- src/th.c +++ src/th.c @@ -510,17 +510,17 @@ case ']': if( nBrace==0 ) nSq--; break; } iEnd++; } if( nBrace0 || nSq0 ){ - /* Parse error */ + Th_SetResult(interp, parse error, -1); return TH_ERROR; } } if( iEndnInput ){ -/* Parse error */ +Th_SetResult(interp, parse error, -1); return TH_ERROR; } *pnWord = iEnd; return TH_OK; } ___ 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] TH1: make TH1 be more verbose on parse error
On Tue, 10 Jun 2014, Stephan Beal wrote: On Tue, Jun 10, 2014 at 3:31 PM, Sergei Gavrikov wrote: Take a look on src/th.c:thNextWord(), please. Could we make TH be more verbose there? See $.02 patch. Thanks for the patch - i'll get this or something equivalent checked in as soon as i confirm that it doesn't break any existing tests which don't expect the new text. Hi Stephan Grep showed that there more returns on parse error and thNextWord() is a special case only. IMO, it would be nice to do all those returns with a macro, for example, some thParseError(). If you would like to tinker with th1, i split off a standalone copy of it two summers ago: http://fossil.wanderinghorse.net/repos/th1-sgb/ and have kept it patched with the occasional patch (like yours) from the list. Let me know if you'd be interested and i can set you up an account on that repo (it's independent of Fossil). Thank you for the link, I saw your project! One thing, there are many renames, s/Th/Th1/g :-) and it prevents syncing Fossil TH1 core with your API. My goal was/is to use Fossil src/th.[ch] in my world AS IS. Sergei ___ 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] libfossil + fuse
On Fri, 13 Jun 2014, Richard Hipp wrote: This appears to be working now on trunk. Get the latest code. Rerun ./configure and recompile (on a Linux system with FuseFS support - Ubuntu 13.10 works for me after apt-get install fuse). Then: fossil fusefs /tmp/myrepo Then you can access files using things like: ls /tmp/myrepo/checkins/4bf670e61250 The 4bf670e61250 part can be replaced by any valid check-in name. See http://www.fossil-scm.org/fossil/doc/tip/www/checkin_names.wiki for a discussion of what constitutes a valid check-in name. Thanks for nice Fossil FS! I found one strange thing. One my Fossil repository has two directories, rootfs and rootfs-earth. After fossil fuse mount `ls' could not find rootfs directory, but found rootfs-earth % ls /tmp/fusefs/checkins/trunk ls: cannot access /tmp/fusefs/checkins/trunk/rootfs: No such file or directory I found nothing special in my rootfs and I though that rootfs-earth someway shadows it. The next test canvas does demo the issue, though I do not known where is the bug, in fuse or fossil. Test on new repo touch foo;f add foo;f ci -m add foo touch foo-bar;f add foo-bar;f ci -m add foo-bar mkdir bar;touch bar/.stick;f add --dotfiles bar;f ci -m add bar mkdir bar-baz;touch bar-baz/.stick;f add --dotfiles bar-baz; f ci -m add bar-baz Now there are foo, foo-bar files, and bar, bar-baz directories % f ls bar-baz/.stick bar/.stick foo foo-bar Expected. Now % f fusefs /tmp/fusefs And % ls /tmp/fusefs/checkins/trunk ls: cannot access /tmp/fusefs/checkins/trunk/bar: No such file or directory bar bar-baz foo % tree /tmp/fusefs/checkins/trunk /tmp/fusefs/checkins/trunk |-- bar-baz `-- foo 1 directory, 1 file % ls -la /tmp/fusefs/checkins/trunk ls: cannot access /tmp/fusefs/checkins/trunk/bar: No such file or directory total 0 dr-xr-xr-x 2 sg sg 0 1970-01-01 03:00 . d--x--x--x 2 sg sg 0 1970-01-01 03:00 .. ?? ? ? ? ?? bar dr-xr-xr-x 2 sg sg 0 2014-06-15 16:07 bar-baz -r--r--r-- 1 sg sg 0 2014-06-15 16:07 foo Can anyone reproduce this? % f version This is fossil version 1.29 [6b15019765] 2014-06-14 16:19:30 UTC Thanks for your time. Sergei___ 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] libfossil + fuse
On Sun, 15 Jun 2014, Thomas Schnurrenberger wrote: I can reproduce this on lubuntu 14.04 LTS with Fossil compiled from trunk. Thanks. Mine 10.04. More precision test case % for i in a ab abc abcd;do touch $i; f add $i; f ci -m add $i; sleep 1; done % for i in a ab abc abcd;do touch subdir/$i; f add subdir/$i; f ci -m add subdir/$i; sleep 1; done Expected % f ls a ab abc abcd subdir/a subdir/ab subdir/abc subdir/abcd But % tree /tmp/fusefs/checkins/trunk /tmp/fusefs/checkins/trunk |-- a `-- subdir |-- a |-- ab |-- abc `-- abcd It seems there is the issue in Fossil fuse readdir for root items only. Sergei On Sun, 15 Jun 2014, Thomas Schnurrenberger wrote: On 15.06.2014 15:45, Sergei Gavrikov wrote: touch foo;f add foo;f ci -m add foo touch foo-bar;f add foo-bar;f ci -m add foo-bar mkdir bar;touch bar/.stick;f add --dotfiles bar;f ci -m add bar mkdir bar-baz;touch bar-baz/.stick;f add --dotfiles bar-baz; f ci -m add bar-baz Now there are foo, foo-bar files, and bar, bar-baz directories % f ls bar-baz/.stick bar/.stick foo foo-bar Expected. Now % f fusefs /tmp/fusefs And % ls /tmp/fusefs/checkins/trunk ls: cannot access /tmp/fusefs/checkins/trunk/bar: No such file or directory bar bar-baz foo % tree /tmp/fusefs/checkins/trunk /tmp/fusefs/checkins/trunk |-- bar-baz `-- foo 1 directory, 1 file % ls -la /tmp/fusefs/checkins/trunk ls: cannot access /tmp/fusefs/checkins/trunk/bar: No such file or directory total 0 dr-xr-xr-x 2 sg sg 0 1970-01-01 03:00 . d--x--x--x 2 sg sg 0 1970-01-01 03:00 .. ?? ? ? ? ?? bar dr-xr-xr-x 2 sg sg 0 2014-06-15 16:07 bar-baz -r--r--r-- 1 sg sg 0 2014-06-15 16:07 foo Can anyone reproduce this? I can reproduce this on lubuntu 14.04 LTS with Fossil compiled from trunk. -- tsbg ___ 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] libfossil + fuse
The issue went away. Thanks! Sergei On Sun, 15 Jun 2014, Richard Hipp wrote: On Sun, Jun 15, 2014 at 9:45 AM, Sergei Gavrikov sergei.gavri...@gmail.com wrote: Thanks for nice Fossil FS! I found one strange thing. One my Fossil repository has two directories, rootfs and rootfs-earth. After fossil fuse mount `ls' could not find rootfs directory, Should be fixed now. Please try again with the latest trunk version of Fossil. -- 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 CLI tricks: interrupting a commit message
On Tue, 17 Jun 2014, Nico Williams wrote: On Mon, Jun 16, 2014 at 11:49 PM, B Harder wrote: Remember that the buffer is only one level deep, though. A subsequent ^W, ^K , etc will clobber the previous contents. Along lines of Stephan Beals method, I use : preceding the fossil command. So: $ : fossil ci -m 'some msg' ($ is shell prompt). While we're on stupid shell tricks... If you setup your $PS1 and PS2 just so you can make your commands safe to cut-n-pase. Set $PS1 to something that starts with : and ends with ;, and set $PS2 to just whitespace. I do something similar with the sqlite3 shell... And if you setup $EDITOR or $VISUAL :-) make a habit, 'f ci'Enter. For example, interrupt in VIM is just ':cq'. I'm sure the same exit(1) is possible in other editors. If you wanted your text will be saved in ci-comment-.txt. Advantages: 1) No noise in shell history. Really, f ci -m ... fills the history by a painful noise, ^R (reverse-i-search) for illegal check-in and hit Enter causes ... Edit check-in comment. 2) $EDITOR is a place to think a bit more about check-in text and check-in itself. 3) Good $EDITOR lets to automate some things, e.g. spelling, formatting, etc. No Editor War here. I just believe that at least $EDITOR is CLI. Excuse my 2-3 cents. Happy Fossiling! Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] TH1: TH1 voyage
Hi [FYI] TH1 interpreter (important part of Fossil project) runs almost five days on Tabletsat-Aurora satellite http://sputnix.ru/en/mediainfo. The TH1 sources (src/th.[ch] and src/th_lang.c) were used `AS IS' from Fossil project. Many TH1 commands were implemented to test, manage, and glue software parts the on-board computer (OBC). OBC software sources itself was managed by Fossil SHM. TH1 environment: OS - RTEMS, ARCH - SPARC, CPU - LEON3, Endianness - BE. Dear D. Richard Hipp and Fossil community many thanks for Fossil and TH1! Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] A typo in Makefile.in
FYI: there is a typo in Makefile.in which does cause compile error http://fossil-scm.org/index.html/vpatch?from=df3ada575c9e3f0cto=45feda65e9978b9e s/_HAVE_SQLITE_CONFIG_H/HAVE_SQLITE_CONFIG_H/ (?) Sergei ___ 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] A typo in Makefile.in
On Wed, 9 Jul 2014, Jan Nijtmans wrote: 2014-07-09 22:11 GMT+02:00 Sergei Gavrikov sergei.gavri...@gmail.com: FYI: there is a typo in Makefile.in which does cause compile error http://fossil-scm.org/index.html/vpatch?from=df3ada575c9e3f0cto=45feda65e9978b9e s/_HAVE_SQLITE_CONFIG_H/HAVE_SQLITE_CONFIG_H/ (?) No, it's not a typo. This is meant to force inclusion of config.h here: http://fossil-scm.org/index.html/artifact/aeeb450fe4?ln=7602-7604 Hm. But only s/// gave me a chance to build recent stuff. What compile error are you seeing? On what platform? f clean -f ../configure --quiet make -s ../src/sqlite3.c:24308: error: ‘pread’ undeclared here (not in a function) ../src/sqlite3.c:24325: error: ‘pwrite’ undeclared here (not in a function) ../src/sqlite3.c:24373: error: ‘mremap’ undeclared here (not in a function) ../src/sqlite3.c: In function ‘unixRemapfile’: ../src/sqlite3.c:28671: error: ‘MREMAP_MAYMOVE’ undeclared (first use in this function) ../src/sqlite3.c:28671: error: (Each undeclared identifier is reported only once ../src/sqlite3.c:28671: error: for each function it appears in.) ../src/sqlite3.c:28671: warning: passing argument 4 of ‘(void * (*)(void *, size_t, size_t, int))aSyscall[23].pCurrent’ makes integer from pointer without a cast ../src/sqlite3.c:28671: note: expected ‘int’ but argument is of type ‘struct unix_syscall *’ make: *** [bld/sqlite3.o] Error 1 tclsh % parray tcl_platform tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = i686 tcl_platform(os) = Linux tcl_platform(osVersion) = 2.6.32-41-generic tcl_platform(platform)= unix tcl_platform(pointerSize) = 4 tcl_platform(threaded)= 1 tcl_platform(user)= sg tcl_platform(wordSize)= 4 Sergei___ 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] A typo in Makefile.in
On Wed, 9 Jul 2014, Jan Nijtmans wrote: Found the problem: _GNU_SOURCE needs to be defined BEFORE inclusion of the first system header file. Yes, this fixed the issue. Thanks! Sergei ___ 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 compare set of files between versions?
Hi Stepan! Please, forget this delta! Yesterday when I tried to show how I do use patchutils to filter diff outputs I copied (and posted) the diff output which was fulfilled on my dirty fossil repo. That was my local change in src/th.c (I forgot about) and I have not caught that. I'm sorry. History of the subject. I had an issue with TH1 operator on big endian target and I tried to apply Tcl 6.7 workaround for right shift (it looked promised, but it didn't help me with issue). At the end I re-worked that TH1 proc to avoid right shift operator. Just for reference a snippet from tcl6.7/tclExpr.c case RIGHT_SHIFT: /* * The following code is a bit tricky: it ensures that * right shifts propagate the sign bit even on machines * where won't do it by default. */ if (valuePtr-intValue 0) { valuePtr-intValue = ~((~valuePtr-intValue) value2.intValue); } else { valuePtr-intValue = value2.intValue; } break; I'm sorry that my diff example entered a mess to Subject. LESSON for me: must use 'fossil changes' before 'fossil diff'. Sergei On Tue, 12 Aug 2014, Stephan Beal wrote: On Tue, Aug 12, 2014 at 12:37 PM, Stephan Beal sgb...@googlemail.com wrote: On Mon, Aug 11, 2014 at 9:43 PM, Sergei Gavrikov sergei.gavri...@gmail.com wrote: % fossil diff --from prev | filterdiff -i '*src*' + case OP_RIGHTSHIFT: if( iLeft0 )iRes = ~(~(iLeft)iRight);iRes = iLeftiRight; break; i'll get this fix in this evening if it hasn't been done already. Hi Sergei! Thanks once again for the TH1 patch. i'm looking at this one now, but i'm not convinced that the result is correct: [stephan@host:~/cvs/fossil/fossil]$ f diff Index: src/th.c == --- src/th.c +++ src/th.c @@ -2018,11 +2018,12 @@ iRes = iLeft%iRight; break; case OP_ADD: iRes = iLeft+iRight; break; case OP_SUBTRACT: iRes = iLeft-iRight; break; case OP_LEFTSHIFT: iRes = iLeftiRight; break; - case OP_RIGHTSHIFT: iRes = iLeftiRight; break; + case OP_RIGHTSHIFT: if( iLeft0 ) iRes = ~(~(iLeft)iRight); + iRes = iLeftiRight; break; case OP_LT: iRes = iLeftiRight; break; case OP_GT: iRes = iLeftiRight; break; case OP_LE: iRes = iLeft=iRight; break; case OP_GE: iRes = iLeft=iRight; break; case OP_EQ: iRes = iLeft==iRight; break; [stephan@host:~/cvs/fossil/fossil]$ ./fossil test-th-eval 'expr -1 1' -1 (That said: i have no idea what the expected result of bitshifting a negative value is, since underflow/overflow of _signed_ numbers has undefined results in C, and having a sign bit means overflow _will_ happen on any left shift.) Adding an 'else' doesn't change the result. [stephan@host:~/cvs/fossil/fossil]$ ./fossil test-th-eval 'expr -1 2' -1 [stephan@host:~/cvs/fossil/fossil]$ ./fossil test-th-eval 'expr -1 10' -1 Diff: - case OP_RIGHTSHIFT: iRes = iLeftiRight; break; + case OP_RIGHTSHIFT: iRes = (iLeft0) + ? ~(~(iLeft)iRight) + : iLeftiRight; + break; :-? -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do. -- Bigby Wolf ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] www/mkindex.tcl
Hi FYI: 'Command-line help' link on permutedindex.html page broken, it points on /doc/help (there is missed ../ in www/mkindex.tcl script). Thanks for Fossil, Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] TH1: Th_ToInt() issue
Hi This check http://fossil-scm.org/index.html/artifact/f3e2d60ea44acd11?ln=2651-2653 allows to interpret - or + as valid integer, 0. By mistake, I entered - in stead 0 in my script and catch this. Examples fossil test-th-eval 'for {set i -} {$i3} {set i [expr {$i+1}]} {puts $i\n};' - 1 2 fossil test-th-eval 'for {set i +} {$i3} {set i [expr {$i+1}]} {puts $i\n};' + 1 2 Is this expected behaviour? Sergei ___ 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 source download naming scheme
On Wed, 25 Feb 2015, Stephan Beal wrote: On Tue, Feb 24, 2015 at 9:11 PM, Richard Hipp d...@sqlite.org wrote: So it seems like having dates on the download would be more meaningful than having a made-up version number. No? With a date, at least you know about how old the code is. What information does a made-up version number provide? How is that better than a date? FWIW, that's the approach i've taken for all but one of my own projects the past 15 years. Version numbers, _unless_ they are accompanied by a strict set of compatibility rules involving API- and/or binary compatibility, are _absolutely meaningless_. [joke] If we all were paleontologists, we could use the names of fossil animals for significant milestones of Fossil SCM http://www.fossilrecord.net/ http://www.fossilrecord.net/dateaclade/index.html http://www.fossilrecord.net/fossilrecord/download.html Sergei___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] New sub-commands for TH1 [info]
Hi Could we add two Tcl-like sub-commands for TH1 [info] command? I lack in [info commands] and [info globals]. Today's TH1 state for my Fossil build is llength [info globals] 15 and llength [info commands] 56 I have a draft prototype for missing sub-commands, but I am sure that Tcl gurus on the list can implement such a code more nicely. Thanks for Fossil! Sergei Index: src/th.c == --- src/th.c +++ src/th.c @@ -1204,10 +1204,44 @@ */ int Th_ExistsVar(Th_Interp *interp, const char *zVar, int nVar){ Th_Variable *pValue = thFindValue(interp, zVar, nVar, 0, 1, 1, 0); return pValue (pValue-zData || pValue-pHash); } + +struct List { + Th_Interp *interp; + char **pzList; + int *pnList; +}; + +typedef struct List List; + +static int thListCommand(Th_HashEntry *pEntry, void *pContext){ + List *pList = (List *)pContext; + return Th_ListAppend(pList-interp, pList-pzList, pList-pnList, + pEntry-zKey, pEntry-nKey); +} + +int Th_ListCommands(Th_Interp *interp, char **pzList, int *pnList){ + List aList = {interp, pzList, pnList}; + Th_HashIterate(interp, interp-paCmd, thListCommand, (void *)aList); + return TH_OK; +} + +static int thListGlobals(Th_HashEntry *pEntry, void *pContext){ + List *pList = (List *)pContext; + return Th_ListAppend(pList-interp, pList-pzList, pList-pnList, + pEntry-zKey, pEntry-nKey); +} + +int Th_ListGlobals(Th_Interp *interp, char **pzList, int *pnList){ + Th_Frame *pFrame = interp-pFrame; + while( pFrame-pCaller ) pFrame = pFrame-pCaller; + List aList = {interp, pzList, pnList}; + Th_HashIterate(interp, pFrame-paVar, thListGlobals, (void *)aList); + return TH_OK; +} /* ** String (zVar, nVar) must contain the name of a scalar variable or ** array member. If the variable does not exist it is created. The ** variable is set to the value supplied in string (zValue, nValue). Index: src/th_lang.c == --- src/th_lang.c +++ src/th_lang.c @@ -844,10 +844,56 @@ while( n th_isspace(z[n-1]) ){ n--; } } Th_SetResult(interp, z, n); return TH_OK; } + +int Th_ListCommands(Th_Interp*, char**, int*); + +/* +** TH Syntax: +** +** info commands +*/ +static int info_commands_command( + Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl +){ + if( argc!=2 ){ +return Th_WrongNumArgs(interp, info commands); + }else{ +int rc; +int nRes = 0; +char *zRes = 0; +rc = Th_ListCommands(interp, zRes, nRes); +Th_SetResult(interp, zRes, nRes); +if( zRes ) Th_Free(interp, zRes); +return rc; + } +} + +int Th_ListGlobals(Th_Interp*, char**, int*); + +/* +** TH Syntax: +** +** info globals +*/ +static int info_globals_command( + Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl +){ + if( argc!=2 ){ +return Th_WrongNumArgs(interp, info globals); + }else{ +int rc; +int nRes = 0; +char *zRes = 0; +rc = Th_ListGlobals(interp, zRes, nRes); +Th_SetResult(interp, zRes, nRes); +if( zRes ) Th_Free(interp, zRes); +return rc; + } +} /* ** TH Syntax: ** ** info exists VAR @@ -889,23 +935,48 @@ int argc, const char **argv, int *argl, const Th_SubCommand *aSub ){ + int nSub = 0; if( argc1 ){ int i; -for(i=0; aSub[i].zName; i++){ +for(i=0; aSub[i].zName; nSub++, i++){ const char *zName = aSub[i].zName; if( th_strlen(zName)==argl[1] 0==memcmp(zName, argv[1], argl[1]) ){ return aSub[i].xProc(interp, ctx, argc, argv, argl); } } } if(argc2){ Th_ErrorMessage(interp, Expected sub-command for, argv[0], argl[0]); }else{ -Th_ErrorMessage(interp, Expected sub-command, got:, argv[1], argl[1]); +int i; +int nRes = 0; +char *zRes = 0; +const char *zName; +Th_StringAppend(interp, zRes, nRes, +Unknown or ambiguous sub-command \, -1); +Th_StringAppend(interp, zRes, nRes, argv[1], argl[1]); +Th_StringAppend(interp, zRes, nRes, \: must be , -1); +if( nSub1 ){ + for(i=0; inSub; i++){ +zName = aSub[i].zName; +if( (i+1)==nSub ){ + Th_StringAppend(interp, zRes, nRes, or , 3); +} +Th_StringAppend(interp, zRes, nRes, zName, -1); +if( (i+1)!=nSub ){ + Th_StringAppend(interp, zRes, nRes, , , 2); +} + } +}else{ + zName = aSub[0].zName; + Th_StringAppend(interp, zRes, nRes, zName, -1); +} +Th_SetResult(interp, zRes, nRes); +if( zRes ) Th_Free(interp, zRes); } return TH_ERROR; } /* @@ -953,11 +1024,13 @@ int argc, const char **argv, int *argl ){ static const Th_SubCommand aSub[] = { -{ exists, info_exists_command }, +{ commands, info_commands_command }, +{ exists,info_exists_command }, +{ globals, info_globals_command }, { 0, 0 } }; return Th_CallSubCommand(interp, ctx, argc, argv,
Re: [fossil-users] Documenting the TH1 extended commands...
On Sat, 4 Apr 2015, Joe Mistachkin wrote: I've committed an initial draft of the documentation for the TH1 extended commands exposed by Fossil. Corrections and feedback are more than welcome. https://www.fossil-scm.org/fossil/doc/trunk/www/th1.md Thanks! It is very very useful page. Also, we would add a bit of self-documentation sugar to TH1 language if we provide yet two sub-commands to TH1 [info] command, I mean 'commands' and 'globals' sub-commands. I posted draft prototyping for them and a bit more http://www.mail-archive.com/fossil-users%40lists.fossil-scm.org/msg19085.html Once again, thank you for TH1 documentation page! Sergei ___ 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] Documenting the TH1 extended commands...
On Sun, 5 Apr 2015, Joe Mistachkin wrote: I've added new info commands and info vars sub-commands on trunk. You can combine the info vars sub-command with uplevel to get the same effect as info globals. Really, you presented even more, info globals and info locals with the laconic info vars. Like it! Thank you! Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] TH1 [array] command
Hi [TH1 language] Thanking introducing to TH1 Th_InterpAndList and thListAppend() by Joe Mistachkin http://fossil-scm.org/index.html/info/810e6c1e687c161f it is possible to implement [array keys] sub-command. If expand the structure and iterate function slightly, it is possible to implement [array get] sub-command for TH1 language. [array keys] ~= big Tcl [array names] (no mode and pattern). I have a diff to get sub-commands: keys, get, set and Tclx's like [for_array_keys] command. Could you, please, take a look on that? But, there is no [for_array_keys] command there. Examples: % ./fossil test-th-eval 'set a(i) ii; array get a' i ii % ./fossil test-th-eval 'array set a {i ii j jj k kk}; array keys a' i j k % ./fossil test-th-eval 'array set a {i ii j jj k kk}; array get a' i ii j jj k kk Sergei Index: src/th.c == --- src/th.c +++ src/th.c @@ -98,10 +98,11 @@ */ struct Th_InterpAndList { Th_Interp *interp; /* Associated interpreter context */ char **pzList; /* IN/OUT: Ptr to ptr to list */ int *pnList;/* IN/OUT: Current length of *pzList */ + int flags; /* Additional flags to context */ }; /* ** Hash table API: */ @@ -321,12 +322,18 @@ ** ** Always returns non-zero. */ static int thListAppendHashKey(Th_HashEntry *pEntry, void *pContext){ Th_InterpAndList *pInterpAndList = (Th_InterpAndList *)pContext; - Th_ListAppend(pInterpAndList-interp, pInterpAndList-pzList, -pInterpAndList-pnList, pEntry-zKey, pEntry-nKey); + if( pInterpAndList-flags 1 ) +Th_ListAppend(pInterpAndList-interp, pInterpAndList-pzList, + pInterpAndList-pnList, pEntry-zKey, pEntry-nKey); + if( pInterpAndList-flags 2 ){ +Th_Variable *pValue = (Th_Variable *)pEntry-pData; +Th_ListAppend(pInterpAndList-interp, pInterpAndList-pzList, + pInterpAndList-pnList, pValue-zData, pValue-nData); + } return 1; } /* ** Push a new frame onto the stack. @@ -2859,10 +2866,41 @@ } *z = '\0'; return Th_SetResult(interp, zBuf, -1); } + +/* +** Appends array essences (keys and/or values) to the specified list +** and returns TH_OK upon success. Any other return value indicates an +** error. +*/ +int Th_ListAppendArrayEssences( + Th_Interp *interp, + const char *zVar, + int nVar, + char **pzList, + int *pnList, + int flags +){ + Th_Variable *pValue; + Th_InterpAndList *p; + pValue = thFindValue(interp, zVar, nVar, 0, 1, 0, 0); + if( !pValue ) return TH_ERROR; + if( pValue-zData ){ +Th_ErrorMessage(interp, variable is a scalar:, zVar, nVar); +return TH_ERROR; + } + p = (Th_InterpAndList *)Th_Malloc(interp, sizeof(Th_InterpAndList)); + p-interp = interp; + p-pzList = pzList; + p-pnList = pnList; + p-flags = flags; + Th_HashIterate(interp, pValue-pHash, thListAppendHashKey, p); + Th_Free(interp, p); + return TH_OK; +} /* ** Appends all currently registered command names to the specified list ** and returns TH_OK upon success. Any other return value indicates an ** error. @@ -2872,10 +2910,11 @@ interp, sizeof(Th_InterpAndList) ); p-interp = interp; p-pzList = pzList; p-pnList = pnList; + p-flags = 1; Th_HashIterate(interp, interp-paCmd, thListAppendHashKey, p); Th_Free(interp, p); return TH_OK; } @@ -2891,12 +2930,13 @@ interp, sizeof(Th_InterpAndList) ); p-interp = interp; p-pzList = pzList; p-pnList = pnList; +p-flags = 1; Th_HashIterate(interp, pFrame-paVar, thListAppendHashKey, p); Th_Free(interp, p); return TH_OK; }else{ return TH_ERROR; } } Index: src/th.h == --- src/th.h +++ src/th.h @@ -138,10 +138,15 @@ int Th_ToInt(Th_Interp *, const char *, int, int *); int Th_ToDouble(Th_Interp *, const char *, int, double *); int Th_SetResultInt(Th_Interp *, int); int Th_SetResultDouble(Th_Interp *, double); +/* +** Function for handling array essences. +*/ +int Th_ListAppendArrayEssences(Th_Interp *, const char *, int, char **, int *, int); + /* ** Functions for handling command and variable introspection. */ int Th_ListAppendCommands(Th_Interp *, char **, int *); int Th_ListAppendVariables(Th_Interp *, char **, int *); Index: src/th_lang.c == --- src/th_lang.c +++ src/th_lang.c @@ -16,10 +16,123 @@ int Th_WrongNumArgs(Th_Interp *interp, const char *zMsg){ Th_ErrorMessage(interp, wrong # args: should be \, zMsg, -1); return TH_ERROR; } + +/* +** TH Syntax: +** +** array get arrayName +** array keys arrayName +*/ +static int array_keys_command( + Th_Interp *interp, void *ctx, int argc, const char **argv, int *argl +){ + int rc; + int flags = 1; + char *zElem = 0; + int nElem = 0; + + if( argc!=3 ){ +char *zUsage = 0; +int nUsage = 0; +
Re: [fossil-users] permuted index doc-page: request for feedback (was: Remove redundant shun links from doc page.)
On Mon, 24 Aug 2015, Stephan Beal wrote: On Mon, Aug 24, 2015 at 11:02 AM, Michai Ramakers wrote: Done in http://fossil-scm.org/index.html/info/49a77b5184ef2f5a , and for preview visit http://fossil-scm.org/index.html/doc/doc-bold-canonical/www/permutedindex.html IMO that is far less likely to confuse people than the current (permuted-only) page. For my current screen resolution new design takes 7 PgDn, old - 5 PgDn (something similar for mice scrolling). IMO, Canonical Index once more duplicates Permuted Index and it would be enough for now just to add a footnote for the title, What Permuted Index is or add the very first item for the list Permuted Index: * 0 What Permuted Index is * 5 Minutes as a Single User — Update and Running in * ... Two lists (C/P) look too long for human. Perhaps, Fossil documentation reached the state when tag cloud https://en.wikipedia.org/wiki/Tag_cloud would be the next solution and we could have some horizontal layout for the permuted index. But, all articles must have the precision set of key words. Sergei___ 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] permuted index doc-page: request for feedback (was: Remove redundant shun links from doc page.)
On Mon, 24 Aug 2015, Stephan Beal wrote: On Mon, Aug 24, 2015 at 12:42 PM, Sergei Gavrikov wrote: Two lists (C/P) look too long for human. Perhaps, Fossil documentation reached the state when tag cloud https://en.wikipedia.org/wiki/Tag_cloud would be the next solution and we could have some horizontal layout for the permuted index. But, all articles must have the precision set of key words. Fossil's tagging model inherently supports tagging arbitrary content (including doc files, for use in a tag cloud, or even tagging other tags), but we've currently got no code for handling tags anywhere except commits. Looking at the schema's comments, it seems that tag propagation (which would be needed for tagging doc files) only applies to checkins, and i'm not sure what change(s) would be needed to support that. Really. http://fossil-scm.org/index.html/artifact/cae75601dd0b3940bc192ff5a8b142d09 9bbc4e3?txt=1ln=376-390 Then `mkindex.tcl' script would grep `fossil tags` output to build tag-cloud in HTML if all doc pages were tagged using known semantic, however, it is possible also to set any tag(s) directly in Tcl script (in addition to a title) for that. Sergei___ 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] forget binary files
On Tue, 4 Aug 2015, Stephan Beal wrote: On Tue, Aug 4, 2015 at 1:02 PM, David Mason dma...@ryerson.ca wrote: Just be careful not to shun 0 length files or you won't be able to commit a 0-length file until you've cleared the shun table (because all 0-length files have the same SHA-1 id. Excellent point, though it's hard to imagine such files being either binary or holding sensitive data (except maybe in their name... hmmm interesting corner case). I know one, that's 'The Infinitely Profitable Program' http://peetm.com/blog/?p=55 :-) Sergei___ 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] forget binary files
On Tue, 4 Aug 2015, Stephan Beal wrote: On Tue, Aug 4, 2015 at 1:47 PM, Sergei Gavrikov sergei.gavri...@gmail.com wrote: I know one, that's 'The Infinitely Profitable Program' http://peetm.com/blog/?p=55 :-) To summarize: GO.COM contained no program bytes at all – it was entirely empty. However, because GO.COM was empty, but still a valid program file as far as CP/M was concerned (it had a directory entry and file-name ending with .com), the CP/M loader, the part of the OS whose job it is to pull programs off disk and slap them into the TPA, would still load it! Wow. i like to think that wouldn't be possible today. But, who knows... it's potentially possible to encode a whole virus in a long filename of an empty file, sharing the same hash as all other empty files. [OFF-TOPIC] I used GO.COM recently on one modern LEON3 target in self cooked boot-loader. I used XMODEM to upload binary files and I looked for a way to run application and return to the loader and return back (quickly) to loaded application again. From my local web-log (jemdoc mark-down): == 2015\/01\/12 Implement +Th_Eval2()+. In first, +Th_Eval2()+ does try to find a dot-com file on CFS. === GO.COM - [http://peetm.com/blog/?p=55] It works! ~~~ {}{} 0 qm ls hello.tcl init GO.COM HELLO.COM 0 qm HELLO HELLO, WORLD! 0 qm GO HELLO, WORLD! ~~~ BTW, +GO.COM+ was created as ~~~ {}{} 0 qm write GO.COM ~~~ Well, my COMMAND.COM on the target was TH1 interpreter :-) Sergei___ 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] Idea: automatic check for extras prior to commit
On Tue, 4 Aug 2015, Ron W wrote: On Tue, Aug 4, 2015 at 11:37 AM, Stephan Beal sgb...@googlemail.com wrote: On Tue, Aug 4, 2015 at 5:23 PM, Ron W ronw.m...@gmail.com wrote: I think this would be a useful feature. To me this all sounds like fossil enforcing project-specific policy, which is something it most certainly should not be doing. I was commenting on the specific suggestion of a fossil check command, that would perform the same checks that fossil commit already does. It's possible that the --dry-run option for commit MIGHT be used for the same effect. Right now, not able to try it to examine its behavior. Yet another solution would to implement some test command(s), e.g. 'test-somewhat-sane'. I would like such checks if they would run in the times faster than ``fossil extras'' or ``fossil changes''. If tested state is dirty the command found at least *one* change, or missing, or extra, it just prints dirty and exits. Or may be ``fossil status'' command is right place to mark the dirty state, though that is slow and heavyweight command. Sergei ___ 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] Any interest in testing/merging check-in-edit branch?
On Thu, 16 Jul 2015, Michai Ramakers wrote: Hello, On 16 July 2015 at 07:06, Andy Bradford amb-fos...@bradfords.org wrote: Has anyone (other than me) tested the changes for enabling amending checkins from the command line in the check-in-edit branch? Thanks for CLI support. Mostly I use GUI to fix misspelled or weird comments. ... FWIW, I tested it now a bit, not thoroughly, and it seems to work well - a handy feature, thank you. I don't know what the intended behaviour was w.r.t. bogus input on commandline - e.g. 'fossil amend tip something_bogus' does nothing (and prints nothing). I also expected that 'fossil amend uuid' will spawn $EDITOR with an original check-in message likes 'fossil commit' does. But, I met cold silence. Probably, to support $EDITOR for 'amend-commit' isn't trivial and I cannot insist on it, however, at least, we shall to see an error message. Sergei Michai ___ 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] Fossil internal error: failed to save undo information for path
Hi, Fossil falls at dry run of merge for one my repository: % f merge -n trunk [snip] Fossil internal error: failed to save undo information for path: garbage What may a reason be? Just in a case, fossil version % fossil version -v This is fossil version 1.33 [b9b9d7e739] 2015-07-15 10:38:24 UTC Compiled on Jul 15 2015 13:53:12 using gcc-4.4.3 (32-bit) SQLite 3.8.11 2015-07-08 16:22:42 5348ffc3fd Schema version 2015-01-24 miniz 9.1.15, loaded 9.1.15 SSL (OpenSSL 0.9.8k 25 Mar 2009) TH1_DOCS TH1_HOOKS TCL (Tcl 8.6.3, loaded TH_OK: 8.5.8) USE_TCL_STUBS TCL_STUBS JSON (API 20120713) UNICODE_COMMAND_LINE DYNAMIC_BUILD Sergei ___ 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] Any interest in testing/merging check-in-edit branch?
On Sat, 17 Jul 2015, Andy Bradford wrote: Thus said Sergei Gavrikov on Thu, 16 Jul 2015 17:21:55 +0300: I also expected that 'fossil amend uuid' will spawn $EDITOR with an original check-in message likes 'fossil commit' does. But, I met cold silence. Probably, to support $EDITOR for 'amend-commit' isn't trivial and I cannot insist on it, however, at least, we shall to see an error message. I think that having ``fossil amend uuid'' without any additional options spawn $EDITOR might be too much of an element of surprise. What do you think of --edit-comment: http://www.fossil-scm.org/index.html/info/fbf7b54e72de0bb7 Thanks. It works. May be you right about the option, no extra stress for user. Experienced user can use some aliases for comment editing, e.g. ``vici''. Sergei Andy -- TAI64 timestamp: 400055a9bc2b ___ 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] Any interest in testing/merging check-in-edit branch?
On Sat, 18 Jul 2015, Stephan Beal wrote: On Sat, Jul 18, 2015 at 11:10 AM, Sergei Gavrikov wrote: --edit-comment option. However, with a forest the options Fossil CLI increasingly resembles Git CLI :-) See: http://git-man-page-generator.lokaltog.net/ Of course, I have been *greatly* exaggerated. At a minimum, we can see the entire edge of a wood http://fossil-scm.org/index.html/help. Sure, there is room to grow :-) Back to amend's options. Short counter-part for `--comment' option would be `-m' option. The fossil commit command uses `-m'. Sergei ___ 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] Any interest in testing/merging check-in-edit branch?
On Sat, 18 Jul 2015, Andy Bradford wrote: Thus said Sergei Gavrikov on Sat, 18 Jul 2015 12:10:42 +0300: However, with a forest the options Fossil CLI increasingly resembles Git CLI :-) Perhaps then, ``amend'' should only have short options where ``commit'' has short options? I think this should be the case just so people who use both don't have to remember the differences. Exactly! This would really leave just -m. % fossil commit --help | grep \| -m|--comment COMMENT-TEXT use COMMENT-TEXT as commit comment -M|--message-file FILE read the commit comment from given file -n|--dry-run If given, display instead of run actions As for me short does not mean that will be well remembered. Short does mean frequently used. For longs % fossil commit --help | grep -- --[a-z] | wc -l 17 we have `--help' option. Sergei ___ 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] Any interest in testing/merging check-in-edit branch?
On Sat, 18 Jul 2015, Scott Robison wrote: Still on phone. Instead of -euser how about -author? Instinctively seems less clumsy but it's just a knee-jerk reaction to -euser which seems both long and short simultaneously. :) +1 I would vote for `-author' or for any not abbreviated word(s). Sergei ___ 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] permuted index doc-page: request for feedback (was: Remove redundant shun links from doc page.)
On Mon, 24 Aug 2015, Michai Ramakers wrote: On 24 August 2015 at 13:29, Sergei Gavrikov sergei.gavri...@gmail.com wrote: On Mon, 24 Aug 2015, Stephan Beal wrote: On Mon, Aug 24, 2015 at 12:42 PM, Sergei Gavrikov wrote: Two lists (C/P) look too long for human. Perhaps, Fossil documentation reached the state when tag cloud https://en.wikipedia.org/wiki/Tag_cloud would be the next solution and we could have some horizontal layout for the permuted index. But, all articles must have the precision set of key words. Fossil's tagging model inherently supports tagging arbitrary content (including doc files, for use in a tag cloud, or even tagging other tags), but we've currently got no code for handling tags anywhere except commits. Looking at the schema's comments, it seems that tag propagation (which would be needed for tagging doc files) only applies to checkins, and i'm not sure what change(s) would be needed to support that. Really. http://fossil-scm.org/index.html/artifact/cae75601dd0b3940bc192ff5a8b142d09 9bbc4e3?txt=1ln=376-390 Then `mkindex.tcl' script would grep `fossil tags` output to build tag-cloud in HTML if all doc pages were tagged using known semantic, however, it is possible also to set any tag(s) directly in Tcl script (in addition to a title) for that. that's a bit outside my skill and interest w.r.t. HTML/CSS I fear, but the idea looks interesting. Do you have any example (URL?) or idea of how a tag-cloud could look for Fossil, taking into account the appearance of the rest of the site? I did not resist on tag cloud. That was just an idea about compact layout for long list of Fossil documents. How would it look. For example, surf to http://www.tagcrowd.com/, choose 'Web Page URL' tab. I entered the URL http://fossil-scm.org/index.html/doc/trunk/www/permutedindex.html and got one nice example (auto-generated tag cloud can be downloaded as embedded HTML, an image or PDF file). I saw two big (bold) words between 50 other, *fossil* and ... *git* :-) I do not sure that generated PDF (http://www.tagcrowd.com/pdf/1440448147_cloud.pdf) will be exist a while, but, you can create own version. Sergei ___ 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 on Raspberry Pi
On Mon, 28 Jul 2014, Stephan Beal wrote: > On Mon, Jul 28, 2014 at 9:57 PM, Richard Hippwrote: > FWIW, took 6m36.130s to compile with -Os on the beaglebone. > Management summary: > > Start time: Mon Jul 28 21:03:36 UTC 2014 > End time: Mon Jul 28 21:24:58 UTC 2014 > == 21m22s FYI: I cross-compiled Fossil for ARM as Tools https://github.com/raspberrypi/tools/ Configure % ./configure CROSS=arm-linux-gnueabihf- --with-miniz --with-openssl=none --static Build make ;# it took about 2 min on my old laptop Fossil on target $ uname -a Linux raspberrypi 4.1.6+ #810 PREEMPT Tue Aug 18 15:19:58 BST 2015 armv6l GNU/Linux $ fossil version -v This is fossil version 1.33 [5b456cfa6b] 2015-09-16 10:49:49 UTC Compiled on Sep 17 2015 21:55:34 using gcc-4.8.3 20140106 (prerelease) (32-bit) SQLite 3.8.12 2015-09-11 01:22:41 d6cadbe9fe Schema version 2015-01-24 miniz 9.1.15, loaded 9.1.15 UNICODE_COMMAND_LINE STATIC_BUILD A while I tested the build on the target as a client only Everything works great! Sorry, if that old news :-) Thanks for Fossil! Sergei ___ 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] Multiple Projects in one Repo
On Thu, 16 Sep 2015, Andy Bradford wrote: > Thus said Oliver Friedrich on Sat, 12 Sep 2015 12:34:21 -: > > > What I really would like to have is to gather multiple such small > > projects in one repo file, so instead of having one ROOT check-in, > > having one ROOT for each project. I know that would make developing > > fossil a bit harder, but I think it would be a great feature and that > > not I'm the only one who would use this. > > You mean like this: assume you have two Fossils, master.fossil > and project.fossil. You want to combine the projects into a single > Fossil but retain an independent timeline for each: > > $ echo "SELECT 'UPDATE config SET value = ''' || value || ''' WHERE name = > ''project-code'';' FROM config WHERE name = 'project-code';" | fossil sql -R > master.fossil | fossil sql -R project.fossil > $ fossil pull --once -R master.fossil project.fossil > > Now, master will have two independent timelines, one from each project. > Here's an example: > > http://fossil.bradfords.org:8080/timeline Very nice concept and solution. Thank you for Fossil SQL sugar and on-line demo! Sergei ___ 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 ci -branch private
Hi! Could Fossil warn about spurious "private" check-ins? I rarely use private branches but I use and a few times I did wrong check-ins as fossil ci -branch private ... IMO, it would be nice if Fossil warn that he/she (possible) misuses privacy. Excuse my stupid request (wish you never see that your private check-in is published :-) Thanks for Fossil! Sergei smime.p7s Description: S/MIME Cryptographic Signature ___ 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 get artifact's content as raw text in one click?
On Sun, 17 Jan 2016, Baruch Burstein wrote: > I don't seem to see this problem. go to > https://www.fossil-scm.org/index.html/dir?ci=tip. I clicked on > "COPYRIGHT-BSD2.txt" and was given the text. If I click "Download" on > that page, I am given just the raw text. That's right. But I pointed on > > When *text* files have unknown MIME type (unknown extension) we > > cannot download them (in a fact to get a raw view in a browser) just > > in click. I may do check-in really text files, e.g. some statistics files with unknown extensions or without extensions at all and then I must append '=text' for download URL to get raw view in a browser. Try echo a>a f add a f ci -private -m 'add a' surf to /dir?ci=tip, press [Download] (browser will dialog with you). So, I need to append MIME type to URL. So, I asked about [Raw] button as companion for [Hex] one. Sergei ___ 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 get artifact's content as raw text in one click?
On Sun, 17 Jan 2016, Stephan Beal wrote: > The mime type is normally guessed based on the file name. How do you > propose fossil determines the mime type of: > > > echo a>a > f add a > f ci -private -m 'add a' > > > without itself having a full-featured content-header-snooping engine > which could determine it based on context inspection? Fossil does a > very small amount of header inspection in some contexts, but it > appears to be limited to a few image formats. No guess at all. Why? [Raw] button will force appending '=text' to 'Download' URL. Click on [Raw] is mean "you know what you want". If that is bad idea, sorry for the noise. Sergei___ 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 get artifact's content as raw text in one click?
On Mon, 18 Jan 2016, Andy Bradford wrote: > Thus said Sergei Gavrikov on Sun, 17 Jan 2016 13:28:05 +0300: > > > > > When *text* files have unknown MIME type (unknown extension) > > > > we cannot download them (in a fact to get a raw view in a > > > > browser) just in click. > > > > I may do check-in really text files, e.g. some statistics files > > with unknown extensions or without extensions at all and then I must > > append '=text' for download URL to get raw view in a browser. > > I see, so what you want is that the Download URL to offer up a MIME > type of ``text/plain'' for all artifacts as a way to trick your > brower into displaying the contents as text/plain? No. I asked about new "button", e.g. [Raw] or [Text] to be a companion for [Hex] "button". > And you also want that if the file is ``file.jpg'' that clicking the > ``Download'' link, which turns into /raw..., that the file be displayed > as text/plain? No. See above. If I had [Raw] or [Text] button, I could see jpeg magic header in a browser, e.g. JPEG image files begin with FF D8 and end with FF D9. JPEG/JFIF files contain the ASCII code for "JFIF" (4A 46 49 46) as a null terminated string. Also I would to see UTF BOM, etc. if I had such [Raw] button. I do not ask to change behavior for [Download] button. > By the way, m=text is not equivalent to m=text/plain (which is probably > what you really want). Correct. > Also, rather than changing the query parameters in the URL, if this > request has any chance of having the behavior change, it would be > better simply to change what MIME type Fossil uses as it serves > the content. As I pointed out, any unrecognized file is served as > application/x-fossil-artifact content which means most browsers won't > know what to do with it, and will offer you an opportunity to do > something with it. > > The /help//raw page says: > > URL: /raw?name=ARTIFACTID=TYPE > > Return the uninterpreted content of an artifact. Used primarily > to view artifacts that are images. > > What exactly does ``uninterpreted content'' mean? If anything, it > certainly doesn't mean to send ``text/plain'' for raw content. > I would argue that application/x-fossil-artifact is actually more > correct. I would also argue that /raw should always return > application/x-fossil-artifact, and not text/plain or image/jpeg or > whatever it thinks it might be. > > If there exists a bug, it is that /raw is returning text/plain for a > file ending in .txt and image/jpeg for a file ending in .jpeg. Thank you :-) Knowing that I do add =text to URL if I need that, and that is a bit annoying for me. Thus, no issue with [Download]. Thank you for feedback! Sergei ___ 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] Colored output on console
On Mon, 25 Apr 2016, Michael Richter wrote: I know that every time I mention this I get silently, perhaps even hostilely, ignored, but really guys, why not just use fsl for your customization needs? Colourizing output is in the cookbook: http://fossil.0branch.com/fsl/wiki?name=Cookbook, along with lots of other nifty tricks like aliasing, adding commands (like workflow-based ones I've done for my stuff), etc. It really is a nifty little package and I don't get the hostility (or at least utter apathy) it generates in the Fossil community. But, they have to install Tcl, Expect and Tcllib (cmdline). Right? Indeed, interactive things easier to do using Expect. But, if all about colorizing and simple filters in Tcl ... Jim Tcl is closer cd fossil cc -o jimsh0 autosetup/jimsh0.c mv jimsh0 /usr/local/bin Green Fossil example #! /usr/bin/env jimsh0 set RESET {[0m} set GREEN {[1;32m} set ret [catch {exec fossil {*}$::argv} out] regsub -all {\} $out $GREEN\&$RESET out puts $out exit $ret If they do not need to install additional packages, then you're more likely to be heard. What if $EDITOR tools/cfossil and implement a script for colorizing/filtering just in Jim Tcl? Sergei smime.p7s Description: S/MIME Cryptographic Signature ___ 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] [PROPOSED FEATURE] Fossil commands output sent through a pager
My 2 cents. Many of us use f-alias to deal with fossil in a terminal, right? Then why not f-function? SYNOPSIS unalias f f(){ fossil "$@" | more ; } or f(){ fossil "$@" | less -FRSXQ ; } if you like more 'less' then 'more' :) Then try f help commit f timeline -n 100 IMHO, KISS is just to put such an 1-liner in your ~/.profile if you need the pager. Thanks for Fossil! Sergei ___ 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] Is there a way to find identical files?
Tony Papadimitriou wrote: [snip] For example, if /defs.inc is the same as /project1/defines.inc, and project2/lib.mod is the same as project3/library.inc and project4/libroutines.inc, and docs/mydocs.pdf is the same as project1/docs.pdf, I would like some simple report like this: defs.inc project1/defines.inc project2/lib.mod project3/library.inc project4/libroutines.inc docs/mydocs.pdf project1/docs.pdf (a blank line --or whatever other separator -- simply separates each group) Ideally from the command line so that I can redirect to a file. On *nix you would use FDUPES(1) [1] to find duplicate files, e.g. fdupes -r project1 project2 project3 project4 Default `fdupes' output is exactly what you looking for. Just install fdupes using your package manager. [1] https://linux.die.net/man/1/fdupes Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] autosetup v0.6.6 issue
Hi, It seems that new autosetup [c5e4100705] cannot handle properly configure options with prefixes (enable|disable|with|without). Try, please $ ./configure --with-th1-docs Host System...x86_64-unknown-linux-gnu Build System...x86_64-unknown-linux-gnu C compiler...ccache cc -g -O2 C++ compiler...ccache c++ -g -O2 Build C compiler...cc Checking for stdlib.h...ok Error: Unknown option --th1-docs Try: 'configure --help' for options Old autosetup had no such issue. Sergei ___ 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] autosetup v0.6.6 issue
On Fri, 12 May 2017, Sergei Gavrikov wrote: Temp. solution for my set of --with-* options is $ echo configure ... | sed 's/--with-\w\+/&=1/g' | sh To err is human $ echo ./configure ... | sed 's/--with-[^[:space:]]\+/&=1/g' | sh Sergei ___ 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] autosetup v0.6.6 issue
Temp. solution for my set of --with-* options is $ echo configure ... | sed 's/--with-\w\+/&=1/g' | sh Sergei ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[fossil-users] No rule to make target 'src/email.c', ...
[FYI] $ f info project-name: Fossil ... project-code: CE59BB9F186226D80E49D1FA2DB29F935CCA0333 checkout: 25eafed11494e801c28babfbc5784f877c3aa0b7 2018-06-20 19:04:04 UTC parent: 9a2e5f47170b4f2d86e23c1b2cb37d5b284e7982 2018-06-20 18:47:46 UTC tags: trunk comment: Add a new capability that allows signup for email notification. Change the name of the older "EMail" privilege to "View-PII" to avoid confusion. (user: drh) check-ins:11308 $ make distclean && ./configure --quiet && make -s rm -rf bld/* fossil rm -f autoconfig.h config.log Makefile make: *** No rule to make target 'src/email.c', needed by 'bld/email_.c'. Stop. -- sg ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users