Fossil Forum

drh 1 week, 6 days ago

Post: Is this a bug in the --branch option of "fossil diff"?

The "--branch NAME" option on the fossil diff command strives to show all the differences associated with that branch. But I think it is not doing that quite right.

Consider branch http1-1-chunked in Fossil itself. That branch derives from a trunk checkin on 2026-06-04, but there are three merge-ins from trunk, one on 2026-06-22 and two on 2026-07-25. The diff from the overall branch should be "from" the most recent merge-in to the tip of the branch, the equivalent of:

But if you do the "fossil gdiff --branch http1-1-checked" you get a diff that includes all of the merge-ins. The "to" is still the tip of the branch but the "from" becomes the root of the branch back on 2026-06-04, the equivalent of:

The "Diff" link at the top of the timeline page for the branch gets this right by using the last merge-in as the baseline. But not the "fossil diff" command.

The fix is trivial. I can do it in seconds. But the current behavior has been in the code for ages. Hence my question: If I fix this issue will it break something important that I don't know about?

wyoung 1 week, 6 days ago

It sounds like a case of the average user not even knowing they should ask for better behavior, for lack of awareness that it should be smarter about what’s wanted.

The only reason I know what you’re talking about is from my work editing the branching doc, and I believe I overlooked this issue because I go through /timeline to get the intended result, not the CLI.

Z 0

drh 1 week, 5 days ago

I want ahead and made the change (check-in 7a40eb97488b0462). If any serious objections are raised, we can talk about backing it out.

Keyboard Shortcuts

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