Fossil SCM

Add the -u option to the 'timeline' command to display only items associated with a given user.

danield 2025-10-08 14:14 trunk
Commit 80c5e6791ce5dbf78e610db7bbfd32ab60cd23aed891aeb1a6cff68950955ad9
1 file changed +6
--- src/timeline.c
+++ src/timeline.c
@@ -3632,10 +3632,11 @@
36323632
** ci = file commits only
36333633
** e = technical notes only
36343634
** f = forum posts only
36353635
** t = tickets only
36363636
** w = wiki commits only
3637
+** -u|--user USER Only show items associated with USER
36373638
** -v|--verbose Output the list of files changed by each commit
36383639
** and the type of each change (edited, deleted,
36393640
** etc.) after the check-in comment.
36403641
** -W|--width N Width of lines (default is to auto-detect). N must be
36413642
** either greater than 20 or it must be zero 0 to
@@ -3647,10 +3648,11 @@
36473648
int n, k, width;
36483649
const char *zLimit;
36493650
const char *zWidth;
36503651
const char *zOffset;
36513652
const char *zType;
3653
+ const char *zUser;
36523654
char *zOrigin;
36533655
char *zDate;
36543656
Blob sql;
36553657
int objid = 0;
36563658
Blob uuid;
@@ -3670,10 +3672,11 @@
36703672
}
36713673
db_find_and_open_repository(0, 0);
36723674
zLimit = find_option("limit","n",1);
36733675
zWidth = find_option("width","W",1);
36743676
zType = find_option("type","t",1);
3677
+ zUser = find_option("user","u",1);
36753678
zFilePattern = find_option("path","p",1);
36763679
zFormat = find_option("format","F",1);
36773680
zBr = find_option("branch","b",1);
36783681
if( find_option("current-branch","c",0)!=0 ){
36793682
if( !g.localOpen ){
@@ -3802,10 +3805,13 @@
38023805
mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
38033806
);
38043807
if( zType && (zType[0]!='a') ){
38053808
blob_append_sql(&sql, "\n AND event.type=%Q ", zType);
38063809
}
3810
+ if( zUser && (zUser[0]!='\0') ){
3811
+ blob_append_sql(&sql, "\n AND user0=%Q ", zUser);
3812
+ }
38073813
38083814
/* When zFilePattern is specified, compute complete ancestry;
38093815
* limit later at print_timeline() */
38103816
if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
38113817
db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
38123818
--- src/timeline.c
+++ src/timeline.c
@@ -3632,10 +3632,11 @@
3632 ** ci = file commits only
3633 ** e = technical notes only
3634 ** f = forum posts only
3635 ** t = tickets only
3636 ** w = wiki commits only
 
3637 ** -v|--verbose Output the list of files changed by each commit
3638 ** and the type of each change (edited, deleted,
3639 ** etc.) after the check-in comment.
3640 ** -W|--width N Width of lines (default is to auto-detect). N must be
3641 ** either greater than 20 or it must be zero 0 to
@@ -3647,10 +3648,11 @@
3647 int n, k, width;
3648 const char *zLimit;
3649 const char *zWidth;
3650 const char *zOffset;
3651 const char *zType;
 
3652 char *zOrigin;
3653 char *zDate;
3654 Blob sql;
3655 int objid = 0;
3656 Blob uuid;
@@ -3670,10 +3672,11 @@
3670 }
3671 db_find_and_open_repository(0, 0);
3672 zLimit = find_option("limit","n",1);
3673 zWidth = find_option("width","W",1);
3674 zType = find_option("type","t",1);
 
3675 zFilePattern = find_option("path","p",1);
3676 zFormat = find_option("format","F",1);
3677 zBr = find_option("branch","b",1);
3678 if( find_option("current-branch","c",0)!=0 ){
3679 if( !g.localOpen ){
@@ -3802,10 +3805,13 @@
3802 mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
3803 );
3804 if( zType && (zType[0]!='a') ){
3805 blob_append_sql(&sql, "\n AND event.type=%Q ", zType);
3806 }
 
 
 
3807
3808 /* When zFilePattern is specified, compute complete ancestry;
3809 * limit later at print_timeline() */
3810 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
3811 db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
3812
--- src/timeline.c
+++ src/timeline.c
@@ -3632,10 +3632,11 @@
3632 ** ci = file commits only
3633 ** e = technical notes only
3634 ** f = forum posts only
3635 ** t = tickets only
3636 ** w = wiki commits only
3637 ** -u|--user USER Only show items associated with USER
3638 ** -v|--verbose Output the list of files changed by each commit
3639 ** and the type of each change (edited, deleted,
3640 ** etc.) after the check-in comment.
3641 ** -W|--width N Width of lines (default is to auto-detect). N must be
3642 ** either greater than 20 or it must be zero 0 to
@@ -3647,10 +3648,11 @@
3648 int n, k, width;
3649 const char *zLimit;
3650 const char *zWidth;
3651 const char *zOffset;
3652 const char *zType;
3653 const char *zUser;
3654 char *zOrigin;
3655 char *zDate;
3656 Blob sql;
3657 int objid = 0;
3658 Blob uuid;
@@ -3670,10 +3672,11 @@
3672 }
3673 db_find_and_open_repository(0, 0);
3674 zLimit = find_option("limit","n",1);
3675 zWidth = find_option("width","W",1);
3676 zType = find_option("type","t",1);
3677 zUser = find_option("user","u",1);
3678 zFilePattern = find_option("path","p",1);
3679 zFormat = find_option("format","F",1);
3680 zBr = find_option("branch","b",1);
3681 if( find_option("current-branch","c",0)!=0 ){
3682 if( !g.localOpen ){
@@ -3802,10 +3805,13 @@
3805 mode==TIMELINE_MODE_PARENTS ) ? "<=" : ">=", zDate /*safe-for-%s*/
3806 );
3807 if( zType && (zType[0]!='a') ){
3808 blob_append_sql(&sql, "\n AND event.type=%Q ", zType);
3809 }
3810 if( zUser && (zUser[0]!='\0') ){
3811 blob_append_sql(&sql, "\n AND user0=%Q ", zUser);
3812 }
3813
3814 /* When zFilePattern is specified, compute complete ancestry;
3815 * limit later at print_timeline() */
3816 if( mode==TIMELINE_MODE_CHILDREN || mode==TIMELINE_MODE_PARENTS ){
3817 db_multi_exec("CREATE TEMP TABLE ok(rid INTEGER PRIMARY KEY)");
3818

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button