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

Head: ensure stdin input stream is correct on exit #7253

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

karlmcdowall
Copy link
Contributor

@karlmcdowall karlmcdowall commented Feb 1, 2025

Head tool now ensures that stdin is set to the last character that was output by the tool. This ensures that if any subsequent tools are run from the same input stream they will start at the correct point in the stream.

These changes should fix the head-pos.sh GNU test. This is tracked by issue #7028.

Copy link

github-actions bot commented Feb 2, 2025

GNU testsuite comparison:

Congrats! The gnu test tests/head/head-pos is no longer failing!
Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)

@karlmcdowall
Copy link
Contributor Author

Will un-bork the non-unix build and post an update...

Copy link

github-actions bot commented Feb 2, 2025

GNU testsuite comparison:

Congrats! The gnu test tests/head/head-pos is no longer failing!
Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)

Copy link

github-actions bot commented Feb 5, 2025

GNU testsuite comparison:

GNU test failed: tests/head/head. tests/head/head is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/head/head-pos is no longer failing!

@karlmcdowall karlmcdowall force-pushed the head_stdio_file branch 2 times, most recently from f48b315 to 3cd59f0 Compare February 5, 2025 03:29
@karlmcdowall karlmcdowall marked this pull request as ready for review February 5, 2025 03:54
Copy link

github-actions bot commented Feb 5, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/head/head-pos is no longer failing!

Copy link

github-actions bot commented Feb 7, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/head/head-pos is no longer failing!

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/head/head-pos is no longer failing!
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

@karlmcdowall karlmcdowall marked this pull request as draft February 20, 2025 16:14
@karlmcdowall karlmcdowall force-pushed the head_stdio_file branch 3 times, most recently from e09cc93 to bfccf75 Compare February 20, 2025 16:34
@karlmcdowall karlmcdowall marked this pull request as ready for review February 20, 2025 16:35
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/head/head-pos is no longer failing!
Skipping an intermittent issue tests/misc/usage_vs_getopt (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/head/head-pos is no longer failing!
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/head/head-pos is no longer failing!
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

Copy link
Collaborator

@jfinkels jfinkels left a comment

Choose a reason for hiding this comment

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

The code itself makes sense, I just have a question about the tests

Fix issue uutils#7028
Head tool now ensures that stdin is set to the last character
that was output by the tool. This ensures that if any subsequent
tools are run from the same input stream they will start at the
correct point in the stream.
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/head/head-pos is no longer failing!
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

@RenjiSann RenjiSann merged commit 76ad604 into uutils:main Feb 28, 2025
65 checks passed
@RenjiSann
Copy link
Collaborator

Thank you for your contribution ! 🥳

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.

head: fails to leave remaining bytes of file available for subsequent commands
3 participants