Joshua Spann: Fossil SCM's CLI

../ blog / fossil_cli

How to start CLImbing with Fossils

A Fossil of Paperwork

2024.10.09 - 2024.10.18

TLDR;

No Creating repos or managing files and commits. Instead there's adding tickets and editing wiki pages. No cheating with a bit of SQL right now. I will update as needed.

Introduction

I'm skipping all the relevant SCM commands for the CLI. The SCM commands are fairly straightforward and require no real effort to copypasta yet again and provide more outdated documentation when the originals are sufficient and quite extensive. However, most documentation for these special use cases involves that silly webGUI and not the basic workflow from the console. This is what I intend to address here!

NOTE: All commands are suffixed with the -R option to showcase how all these commands work with a repo that is not in an open checkout for the working directory, for... reasons.

Ticketing

fossil ticket ... -R myRepo.fossil

List Tickets

All Tickets: fossil ticket show 0 -R myRepo.fossil
To do a certain report, just replace 0 with the report number!

Add Ticket

$ fossil ticket add title "My Ticket" status MyStatus username myUsername comment "This is a test ticket" -R myRepo.fossil  
ticket add succeeded for f30e3ee9979f60615704baea206c057992744ff9

Edit Ticket

Add/Append Ticket Comment

$ fossil ticket change f30e3ee9979f icomment "This is a new comment!" username otherUser -R myRepo.fossil  
ticket set succeeded for f30e3ee9979f60615704baea206c057992744ff9

Close Ticket

$ fossil ticket set f30e3 status Closed -R myRepo.fossil  
ticket set succeeded for f30e3ee9979f60615704baea206c057992744ff9

Printing Ticket Info

$ fossil ticket history f30e3ee9979f60615704baea206c057992744ff9 -R myRepo.fossil  
Ticket Change by user on 2024-10-16 15:47:39:  
  Change status: Closed  
Ticket Change by user on 2024-10-16 15:45:05:  
  Change icomment: This is a new comment!  
  Change username: otherUser  
Ticket Change by user on 2024-10-16 15:43:05:  
  Change comment: This is a test ticket  
  Change status: MyStatus  
  Change title: My Ticket  
  Change username: myUsername  

Deleting Tickets

This is impossible without going to the SQL side of things.


Added 2024.10.16:


Wikis

fossil wiki ... -R myRepo.fossil

List Pages

$ fossil wiki list -R myRepo.fossil

Adding New Pages

$ fossil wiki create MyPage -R myRepo.fossil  
Hi there, this is test input from me!  
I can do multiple lines!  
Maybe this defaults to ed-like behavior?  
.  
^D  
^Z  
Created new wiki page MyPage.

Note: This was on Windows, I had to hold the Ctrl+z keys to send an end-of-file character to get out of input.
Linux/Unix uses Ctrl+d to do EOF character. After inserting the EOF alone on a new line, I pressed Enter and it created the ticket.

View Page Contents

$ fossil wiki export MyPage -R myRepo.fossil
Hi there, this is test input from me!
I can do multiple lines!
Maybe this defaults to ed-like behavior?
.

Edit Pages

$ fossil wiki commit MyPage -R myRepo.fossil
Wait, is this new content?
^Z
Updated wiki page MyPage.

$ fossil wiki export MyPage -R myRepo.fossil
Wait, is this new content?

Note: As you can see here, commit updates and overwrites the file content entirely!

Deleting Pages

$ fossil wiki delete MyPage -R myRepo.fossil
delete not yet implemented.