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

diff: add -s option #940

Merged
merged 1 commit into from
Feb 5, 2025
Merged

diff: add -s option #940

merged 1 commit into from
Feb 5, 2025

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Feb 5, 2025

  • GNU and OpenBSD versions support the -s flag, which is similar to -q
  • -q shows a "files differ" messages instead of showing the diff
  • -s explicitly tells the user when the files are the same, instead of silently exiting
  • Improve how -q is documented; it doesn't print anything for identical files
  • -q and -s are not mutually exclusive
  • While here, remove manual assignments of $opt_u and $opt_c which are not needed (the subsequent code refers to $Context_Lines and not these variables)
%perl diff -qs a.c a.c
Files a.c and a.c are identical
%perl diff -qs a.c a.s
Files a.c and a.s differ

* GNU and OpenBSD versions support -s flag which is similar to -q
* -q hides the diff and shows a messages when the files are different
* -s explicitly tells the user when the files are the same
* Improve how -q is documented; it doesn't print anything for identical files
* -q and -s are not mutually exclusive
* While here, remove manual assignments of $opt_u and $opt_c which are not needed (the subsequent code refers to $Context_Lines and not these variables)

%perl diff -qs a.c a.c
Files a.c and a.c are identical
%perl diff -qs a.c a.s
Files a.c and a.s differ
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: diff The diff program labels Feb 5, 2025
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:08 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing February 5, 2025 07:09 — with GitHub Actions Inactive
@coveralls
Copy link

coveralls commented Feb 5, 2025

Pull Request Test Coverage Report for Build 13152062398

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 73.389%

Totals Coverage Status
Change from base Build 13126617666: 0.0%
Covered Lines: 353
Relevant Lines: 481

💛 - Coveralls

@briandfoy briandfoy self-assigned this Feb 5, 2025
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Feb 5, 2025
@briandfoy briandfoy merged commit 725ee97 into briandfoy:master Feb 5, 2025
22 of 23 checks passed
@briandfoy
Copy link
Owner

changes: add -s to show when files are the same instead of silently exiting

@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: diff The diff program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants