GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Handle the rewrite of "-" to "/dev/stdin" in main to leave the filenames unchanged (fixes #46) by oSoMoN · Pull Request #47 · uutils/diffutils

Conversation

@oSoMoN

@oSoMoN oSoMoN commented Apr 3, 2024

Copy link
Copy Markdown
Collaborator

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@codecov

codecov Bot commented Apr 3, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 76.86%. Comparing base (9507ca2) to head (00a63af).

❗ Current head 00a63af differs from pull request most recent head e1c319f. Consider uploading reports for the commit e1c319f to get more accurate results

Files Patch % Lines
tests/integration.rs 80.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
- Coverage   76.98%   76.86%   -0.12%     
==========================================
  Files           9        9              
  Lines        2572     2576       +4     
  Branches      659      660       +1     
==========================================
  Hits         1980     1980              
- Misses        462      466       +4     
  Partials      130      130              
Flag Coverage Δ
macos_latest 77.04% <92.30%> (+0.69%) ⬆️
ubuntu_latest 76.90% <92.30%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sylvestre
sylvestre force-pushed the handle-stdin-filename branch from ac1d824 to 8a4e3d1 Compare April 4, 2024 06:49
@oSoMoN
oSoMoN marked this pull request as draft April 4, 2024 18:11
@oSoMoN

oSoMoN commented Apr 4, 2024

Copy link
Copy Markdown
Collaborator Author

I marked this PR as draft because reading "/dev/stdin" doesn't work on Windows, as was to be expected. Let's fix this while working on this code.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@oSoMoN
oSoMoN marked this pull request as ready for review April 4, 2024 20:22
oSoMoN added 2 commits April 8, 2024 20:21
@oSoMoN
Handle the rewrite of "-" to "/dev/stdin" in main to leave the filena…
6dc34fe
…mes unchanged (fixes uutils#46)
@oSoMoN
Use io::stdin() to read from standard input in a portable manner
84ad116
@oSoMoN
oSoMoN force-pushed the handle-stdin-filename branch from 00a63af to 84ad116 Compare April 8, 2024 18:21
BenWiederhake
BenWiederhake reviewed Apr 8, 2024
View reviewed changes
Comment thread src/params.rs
Comment on lines -479 to +480
from: os("/dev/stdin"),
to: os("/dev/stdin"),
from: os("-"),
to: os("-"),

@BenWiederhake BenWiederhake Apr 8, 2024

Copy link
Copy Markdown

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 keep at least one test that uses /dev/stdin. I think the right way to mark a test as "unix-only" is #[cfg(unix)] right before fn.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@oSoMoN oSoMoN Apr 8, 2024

Copy link
Copy Markdown
Collaborator Author

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.

Those tests do not actually exercise reading from stdin, only the parsing of command-line parameters. I don't see much added value to verifying that /dev/stdin doesn't get rewritten.

However I can add an integration test that exercises reading from /dev/stdin.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

BenWiederhake reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@BenWiederhake BenWiederhake Apr 9, 2024

Copy link
Copy Markdown

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.

Ah, sorry, I got that wrong. And thank you, that's exactly what I was hoping for! :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@oSoMoN
Add an integration test for reading from "/dev/stdin" on unix-like sy…
e1c319f
…stems
@sylvestre
sylvestre merged commit be66ff3 into uutils:main Apr 9, 2024
@oSoMoN
oSoMoN deleted the handle-stdin-filename branch April 30, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@BenWiederhake BenWiederhake BenWiederhake left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@oSoMoN @BenWiederhake @sylvestre
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.