Accessing Fossil
To access the fossil that is created for you, you must first load your SSH key(s). A task runs every few minutes that will create the fossil for you. The SSH page describes how to verify that your key has been loaded.
You can download pre-built Fossil executables here.
If you are using Linux, use the version there, NOT the one in the package installed by apt-get (it's probably out of date). If you say:dpkg --get-selections | grep fossil
and it prints out a line, you should say:sudo apt-get remove fossil
and then copy the version at the link above to /usr/local/bin
It's good practice to do fossil update
each time you are going to start working on your assignment.
This will merge in anything others might have committed (like a TA, or you on a different computer).
At the end of a session, you should do a fossil ci -m "what I did"
so that others can work with all the code you've created.
Initializing your repository
You only have to do this part once (per machine where you want to be able to access your repository). I suggest you do all the following from your home directory, but you may already have a directory for the course, and you can certainly put it there.. What you would type is shown in black, except using your Computer Science email id instead of aStudent.. There will be minor differences in the responses:
In all the examples below, I show the prompt as being in the top-level of the checkout directory. This is not necessary as, if you are anywhere within that directory tree, fossil will figure out what repository you are referring to.
: ~ ; mkdir cp8204 : ~ ; cd cp8204 : ~/cp8204 ; fossil clone ssh://cp8204@cp8204.cs.ryerson.ca/aStudent cp8204.fossil Round-trips: 2 Artifacts sent: 0 received: 9 Clone finished with 567 bytes sent, 2168 bytes received Rebuilding repository meta-data... 100.0% complete... project-id: 8d5970096fde36f734d6c14834ff8e61c302c8b0 server-id: 630acb605891d6913e8bd8c87099d5c65ee6ff11 admin-user: something (password is "27xxx2") : ~/cp8204 ; fossil open cp8204.fossil Autosync: ssh://cps506@cps506.cs.ryerson.ca/aStudent Round-trips: 1 Artifacts sent: 0 received: 0 Pull done, wire bytes sent: 340 received: 911 ip: cps506.cs.ryerson.ca .project A1/CPS506-A1-Tests/OrbitsTest.class.st A1/CPS506-A1-Tests/package.st A1/CPS506-A1/Orbits.class.st A1/CPS506-A1/package.st A2/README.md A2/lib/a2.ex A2/mix.exs A2/test/a2_test.exs A2/test/test_helper.exs A3/A3.cabal A3/CHANGELOG.md A3/app/Main.hs A3/src/MyLib.hs sample-input sample-output project-name: <unnamed> repository: /Users/dmason/CPS506/aStudent.fossil local-root: /Users/dmason/CPS506/ config-db: /Users/dmason/.fossil project-code: e29296ed76fee44c12d9f169ea628dcd031a7d45 checkout: 372bcb702c688bc1daaeac61d54f9f82a05fcbc5 2022-03-01 22:43:44 UTC parent: 479883c324b1ef82a906bd2f94a58c9bd7aac875 2022-03-01 22:43:43 UTC tags: trunk comment: default setup (user: dmason) check-ins: 2
Using browser-based GUI
Fossil is a very complete source-code management system. In addition to maintaining versions of files you commit, fossil will show you a timeline and show you the extent of any changes, which can be very useful in tracking down bugs. Fossil also includes a wiki (kind of like wikipedia) where you can easily record anything of interest (presumably related to the course (but of course you can create another fossil for use for other purposes)). Finally fossil includes a ticket-management system so that you can add bug reports for yourself, or new features you want to add to your code. (Obviously this would be much more useful for a larger system, with users other than you, but fossil has all this when/if you need it.)
To access all this, you need to fire up the user interface. This will start fossil running a mini web server, and tell your default browser to open up the home page on your fossil project.
: ~/cp8204 ; fossil ui
If you want this to terminate, simply type control-C in the console.
Checking in changes
As you work on your assignments, you should periodically check-in the changes you have made. Certainly you need to check-in when you are ready to submit your assignment or if you are moving to a different computer where you might want to continue working, but it's good practice to check-in whenever you have made any significant progress.
Until/unless you've done "fossil ci
" or "fossil commit
", it is not in the repository, and hence not available to be marked, and hence not submitted!
Before you check-in, you should use the fossil extra, add, rm, and status commands to make sure you are checking in the right things. (In particular don't check in images or other binary files!)
fossil extra
shows the files in the working directory that are not known about by fossil (except for ones in the ignore-glob
file.
: ~/cp8204 ; fossil extra Assign1 Assign1/Grades.java Assign1/GradesTest.java Assign1/Testing.java
fossil add
adds the files that fossil extra showed as potentially interesting. In both fossil extra and fossil add, you can specify files or directories to limit where it looks.
: ~/cp8204 ; fossil add Assign1 ADDED Assign1/Grades.java ADDED Assign1/GradesTest.java ADDED Assign1/Testing.java added 3 files
Oops, we really didn't mean to add Testing.java (there's nothing wrong with you putting other things in the repository, but this is just for example).
If you don't want some group of files (like .jar
files, for example, that shouldn't be in the repository) excluded, you should add a glob pattern to .fossil-settings/ignore-glob
, and then fossil extra and fossil add will ignore them.
But for this example, we'll just tell fossil to not include this file:
: ~/cp8204 ; fossil rm Assign1/Testing.java DELETED Assign1/Testing.java : ~/cp8204 ; ls Assign1 Grades.java GradesTest.java Testing.java package.bluej
Notice that the Testing.java file is still there, but you can see from the following stat command that fossil isn't tracking it:
: ~/cp8204 ; fossil stat repository: ~/cp8204/cp8204.fossil local-root: ~/cp8204 config-db: /Users/dmason/.fossil checkout: 52429add25bb5b155cba587b3c319e23434dbda9 2014-10-14 12:14:20 UTC parent: dce3d78001a17631ac9cbf5de9ef08a7fb9c3477 2014-10-14 12:14:20 UTC leaf: open tags: trunk comment: default setup (user: aStudent) ADDED Assign1/Grades.java ADDED Assign1/GradesTest.java
It's a good idea to always do a stat command before a check-in to make sure it will do what you expect.
In the fossil ci
command, the -m
switch is used to associate a message with the check-in.
If you don't use a -m switch, fossil will put you into an editor to create a message to associate with the check-in.
: ~/cp8204 ; fossil ci -m "initial version of assignment" Autosync: https://aStudent%40ryerson.ca@cp8204.scs.ryerson.ca/fossil/f2017/foo Round-trips: 1 Artifacts sent: 0 received: 0 Pull finished with 332 bytes sent, 435 bytes received New_Version: 851ccfa63c0cb2b38b7541cc579856e6b3145223 Autosync: https://aStudent%40ryerson.ca@cp8204.scs.ryerson.ca/fossil/f2017/foo Round-trips: 1 Artifacts sent: 2 received: 0 Sync finished with 726 bytes sent, 457 bytes received
That line that starts "New_Version
" is the key here.
It says that fossil has put your files into your local repository (at least).
If you see problems with syncing, the local repository may not have been replicated on the central server, and you should do a "fossil sync
" at some convenient time once the problem has been resolved (like once you're connected to the internet), but if it's in your local repository that's part of the battle.
However, until you see it successfully synced, it is not available for marking.
Synchronizing on other computers
If you will be working on multiple computers, fossil will easily keep them all with a current version of the code you are working on. When you check-in, fossil automatically does a sync, but if you have updated the wiki or added tickets, you will want to do an explicit sync before leaving the computer you've been working on. When you've logged in to the new computer, a fossil update will retrieve everything that you've committed or sync'ed elsewhere.
: ~/cp8204 ; fossil update
If you are working on multiple computers, or if the TA or professor have made any commits to your repository, then you may see mention of a branch or a fork. In this case you usually can simply do a merge and everything will be fine.
: ~/cp8204 ; fossil merge
Files to add to the repository
The files you submit to the repository should be original (usually text) files that contain the sources for your program, test data, and any explanatory files you want the professor or the TA to read.
Never add any of the following files to the repository: .class
, .jar
, .tar
, .zip
, .pdf
, or images (unless they are key to the assignment).
The general rule is don't add anything that is (or can be) automatically generated (this includes, for example, .ctxt
files generated by BlueJ).
Problems with Microsoft Windows
Read the page on command line operations to make sure that your PATH
is setup so that the fossil command works from anywhere.
Further Help
If you need additional help, you can simply say:
: ~/cp8204 ; fossil help
You can get detailed help on any command by adding the command name after help:
: ~/cp8204 ; fossil help merge