[fossil-users] patch: fossil import sha3 marks support

2018-01-15 Thread Dingyuan Wang
Hi,

The patch fixes the problem that fossil doesn't recognize sha3 marks
file. eg.

first do

$ mkdir .marks
$ git fast-export --all --export-marks=.marks/git | fossil import
--export-marks .marks/fossil --git repo.fossil

then

$ git fast-export --all --import-marks=.marks/git
--export-marks=.marks/git | fossil import --import-marks .marks/fossil
--export-marks .marks/fossil --git --incremental repo.fossil


Index: src/export.c
==
--- src/export.c
+++ src/export.c
@@ -35,16 +35,16 @@
 **   and fossil commits.
 **   -git_name: This is the mark name that identifies the commit to git.
 **  It will always begin with a ':'.
 **   -rid: The unique object ID that identifies this commit within the
 ** repository database.
-**   -uuid: The SHA-1 of artifact corresponding to rid.
+**   -uuid: The SHA-1/SHA-3 of artifact corresponding to rid.
 */
 struct mark_t{
   char *name;
   int rid;
-  char uuid[41];
+  char uuid[65];
 };
 #endif

 /*
 ** Output a "committer" record for the given user.
@@ -340,22 +340,23 @@
   }else{
 mark->name = fossil_strdup(cur_tok);
   }

   cur_tok = strtok(NULL, "\n");
-  if( !cur_tok || strlen(cur_tok)!=40 ){
+  if( !cur_tok || (strlen(cur_tok)!=40 && strlen(cur_tok)!=64) ){
 free(mark->name);
-fossil_trace("Invalid SHA-1 in marks file: %s\n", cur_tok);
+fossil_trace(
+  "Invalid SHA-1/SHA-3 in marks file: %d %s\n", strlen(cur_tok),
cur_tok);
 return -1;
   }else{
 sqlite3_snprintf(sizeof(mark->uuid), mark->uuid, "%s", cur_tok);
   }

   /* make sure that rid corresponds to UUID */
   if( fast_uuid_to_rid(mark->uuid)!=mark->rid ){
 free(mark->name);
-fossil_trace("Non-existent SHA-1 in marks file: %s\n", mark->uuid);
+fossil_trace("Non-existent SHA-1/SHA-3 in marks file: %s\n",
mark->uuid);
 return -1;
   }

   /* insert a cross-ref into the 'xmark' table */
   insert_commit_xref(mark->rid, mark->name, mark->uuid);

___
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 serious are test failures on 2.4 release.

2018-01-15 Thread Jacob MacDonald
Karel,

Continuous testing for Fossil is something I've been thinking about since I
discovered it. The typical workflow on GitHub tends to be
branch-merge-deploy, which gives you nice hooks to plug in a CI tool to run
tests. In Fossil those lines seem to be blurred, so I haven't yet figured
out what kind of testing tool could be built around Fossil. But if shoring
up the test suite and making it somehow run on check-in is something that
could be done, perhaps applying it to Fossil would be a good first step. I
wasn't even aware of failing tests before I saw this thread.

Please let me know if you've had any similar thoughts.

Jacob.

On Mon, Jan 15, 2018 at 1:03 PM Richard Hipp  wrote:

> On 1/15/18, Karel Gardas  wrote:
> >
> > I've been always wondering how serious are various failures man gets
> > from building/testing fossil release.
>
> Probably I should pay more attention to the tests.  But the truth is,
> I never run them.  My way of testing Fossil is to put the latest copy
> on my development machine, on https://fossil-scm.org/ and on
> https://sqlite.org/ and run it for a few days.
>
> If you look at the very faint line at the bottom of any screen on the
> Fossil self-hosting website (ex:
> https://www.fossil-scm.org/fossil/timeline) it tells you exactly which
> version of Fossil generated that screen.  The version is usually the
> latest trunk check-in, or if not the latest, not more than one or two
> versions behind.  There is a similar line at the bottom of the page on
> https://www.sqlite.org/src/timeline and on various other sites I host.
>
> So, in other words, testing consists mostly of running Fossil in the
> wild.  On the SQLite and Fossil sites alone, Fossil generates about
> one page-view per second.  All day.  Every day.
>
> Maybe I'm being naive, but I feel like that is plenty of testing.
>
> Any problems that appear when running "make test" are very likely in
> the test logic, and not in Fossil.  The tests in Fossil have always
> been a bit dodgy.
>
> We'd welcome your help in making the Fossil tests better!  :-)
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] How serious are test failures on 2.4 release.

2018-01-15 Thread Richard Hipp
On 1/15/18, Karel Gardas  wrote:
>
> I've been always wondering how serious are various failures man gets
> from building/testing fossil release.

Probably I should pay more attention to the tests.  But the truth is,
I never run them.  My way of testing Fossil is to put the latest copy
on my development machine, on https://fossil-scm.org/ and on
https://sqlite.org/ and run it for a few days.

