Fossil Forum

Wiki diff in CLI?
Login

Wiki diff in CLI?

Wiki diff in CLI?

(1) By bohwaz on 2023-01-07 11:12:25 [link] [source]

I cannot find a way to diff a wiki page in command-line, when I try fossil diff -ci [hash of wiki page] I get an error: "Cannot resolve name: ..."

Is there another way to get the diff of a wiki page in command line?

Thank you :)

(2) By Stephan Beal (stephan) on 2023-01-07 12:09:26 in reply to 1 [link] [source]

Is there another way to get the diff of a wiki page in command line?

Not currently, no, or at least not as a one-step process. The libfossil utility named f-adiff (artifact diff) can do so if you have the hashes for both versions. That's something we can add to the "wiki" command, though.

i'm currently packing for a move, and working from a tablet, so cannot provide you with an example how to do so, but will try to remember to once i'm truly back online (middle/end of next week). If you don't hear back in about a week, feel free to ping this thread again (assuming nobody else provides a solution in the mean time).

(3) By bohwaz on 2023-01-07 12:31:23 in reply to 2 [link] [source]

Ah thanks I didn't think of trying libfossil.

I'm actually trying to set up an email alert, where it sends the full check-in diff, or ticket changes, or wiki page diff, when something happens on the repository, as I like to read the changes in my email client.

I wanted to use the JSON API but it is missing a way to get the ticket changes.

It is providing a way to diff between wiki revisions though.

So maybe I should mix using fossil CLI and JSON API to achieve what I'm looking for.

I'll take a new look at libfossil (thank you for your work!) to see if it can help as well.

(4) By Stephan Beal (stephan) on 2023-01-07 12:59:13 in reply to 3 [source]

I'm actually trying to set up an email alert, where it sends the full check-in diff, or ticket changes, or wiki page diff, when something happens on the repository, as I like to read the changes in my email client.

FWIW, diffs for wiki are generally not terribly useful because each full paragraph of wiki is (when they're edited via the web UI) a single line of text. Trying to decipher a single change in a 5k line of text is an unpleasant experience. The workarounds are either to edit wiki pages using normal editors, as opposed to the web interface, or to manually insert line breaks when using the web-based editor. Neither approach is terribly appealing.

I wanted to use the JSON API but it is missing a way to get the ticket changes.

Because the ticket system is "unduly flexible" ;), making it a lot of work to hook into the JSON API. (Patches would be gleefully considered!)

I'll take a new look at libfossil (thank you for your work!) to see if it can help as well.

Thank you :). The f-adiff tool takes the hashes of two arbitrary artifacts and diffs them, so it can diff "anything," with the caveat that the results will be meaningless when diffing two unrelated things (e.g. a ticket vs a wiki page).