Hi all,

when trying out the new timeline capability regarding file/directory
name, I noticed something else which changed between 1.29 and the
current state (aka the future 1.30).

Previously, the commit UUIDs were always output with a length of 10
digits in the command line version of "fossil timeline".

Now I see much longer output. E.g. in the fossil repository itself,
fossil 1.29 outputs for an arbitrarily chosen commit the UUID
8487172254, but 1.30 outputs 84871722547960b (which is 5 digits more).
In another example 1.29 outputs 0246783012 whereas 1.30 outputs
0246783012e (one digit more).

My first thought was, that this is to resolve some ambiguity regarding
the first 10 digits. But when trying "fossil artifact" I can supply
the only 10 digits long id as well and get the same output than when
specifying the 15 digits long output.

So, I used the new "fossil timeline timeline.c" (nice use case, BTW) to
find the relevant commit message:

=== 2014-06-30 ===
09:13:28 [734d429940] Use the same algorithm for event-id's for UUID's
         as in other UI locations: Make sure that the UUID contains at
         least a single lower-case hex digit, with a minimum of length
         10. (user: jan.nijtmans tags: 16-digit-event-ids)

Ok, I can understand now the reason behind it. But considering the fact
that the UUIDs now can have different length, I'd like to vote for an
option (e.g. "--long-uuids" or similar) that always outputs the UUIDs
in the complete length (like "fossil status" does).

Looking at the code in timeline.c, it just seems to be matter of
replacing %S in the format string with %s to get the full UUID.

If not introducing a new flag but re-using the verbose flag, then the
patch would be almost trivial and look like this:

--- src/timeline.c
+++ src/timeline.c
@@ -1602,11 +1602,15 @@
     }
     if( fossil_strcmp(zCurrentUuid,zId)==0 ){
       sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* ");
       n += strlen(zPrefix);
     }
-    zFree = mprintf("[%S] %s%s", zId, zPrefix, zCom);
+    if (verboseFlag){
+      zFree = mprintf("[%s] %s%s", zId, zPrefix, zCom);
+    }else{
+      zFree = mprintf("[%S] %s%s", zId, zPrefix, zCom);
+    }
     /* record another X lines */
     nLine += comment_print(zFree, zCom, 9, width, g.comFmtFlags);
     fossil_free(zFree);
 
     if(verboseFlag){


But I'm not sure whether this should be coupled with the verbose flag
or get its own flag.

But while I dug into the code, I noticed the following lines later
down in the same file:

  if( !verboseFlag){
    verboseFlag = find_option("showfiles","f", 0)!=0; /* deprecated */
  }

I wasn't aware that -showfiles was deprecated (it was not in 1.24
which we are using until now). And even less aware that the short form
of -showfiles is -f. So, wrt. the other thread where I suggested using
-f to indicate "file/directory argument", this seems to be already
taken.

But: Why is -showfiles deprecated? Is there any other way of getting at
the same information?

Currently I'm using

  fossil status

in a checkout in order to find the checkout UUID, and then I'm doing

  fossil timeline ancestors $UUID -n 2147483647 -t ci -showfiles

and parse the output to construct a mapping for the most recent
commit that modified each file in the workspace. If -showfiles is not
available anymore, how should I get at this information?

Greetings,
Stefan

-- 
Stefan Bellon
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to