If you look at the very faint line at the bottom of any screen on the
Fossil self-hosting website (ex:
https://www.fossil-scm.org/fossil/timeline) it tells you exactly which
version of Fossil generated that screen.  The version is usually the
latest trunk check-in, or if not the latest, not more than one or two
versions behind.  There is a similar line at the bottom of the page on
https://www.sqlite.org/src/timeline and on various other sites I host.

So, in other words, testing consists mostly of running Fossil in the
wild.  On the SQLite and Fossil sites alone, Fossil generates about
one page-view per second.  All day.  Every day.

Maybe I'm being naive, but I feel like that is plenty of testing.

Any problems that appear when running "make test" are very likely in
the test logic, and not in Fossil.  The tests in Fossil have always
been a bit dodgy.

We'd welcome your help in making the Fossil tests better!  :-)

-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] How serious are test failures on 2.4 release.

2018-01-15 Thread Karel Gardas

Hello,

I've been always wondering how serious are various failures man gets 
from building/testing fossil release.


For example taking 2.4 release I get those:

[...]

 This page was generated in about 0.009s by Fossil 
2.4 [a0001dcf57] 2017-11-03 09:29:29   * Final 
results: 19 errors out of 34853 tests * Considered failures: 
pre-commit-warnings-fossil-1 test-framework-set-manifest th1-checkout-1 
th1-checkout-2 th1-header-2 th1-artifact-3 th1-artifact-7 
th1-globalState-1 th1-globalState-8 th1-encode64-3 wiki-49 wiki-50 
wiki-51 wiki-52 wiki-53 wiki-54 wiki-55 wiki-56 wiki-57 * Ignored 
results: 5 ignored errors out of 34853 tests * Ignored failures: 
merge5-sqlite3-issue stash-1-diff stash-WY-1-CODE stash-3-2 
stash-3-2-show-1 on Ubuntu 16.04


while those (in full):

$ time gmake test tclsh ../src/../test/tester.tcl fossil -quiet test 
pre-commit-warnings-1 FAILED! RESULT: 1    binary    binary data 1    
cr-lf-crlf.txt    mixed line endings 1    cr-only.txt    CR line endings 
1    crlf.txt    CR/LF line endings 0    empty 0    line-0064 0    
line-1024 0    line-4096 1    line-64K    long lines 1    line-8192    
long lines 0    plain.txt 1    utf-16be-bombe-hello    binary data 1    
utf-16be-bomle-hello    binary data 1    utf-16be-hello    binary data 
1    utf-16be.txt    Unicode 1    utf-16le-bombe-hello    binary data 
1    utf-16le-bomle-hello    binary data 1    utf-16le-hello    binary 
data 1    utf-16le.txt    Unicode 0    utf-8-bom-emoji 0    utf-8-emoji 
1    utf-bad-c0-81    invalid UTF-8 1    utf-bad-c0-bf    invalid UTF-8 
1    utf-bad-c1-bf    invalid UTF-8 1    utf-bad-e0-80-80    invalid 
UTF-8 1    utf-bad-f0-80-80-80    invalid UTF-8 1    
utf-bad-f4-90-80-80    invalid UTF-8 1    utf-bad-f8-80-80-80-80    
invalid UTF-8 1    utf-bad-f9-80-80-80-80    invalid UTF-8 1    
utf-bad-fc-80-80-80-80-80    invalid UTF-8 1    
utf-bad-fe-80-80-80-80-80-80    invalid UTF-8 1    utf-bad-ff    invalid 
UTF-8 0    utf-ill16-lead 0    utf-ill16-pair 0    utf-ill16-trail 0    
utf-mod-c0-80 1    utf-nobom-16be.txt    binary data 1    
utf-nobom-16le.txt    binary data 1 ERROR: current directory is not 
within an open checkout test pre-commit-warnings-fossil-1 FAILED! 
RESULT: current directory is not within an open checkout Fossil was not 
compiled with JSON support. ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts ERROR: WARNING: 1 merge conflicts ERROR: 
WARNING: 1 merge conflicts Skipping Merge5 tests test 
merge5-sqlite3-issue FAILED (knownBug)! ERROR: WARNING: no common 
ancestor for f1 ERROR: WARNING: no common ancestor for f1 ERROR: DELETE 
f2 RENAME f1 -> f2 ADDED f1 REMINDER: this was a dry run - no files were 
actually changed. ERROR: DELETE f1 ADDED f3 (overwrites an unmanaged 
file)  "fossil undo" is available to undo changes to the working 
checkout. ignoring --integrate: mrg is not a leaf WARNING: no common 
ancestor for f2 WARNING: local edits lost for f1 WARNING: 1 merge 
conflicts WARNING: 1 unmanaged files were overwritten test 
test-framework-set-manifest FAILED! RESULT: DELETE f1new UNDO   f1 
invalid command name "lmap"     while executing "lmap key [dict keys 
$dict $pattern] {string length $key}"     (procedure "protOutDict" line 
2)     invoked from within "protOutDict $testopts""     ("foreach" body 
line 6)     invoked from within "foreach testfile $argv {   protOut 
"* $testfile **"   if { [catch {source $testdir/$testfile.test} 
testerror testopts] } {     test test-frame..."     (file 
"../src/../test/tester.tcl" line 979) gmake: *** [test] Error 1


on Solaris 11.2 and finally those (also in full):

$ time gmake test tclsh ../src/../test/tester.tcl fossil -quiet test 
pre-commit-warnings-1 FAILED! RESULT: 1   binary  binary data 
1   cr-lf-crlf.txt  mixed line endings 1   cr-only.txt CR 
line endings 1   crlf.txt