-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix #1063: Do not use 'more' or 'most' PAGER, as they are not compatible with bats output #1402
Conversation
In preparation of fixing issue sharkdp#1063. This is a pure refactoring with no intended functional side effects.
Thank you for your contribution. Before I take a closer look .... |
The pleasure is mine!
Sorry about the confusion... Looks like the issue #1063 has the wrong title? That made me accidentally give this PR also the wrong title. But the code itself only deals with Anyway, I just pushed an update to this PR that is free of (relevant) lint warnings and without formatting issues, so a bit more polished than before. Also made use of the new and shiny (Btw, seems like #1063 was accidentally marked as closed after merging my |
Both pagers do exist: |
After thinking about this a bit longer, I wonder if we should print a warning at all. If a user has set I think I would prefer the latter. @eth-p? @keith-hall? |
I would also prefer the latter. Maybe as a happy medium between the two options, we could eventually add the warning message to the |
I'm on macOS, and here,
and I can my make my
so I'm not sure we should not allow
Sounds good to me, I'll update the PR
Yes that is a good idea, but I'd say we can wait with that until we know for sure what behavior we want in the first place, so if it's OK with you I propose we keep that out-of-scope for this PR. |
Ah, I see. But in this case there's no advantage in allowing
👍 |
Very good point, and I completely agree. I will update the PR accordingly. |
But first do some quite significant refactorings to keep the code clean and easy to understand.
I updated the PR now after generalizing the code quite a bit, to get the code clean and nice (that was my intention at least). I did some sanity checks and I think the behavior is correct, including for edge cases like Before I figure out a way to write integration tests for this change, I would like to check with you if you think the big-picture-code looks good, and if the behavior is good now? (Make sure to review the changes with whitespace changes excluded due to indentation changes) |
I got some time over and wrote integration tests as well, using a strategy based on mocked versions of The app code remains unchanged and is still ready for code review. |
After some additional hackery I got the tests working on Windows too. So this PR is ready for full code review, and if Approved, can be merged. If you think my testing method that uses mocks is horrible, no worries, just let me know and we'll figure something out. I think the second-best option for testing this is to get info about the |
Planning to take a look soon - thank you very much! |
Oh dear, some weird clippy error after I updated Cargo.lock. Is it OK if I wait with sorting this out until you have done one round of CR? |
I understand you're a busy person, so if it would make life easier for you, I could split this PR up into smaller parts if you wish? I could for example move out the pager mocking testing support and some regression tests into a separate PR. |
Of course.
Thank you. The PR is completely fine. I just need to invest some time to think through this again before I can properly review it. That said, the diff is a bit hard to read as a lot of code has been moved. But I don't think that smaller PRs would really help there. That's something that I can manage 😄 |
Seems like you accidentally committed changes to |
I have updated the PR now and I think I took care of all comments. I decided to wait with testing out the As far as I know this PR can be merged now if Approved, but of course just let me know if you have more CR comments, no worries. |
Sounds great. Only if you are interested. It's not really necessary. And as I said before, I'm not sure if that would actually be better.
Looks great! Thank you for the updates. |
Hi! Here is a proposal on how to solve #1063, including integration tests.
There is a warning printed to stderr with instructions on how to silence. It looks like this:
the fix is a bit rough in the edges (for example, I just discovered it has some rust linter clippy warnings), but before I polish it, I just wanted to check what you think about the overall approach?
Looking forward to your comments!
Great project btw!