Re: [fossil-users] How to list commits made so far?
On Mon, 07 Nov 2011 15:42:35 -0800 Ross Berteig wrote: > At 02:32 PM 11/7/2011, Gilles wrote: > >I guess it would make more sense that -n stands for "number of > >check-in's", but it's not returning that number. > > > >I updated from 1.19 to 1.20, and re-ran the command on my repo: > >"-n 5" still doesn't return the last five check-in's. Maybe this > >is not what the "-n" switch mean. > > Without examining the code, I've tried a couple of experiments in > a repo of my own. It appears that the -n N option specifies a > desired number of lines to output, but tests it only between > complete timeline entries. Also, the lines containing only a date > are not counted against N. Here's a bug report from last November, with a patch: http://www.fossil-scm.org/index.html/tktview?name=3e58b8ceaf -- Dmitry Chestnykh http://www.codingrobots.com ___ 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 list commits made so far?
On Tue, Nov 08, 2011 at 01:31:21AM +0100, Gilles wrote: > On Mon, 07 Nov 2011 15:42:35 -0800, Ross Berteig > wrote: > >So if your checkin comments are all short enough there are many > >of them per day, then you will have about two lines per entry and > >you can estimate the number of entries printed for -n N to be > >N/2. However, if your entries are more explanatory or occur at > >one per day or less then you will get fewer entries. > > As I'm still learning about Fossil, and use Fossil mostly to track > changes made to documents and small development projects, the comments > I used to learn about Fossil are typically one-line long, and I only > commited changes a couple of times a day, so my experience doesn't > match real-life use. > > But I agree with the other comments that "-n" should return the "n" > last check-in's/commits. > I've just investigate a little bit. On web ui, parameter work as expected for the "n" parameter and show number of checkins. e.g.: http://www.fossil-scm.org/index.html/timeline?n=5 Will show 5 last checkins. But for the same repository (my clone), using command line I get only 3 checkins: $ fossil timeline -n 5 === 2011-11-07 === 07:07:33 [5905232d45] fossil already provides compatibility wrappers for dirent and struct timeval (user: steveb tags: jimtcl) 05:51:20 [b6270d665b] Update Jim Tcl to build with MSVC (user: steveb tags: jimtcl) 03:39:21 [7ee228fe6a] Remove HAVE_MKDIR_ONE_ARG define when compiling Jim as it will now be defined in the C file itself. (user: mistachkin tags: jimtcl) Looking at the code, the timeline_cmd() seems to search for "n" last checkins but call at the end: print_timeline() which take the "n" as second argument. The problem is that the second argument of print_timeline() is used to limit the number of line, not number of checkins. -- Martin G. ___ 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 list commits made so far?
On Mon, 07 Nov 2011 15:42:35 -0800, Ross Berteig wrote: >So if your checkin comments are all short enough there are many >of them per day, then you will have about two lines per entry and >you can estimate the number of entries printed for -n N to be >N/2. However, if your entries are more explanatory or occur at >one per day or less then you will get fewer entries. As I'm still learning about Fossil, and use Fossil mostly to track changes made to documents and small development projects, the comments I used to learn about Fossil are typically one-line long, and I only commited changes a couple of times a day, so my experience doesn't match real-life use. But I agree with the other comments that "-n" should return the "n" last check-in's/commits. ___ 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 list commits made so far?
On 2011-11-07, at 18:42, Ross Berteig wrote: > At 02:32 PM 11/7/2011, Gilles wrote: > >I guess it would make more sense that -n stands for "number of > >check-in's", but it's not returning that number. > > > >I updated from 1.19 to 1.20, and re-ran the command on my repo: > >"-n 5" still doesn't return the last five check-in's. Maybe this > >is not what the "-n" switch mean. > > Without examining the code, I've tried a couple of experiments in > a repo of my own. It appears that the -n N option specifies a > desired number of lines to output, but tests it only between > complete timeline entries. Also, the lines containing only a date > are not counted against N. > > So if your checkin comments are all short enough there are many > of them per day, then you will have about two lines per entry and > you can estimate the number of entries printed for -n N to be > N/2. However, if your entries are more explanatory or occur at > one per day or less then you will get fewer entries. > > If your comments are typically very verbose or vary a lot in > length, then the number of output lines may bear very little > relationship to the number of items output. > > The Timeline tab in the web ui appears to count actual entries > not length. I'd respectfully suggest that since trimming text to > a set number of lines is an easy operation but counting entries > is not, the fossil timeline command's -n option should count > entries and not try (and fail) to count lines. > According to "fossil help timeline" -n specify the number of checkins. -- Martin G. ___ 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 list commits made so far?
At 02:32 PM 11/7/2011, Gilles wrote: >I guess it would make more sense that -n stands for "number of >check-in's", but it's not returning that number. > >I updated from 1.19 to 1.20, and re-ran the command on my repo: >"-n 5" still doesn't return the last five check-in's. Maybe this >is not what the "-n" switch mean. Without examining the code, I've tried a couple of experiments in a repo of my own. It appears that the -n N option specifies a desired number of lines to output, but tests it only between complete timeline entries. Also, the lines containing only a date are not counted against N. So if your checkin comments are all short enough there are many of them per day, then you will have about two lines per entry and you can estimate the number of entries printed for -n N to be N/2. However, if your entries are more explanatory or occur at one per day or less then you will get fewer entries. If your comments are typically very verbose or vary a lot in length, then the number of output lines may bear very little relationship to the number of items output. The Timeline tab in the web ui appears to count actual entries not length. I'd respectfully suggest that since trimming text to a set number of lines is an easy operation but counting entries is not, the fossil timeline command's -n option should count entries and not try (and fail) to count lines. Ross Berteig r...@cheshireeng.com Cheshire Engineering Corp. http://www.CheshireEng.com/ ___ 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 list commits made so far?
On Mon, 7 Nov 2011 19:18:44 +0400, Konstantin Khomoutov wrote: >2) In the description text, where it's clearly placed in the context > of check-ins. I guess it would make more sense that -n stands for "number of check-in's", but it's not returning that number. I updated from 1.19 to 1.20, and re-ran the command on my repo: "-n 5" still doesn't return the last five check-in's. Maybe this is not what the "-n" switch mean. ___ 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 list commits made so far?
On Mon, 7 Nov 2011 15:45:16 +0100 Lluís Batlle i Rossell wrote: > > >I can guess that's the effect of timeline defaulting to showing > > >tickets and wiki edits as well as commits. > > >What happens if you do > > >fossil timeline -t ci -n 20 > > >? > > > > Good idea, but still strange: > > > > C:\Projects\Project1>fossil timeline -n 5 -t ci > > => Shows three commits > > > > C:\Projects\Project1>fossil timeline -n 10 -t ci > > => Shows five commits > > 'n' sets the maximum number of lines, iirc. `fossil help timeline` from v1.20 I have installed mentions "N" twice: 1) In the command-line spec--that "?-n N?" bit; 2) In the description text, where it's clearly placed in the context of check-ins. ___ 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 list commits made so far?
On Mon, 7 Nov 2011 15:45:16 +0100, Lluís Batlle i Rossell wrote: >'n' sets the maximum number of lines, iirc. This is not what is showing here. No matter what I count as "lines", I don't get five lines when I type "-n 5": C:\Projects\Project1>fossil timeline -n 5 -t ci === 2011-11-05 === 02:14:42 [6a07f19e02] *CURRENT* Code complete (user: Joe tags: trunk) === 2011-11-04 === 13:02:18 [367bcfa41a] Some other comment (user: Joe tags: trunk) === 2011-11-03 === 15:13:52 [492bc26bae] Some other comment (user: Joe tags: trunk) ___ 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 list commits made so far?
On Mon, Nov 07, 2011 at 03:41:44PM +0100, Gilles wrote: > On Mon, 7 Nov 2011 18:37:23 +0400, Konstantin Khomoutov > wrote: > >I can guess that's the effect of timeline defaulting to showing tickets > >and wiki edits as well as commits. > >What happens if you do > >fossil timeline -t ci -n 20 > >? > > Good idea, but still strange: > > C:\Projects\Project1>fossil timeline -n 5 -t ci > => Shows three commits > > C:\Projects\Project1>fossil timeline -n 10 -t ci > => Shows five commits 'n' sets the maximum number of lines, iirc. ___ 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 list commits made so far?
On Mon, 7 Nov 2011 18:37:23 +0400, Konstantin Khomoutov wrote: >I can guess that's the effect of timeline defaulting to showing tickets >and wiki edits as well as commits. >What happens if you do >fossil timeline -t ci -n 20 >? Good idea, but still strange: C:\Projects\Project1>fossil timeline -n 5 -t ci => Shows three commits C:\Projects\Project1>fossil timeline -n 10 -t ci => Shows five commits I only use the CLI to work with Fossil, and I don't use it for ticketing. Anyway, "timeline" answers my question about how to list commits, although out of curiosity, I wonder why it doesn't show the number of commits as expected. ___ 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 list commits made so far?
On Mon, 07 Nov 2011 15:10:12 +0100 Gilles wrote: [...] > One thing I'm not clear about, is how "fossil timeline" works: When > using "-n 5", it shows three lines, while "-n 10" shows five lines, > and "-n 20" shows eleven :-/ > > http://fossil-scm.org/index.html/help?cmd=timeline > > What does "timeline" show, really? I can guess that's the effect of timeline defaulting to showing tickets and wiki edits as well as commits. What happens if you do fossil timeline -t ci -n 20 ? ___ 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 list commits made so far?
On Sun, 6 Nov 2011 16:22:36 +0400, Konstantin Khomoutov wrote: >I think the meaning of these hashes is reversed: artifact is a particular >version of a particular file according to [1], > so the first hash here identifies the commit the artifact identified by the > second hash is a part of. >You can verify this simply by correlating the output of `fossil finfo` >with the output of `fossil timeline`. Thanks for the info. Apparently, when running "fossil finfo myfile", the first hash identifies the whole commit (ie. all the files whose changes were commited when running "fossil commit") while the second hash identifies the particular commit for that particular file: C:\Projects\Project1>fossil finfo Form1.vb 2011-11-05 [6a07f19e02] Code complete (user: Joe, artifact: [9735460a2c]) C:\Projects\Project1>fossil artifact 6a07f19e02 => List all the files affected by that commit C:\Projects\Project1>fossil artifact 9735460a2c => List the state of the file when it was commited One thing I'm not clear about, is how "fossil timeline" works: When using "-n 5", it shows three lines, while "-n 10" shows five lines, and "-n 20" shows eleven :-/ http://fossil-scm.org/index.html/help?cmd=timeline What does "timeline" show, really? ___ 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 list commits made so far?
On Sun, 6 Nov 2011 09:28:51 -0500 Martin Gagnon wrote: > > wrote: Is there a command that I could run to list all the commits, > > and for each, would show which files were part of the commit? > > fossil timeline -showfiles -n 10 > > > > The -n parameter is kind of a kludge there. By default there is a > > limit to how many are shown but there is no way to say "no limit", > > so we can just provide a really large number > > I remembre trying n=-1 on web interface to get everything. I don't > know about command line version... I'll try when I'll have access to > my computer.. I guess it will need some way to escape the '-'. May be it worth adding the "-all" command-line option to `fossil timeline`? Actually, I prefer Git's approach to this in which `git log` by default returns everything, but if it detects it's operating on a TTY it pipes its output through a $PAGER so the user gets only the $LINES worth of output by default and then they're free to dig deeper or quit the pager. But as it currently stands, "-all" could be a good addition, it seems. ___ 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 list commits made so far?
On 2011-11-06, at 07:09, Stephan Beal wrote: > On Sun, Nov 6, 2011 at 11:19 AM, Gilles wrote: > Is there a command that I could run to list all the commits, and for > each, would show which files were part of the commit? > > > fossil timeline -showfiles -n 10 > > The -n parameter is kind of a kludge there. By default there is a limit to > how many are shown but there is no way to say "no limit", so we can just > provide a really large number I remembre trying n=-1 on web interface to get everything. I don't know about command line version... I'll try when I'll have access to my computer.. I guess it will need some way to escape the '-'. -- Martin G.___ 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 list commits made so far?
On Sun, 06 Nov 2011 11:19:08 +0100 Gilles wrote: > I'd like to check something about how Fossil works. > > When I run "fossil commit", it saves the changes made to all the files > that are monitored (ie. that have been added to the repository). One usually uses the term "tracked" (instead of "monitored", which usually implies some real-time monitoring of the filesystem for changes made in the work tree employed by some VCS's). > When I run "fossil finfo" on a file, it shows two hashes: > > C:\Projects\Project1>fossil finfo Form1.vb > History of Projects/Project1/Form1.vb > 2011-11-05 [6a07f19e02] Some comment (user: Joe, artifact: > [9735460a2c]) > 2011-11-04 [367bcfa41a] Some comment (user: Joe, artifact: > [da4cb1ce3b]) > > Am I correct in understanding that the first hash identifies the > changes made to this particular file in that particular commit, while > the second hash identifies the commit that contains all the files that > were part of the commit at that time? > > For instance, if Form1.vb and Form2.vb were edited when I ran "fossil > commit", the second hash would be the same for both files because they > were commited together? I think the meaning of these hashes is reversed: artifact is a particular version of a particular file according to [1], so the first hash here identifies the commit the artifact identified by the second hash is a part of. You can verify this simply by correlating the output of `fossil finfo` with the output of `fossil timeline`. This is further complicated by the fact, the commit object itself is also an artifact, and both kinds of artifacts can be inspected using the `fossil artifact` command, just for files it dumps the raw contents of those files, and for commits it dumps specially formatted machine-parseable output representing full info about the commit. I'm not familiar with Fossil internals, so there may be other types of artifacts. > Is there a command that I could run to list all the commits, and for > each, would show which files were part of the commit? I think there's no such command, but you could script that one for yourself using nothing more than `fossil artifact`: 1) Start from a particular tip's SHA-1 identifier. 2) Run `fossil artifact` on it--amont other things, you'll get the list of files belonging in to that commit, each prefixed with the "F " string, and the parent commit's SHA-1 identifier prefixed with the "P " string. 3) Extract the parent commit ID, goto (2). Note that you might be under a mistaken assumption that Fossil records only the changed files in its commits, which it, being a DVCS, does not. In a DVCS system, each commit refers to the full state of the repository using SHA-1 (or whatever) hashes calculated on the contents (!) of the files it tracks to refer to the state of those files. So it means if you have ten files and then record several commits each of which records a change to only one file of the set, each commit will still refer to all those ten files, just one of them will have different contents (and hence will be referenced by a different SHA-1 ID) compared to the other nine. 1. http://www.sqlite.org/debug1/doc/trunk/www/concepts.wiki ___ 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 list commits made so far?
On Sun, Nov 6, 2011 at 11:19 AM, Gilles wrote: > Is there a command that I could run to list all the commits, and for > each, would show which files were part of the commit? > > fossil timeline -showfiles -n 10 The -n parameter is kind of a kludge there. By default there is a limit to how many are shown but there is no way to say "no limit", so we can just provide a really large number here. To limit that to checkins (excluding wiki or ticket changes), add "-t ci" to the command line. -- - stephan beal http://wanderinghorse.net/home/stephan/ ___ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users