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 — Fix both files can return an error by GunterSchmidt · Pull Request #188 · uutils/diffutils

Conversation

@GunterSchmidt

@GunterSchmidt GunterSchmidt commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

The PR #159 changed the integration test cannot_read_files to only check for at least one file-not-found-error. GNU diff returns one file-not-found-error for each of the two given files.

This PR changes the test back (and includes the other utilities, as it was only run for 'diff') and I changed the code so that now both error message appear.

Sorry, something went wrong.

Uh oh!

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

All reactions
GunterSchmidt pushed a commit to GunterSchmidt/diffutils that referenced this pull request Mar 4, 2026
Gunter Schmidt
code cleanup
f1f0dbc
* ArgParser: removed default option, which does not exist in GNU diffutils
* fix test 'cannot_read_files' (same as PR uutils#188)
* merge test from PR uutils#159
zxvfc and others added 10 commits March 7, 2026 18:35
@zxvfc @sylvestre
Extract shared code to utils
382b016
@zxvfc @sylvestre
Make side_diff use separate set of formatting params
db337cb
@zxvfc @sylvestre
Add sdiff initiall implementation
ad5706b
@zxvfc @sylvestre
Add call of sdiff to main and basic integration test
f4211cc
@zxvfc @sylvestre
Fix usage side_diff in fuzzers
6281120
@zxvfc @sylvestre
Fix codestyle
ece4a9f
@zxvfc @sylvestre
Fix failed test
f3eea0f
@zxvfc @sylvestre
Add more tests for new code
0ca597d
@zxvfc @sylvestre
More tests for sdiff params parsing
3127494
Gunter Schmidt @sylvestre
fix: Restore file not found test and correct prg.
d446f97
Instead of 'fixing' the test, the program now acts
like the GNU original and returns up to two error
messages, one for each file.
@sylvestre
sylvestre force-pushed the Fix-both-files-can-return-an-error branch from 038f423 to d446f97 Compare March 7, 2026 17:35
@codspeed

codspeed Bot commented Mar 7, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 26 untouched benchmarks


Comparing GunterSchmidt:Fix-both-files-can-return-an-error (57beee7) with main (c624dc4)

Open in CodSpeed
All reactions

Sorry, something went wrong.

Uh oh!

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

@GunterSchmidt
Merge branch 'uutils:main' into Fix-both-files-can-return-an-error
57beee7
@GunterSchmidt GunterSchmidt mentioned this pull request Mar 9, 2026
Feat sdiff inital with parser #193
Closed
@marc-hb marc-hb mentioned this pull request May 7, 2026
sdiff initial implementation #159
Open
sylvestre
sylvestre reviewed May 14, 2026
View reviewed changes
Comment thread src/sdiff.rs
@@ -0,0 +1,404 @@
// This file is part of the uutils diffutils package.

@sylvestre sylvestre May 14, 2026

Copy link
Copy Markdown
Collaborator

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.

is it related ? :)

Sorry, something went wrong.

Uh oh!

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

All reactions
@sylvestre

sylvestre commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

are you still interested in this one? if not, i will close it, thanks

All reactions

Sorry, something went wrong.

Uh oh!

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

sylvestre
sylvestre reviewed Oct 18, 2026
View reviewed changes
Comment thread src/diff.rs
};
let to_content = match read_file_contents(&params.to) {
Ok(to_content) => to_content,
let (from_content, to_content) = match utils::read_both_files(&params.from, &params.to) {

@sylvestre sylvestre Oct 18, 2026

Copy link
Copy Markdown
Collaborator

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.

on main, diff already printed both errors (and the test had count(2)). what does this fix for diff?

Sorry, something went wrong.

Uh oh!

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

All reactions
sylvestre
sylvestre reviewed Oct 18, 2026
View reviewed changes
Comment thread src/sdiff.rs
);

io::stdout().write_all(&result).unwrap();
if result.is_empty() {

@sylvestre sylvestre Oct 18, 2026

Copy link
Copy Markdown
Collaborator

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.

side_diff::diff always returns vec![], so this always exits 0 even when the files differ, no?
please add a test checking the exit code and output of sdiff

Sorry, something went wrong.

Uh oh!

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

All reactions
sylvestre
sylvestre reviewed Oct 18, 2026
View reviewed changes
Comment thread src/utils.rs
) -> String {
let mut msg = format_failure_to_read_input_file(
executable,
&errors[0].0, // filepath,

@sylvestre sylvestre Oct 18, 2026

Copy link
Copy Markdown
Collaborator

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.

panics if errors is empty and ignores anything after the second entry
could just iterate and join with '\n', no?

Sorry, something went wrong.

Uh oh!

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

All reactions
sylvestre
sylvestre reviewed Oct 18, 2026
View reviewed changes
Comment thread tests/integration.rs
))
.count(2),
);
// TODO test fails for cmp

@sylvestre sylvestre Oct 18, 2026

Copy link
Copy Markdown
Collaborator

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.

why skip cmp? please fix it or open an issue

Sorry, something went wrong.

Uh oh!

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

All reactions
sylvestre
sylvestre reviewed Oct 18, 2026
View reviewed changes
Comment thread tests/integration.rs
file2.write_all("bar\n".as_bytes())?;

let mut cmd = cargo_bin_cmd!("diffutils");
cmd.arg("diff");

@sylvestre sylvestre Oct 18, 2026

Copy link
Copy Markdown
Collaborator

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.

this runs diff, not sdiff :)

Sorry, something went wrong.

Uh oh!

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

All reactions
@sylvestre

sylvestre commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

no news since my last ping, closing. reopen whenever you want to continue, thanks

All reactions

Sorry, something went wrong.

Uh oh!

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

@sylvestre sylvestre closed this Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sylvestre sylvestre sylvestre left review comments

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

@GunterSchmidt @sylvestre @zxvfc
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 01402520 — 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.