Outgoing commits
(1) By sebyte on 2025-03-13 14:34:39 [link] [source]
Having switched transports (from HTTPS to SSH), I'm no longer able to push because fossil believes I lack the permission to write. This is a separate issue into which I shall dig at a later date. For now, I'd just like to know how to list unpushed commits? I've had a good look around and come up empty.
(2) By Stephan Beal (stephan) on 2025-03-13 14:40:38 in reply to 1 [link] [source]
I'd just like to know how to list unpushed commits?
Fossil doesn't actually have a way to do that, now that you mention it. There is a table, called unsent
, which contains the blob.rid
values of all blobs which are not yet pushed, but we've got no way, beyond SQL, to inspect that. (To the best of my recollection, it's never come up before.)
(3) By Richard Hipp (drh) on 2025-03-13 14:55:01 in reply to 2 [link] [source]
Furthermore, the UNSENT table is really just a hint. It is not authoritative. It contains a list of artifacts that have not been synced with any other instance of the repository. It does not know which artifacts have not been synced with another specific repo. To figure that out, the sync protocol has both repos send each other a list of artifacts that each holds, and then they compute the difference.
(6) By sebyte on 2025-03-14 12:07:20 in reply to 3 [link] [source]
Thank you for the clarification.
If I understand correctly, the question isn’t whether or not an artifcat has been “pushed”, it's whether or not an artifact exists on any given remote (at least as far as the sync protocol is concerned).
This begs the question, what is the function or purpose of the UNSENT table?
(7) By Stephan Beal (stephan) on 2025-03-14 12:23:54 in reply to 6 [source]
This begs the question, what is the function or purpose of the UNSENT table?
When fossil adds new blobs to the blob table in response to a local action (as opposed to receiving one via synchronization), it stores the blob.rid
of the blob in the unsent
table because it knows that blob has not yet been pushed anywhere. This is, to the best of my fallible understanding, primarily a performance optimization for figuring out which blobs need to be pushed the next time a sync is performed. unsent
is only part of the story, though, and i'm not familiar enough with the details of the sync protocol to say for certain what else plays a role in what gets synced.
(4.1) By sebyte on 2025-03-14 12:21:04 edited from 4.0 in reply to 2 [link] [source]
There is a table, called unsent, which contains the blob.rid values of all blobs which are not yet pushed
That'll do. Command:
for f in $(fossil all ls); do printf "%s: %d\n" $(basename $f) $(sqlite3 $f "select count(*) from unsent;"); done
tells me all I need to know. Thank you.
Now why does Fossil think I lack the permission to write? (The subject for another thread).
(5) By Stephan Beal (stephan) on 2025-03-14 12:06:23 in reply to 4.0 [link] [source]
select count(*) from unsent
Be aware that unsent
contains references to arbitrary blobs, not just checkins. If you want to count only checkins you'd need to do something like (untested):
select count(*) from unsent, event where objid=rid and type='ci';
(My unset
tables are all empty, so that's difficult to test.)
Noting, of course, the caveats Richard mentions.
(8) By sebyte on 2025-03-14 12:27:51 in reply to 5 [link] [source]
(My unset tables are all empty, so that's difficult to test.)
Mine are too. (Surprisingly).
It seems that, having switched transports, ‘insufficient permissions’ errors are being reported when, in fact, no error has taken place.
More digging required and, if necessary, I shall begin a new thread.