Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --contains-pkgs=.. option to history list and info #1980

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

kontura
Copy link
Contributor

@kontura kontura commented Jan 3, 2025

Closes: #667

Also enhances description of `group` `--contains-pkgs=..` option and
history command changes.
@kontura kontura force-pushed the history-contains-pkgs branch from b0e70bc to bcb5a5b Compare January 10, 2025 06:44
When the default value of the transaction ID argument is only `last`
users searching for transactions with specific packages might be confused
why the output is empty.

For example:
```
$ dnf5 history info --contains-pkgs=htop
```
Would search only the last transaction. On the other hand `list` works as
expected:
```
$ dnf5 history list --contains-pkgs=htop
```
It searches all transactions becuase the default for `list` is all
transactions.
@kontura kontura force-pushed the history-contains-pkgs branch from bcb5a5b to 0e73f49 Compare January 10, 2025 06:46
@kontura kontura marked this pull request as ready for review January 10, 2025 06:47
@kontura
Copy link
Contributor Author

kontura commented Jan 10, 2025

I updated the PR to keep the current history info behavior (showing only the last transaction) but I have added a specific hint when filtered out.

It still bothers me a little that all the other dnf5 info subcommands default to printing all elements so I am open to discussing this further.

@m-blaha
Copy link
Member

m-blaha commented Jan 21, 2025

I updated the PR to keep the current history info behavior (showing only the last transaction) but I have added a specific hint when filtered out.

It still bothers me a little that all the other dnf5 info subcommands default to printing all elements so I am open to discussing this further.

Thank you! I agree that the behavior of dnf5 history info is a bit confusing. It’s not consistent with other * info commands, nor is it compatible with what dnf4 used to do.

It might be better to sacrifice compatibility with dnf4 info and have dnf5 history info default to showing information about all transactions. I do understand that the dnf4 info behavior, which prints only the last transaction, is quite handy. However, users would just need to adapt to using dnf5 history info last instead, which still sounds sane enough. This way we will at least keep consistency across all * info commands.

Copy link
Member

@m-blaha m-blaha left a comment

Choose a reason for hiding this comment

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

Thank you!

@m-blaha m-blaha added this pull request to the merge queue Jan 22, 2025
Merged via the queue into rpm-software-management:main with commit e0aa2b5 Jan 22, 2025
11 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"dnf5 history" cannot search by a package name
2 participants