-
-
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
head: head_backwards for non-seekable files like /proc/* or fifos (named pipes) #5732
Merged
sylvestre
merged 25 commits into
uutils:main
from
cre4ture:feature/head_backwards_nonseekable_files
Jan 4, 2024
Merged
Changes from 15 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
185c8bb
implement head_backwards for non-seekable files like /proc/* or pipes
cre4ture 37bf664
try to fix windows CI/CD
cre4ture ef32af1
disable proc-fs related tests for macos
cre4ture 06c3329
cargo fmt
cre4ture 1190ab8
disable helper function for gnu compare on windows
cre4ture effc313
disable proc-fs related tests for freebsd
cre4ture 937283b
realized that read_but_last_n_xxx is already there
cre4ture 71a3df1
tmp commit of test with dev null and very largs number
cre4ture 98fa947
remove test again
cre4ture 58c90d1
add tests for head read backwards lines
cre4ture 3fa05c5
cleanup original location from previously move check
cre4ture 1d08a70
simplify tests - avoid comparison with live gnu
cre4ture d16d8b0
Merge branch 'main' into feature/head_backwards_nonseekable_files
cre4ture 9f51541
inject too small function run_and_check_if_it_outputs_something
cre4ture 4c58756
reduce code duplication
cre4ture 6e310b7
Merge remote-tracking branch 'origin/main' into feature/head_backward…
cre4ture f279461
function renaming to reflect the purpose
cre4ture c7ef228
implement gnu-compatibility optimization for small files
cre4ture e0af0f3
fix wrong testname
cre4ture 2cc6e35
cargo fmt
cre4ture 5d255be
rename variable to improve readability
cre4ture e90e8bc
windows: blksize is 512
cre4ture d9c1f4c
cargo fmt
cre4ture 68e7cb2
head: fix 32bit test
cre4ture d0ebc5a
Merge branch 'main' into feature/head_backwards_nonseekable_files
cre4ture File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rename this function to explain the goal, not the implementation
like
get_bytes()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is used at two places. Once for bytes and once for lines. So we could call it 'get_number_of_bytes_or_lines'.
But to be honest, I do currently not understand why this should improve the readability. The only reason for this function to be called is that the downcast from u64 to usize might not be possible if we are on a 32 bit platform and the user wants us to print all but last with very large number.
Could you please elaborate your proposal a bit more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I provided a new proposal. Let me know if your good with it.