Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cmd-diff
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def main():
args.diff_from = builds.get_previous()
args.diff_to = latest_build
elif args.diff_from is None:
args.diff_from = latest_build
args.diff_from = builds.get_previous()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, what were you trying to do that surprised you and motivated this?

E.g. if I do cosa diff --to=$build I expect the from to be the latest build. This matches git diff semantics. Having it actually diff against the previous build is confusing.

Copy link
Member Author

@dustymabe dustymabe Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the last commit in #4327

Basically I wanted to be able to not have to specify the previous build in cmd-build-with-buildah and have cosa diff detect that for me.

It also enables things like being able to run cosa diff --rpms without having to specify a --to and a --from at all, like rpm-ostree db diff does if you don't provide commits to it.

Maybe the behavior should be "if to is latest_build then from will default to previous_build, otherwise default to latest_build".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also enables things like being able to run cosa diff --rpms without having to specify a --to and a --from at all, like rpm-ostree db diff does if you don't provide commits to it.

Hmm, that's already the case today, no?

ISTM like in the last commit of #4327, we can just not pass in --to or --from at all in the default case. If there's a parent build, just passing --from should do the right thing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that's already the case today, no?

You are right. My mistake. I didn't see the opportunity to not pass in the --to there.

Reverted in #4327

elif args.diff_to is None:
args.diff_to = latest_build

Expand Down