Giter Club home page Giter Club logo

diffutils's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

diffutils's Issues

When "-" is used for standard input, the filename in the context/unified headers should be "-", not "/dev/stdin"

When passing in "-" as a parameter on the CLI invokation to use the standard input for either of the input files, in conjunction with the -c or -u options, the filenames displayed should be "-", not "/dev/stdin", to be consistent with GNU's implementation:

echo foo > foo

echo bar | /usr/bin/diff -u foo -
--- foo	2024-04-03 18:55:48.837847038 +0200
+++ -	2024-04-03 18:58:47.031319515 +0200
@@ -1 +1 @@
-foo
+bar

echo bar | cargo run --release -- -u foo -
--- foo	
+++ /dev/stdin	
@@ -1 +1 @@
-foo
+bar

Context diff doesn't display the last modification timestamp

tanmay@tanmay-lenovo:~/Desktop/projects/uutils/diffutils$ diff -c fruits_old.txt fruits_new.txt 
*** fruits_old.txt	2024-03-24 23:43:05.189597645 +0530
--- fruits_new.txt	2024-03-24 23:35:08.922581904 +0530
***************
*** 1,3 ****
  Apple
! Banana
  Cherry
--- 1,3 ----
  Apple
! Fig
  Cherry
tanmay@tanmay-lenovo:~/Desktop/projects/uutils/diffutils$ cargo run -- -c fruits_old.txt fruits_new.txt 
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/diffutils -c fruits_old.txt fruits_new.txt`
*** fruits_old.txt	
--- fruits_new.txt	
***************
*** 1,3 ****
  Apple
! Banana
  Cherry
--- 1,3 ----
  Apple
! Fig
  Cherry

`-q`/`--brief` option is not implemented

See GNU documentation for the -q/--brief option:

When you only want to find out whether files are different, and you don’t care what the differences are, you can use the summary output format. In this format, instead of showing the differences between the files, diff simply reports whether files differ. The --brief (-q) option selects this output format.

This format is especially useful when comparing the contents of two directories. It is also much faster than doing the normal line by line comparisons, because diff can stop analyzing the files as soon as it knows that there are any differences.

When range of lines is a single line, the format differs from upstream

For the normal diff, when range of lines is a single line, the format differs from upstream.

(spotted when trying to run the upstream test suite, specifically that test)

Upstream compacts range "a,a" as just "a":

echo a > a
echo b > b
diff a b | head -1 # outputs "1c1"

Whereas this implementation doesn't compact it:

cargo run a b # incorrectly outputs "1,1c1,1"

Code coverage in CI gets cancelled

When run on Windows, the code coverage workflow fails because running the tests fails (this is issue #3).

But when run on ubuntu-latest and macos-latest, the workflows get consistently cancelled before they finish running.
See e.g.:

ed format: when range of lines is a single line, the format differs from upstream

(similar to issue #10, but for the ed format)

For the ed diff format, when range of lines is a single line, the format differs from upstream.

Upstream compacts range "a,a" as just "a":

echo a > a
echo b > b
diff -e a b | head -1 # outputs "1c"

Whereas this implementation doesn't compact it:

cargo run -- -e a b # incorrectly outputs "1,1c"

Some tests require `ed` and fail if it is not installed

When running cargo test the following tests fail if ed is not installed:

  • ed_diff::tests::test_permutations
  • ed_diff::tests::test_permutations_empty_lines
  • ed_diff::tests::test_permutations_reverse

They fail because they call Command::new("ed").

Uploading reports to codecov.io fails

This seems to be failing consistently, at least on pushes to branches in my fork and in PRs.

See e.g. https://github.com/uutils/diffutils/actions/runs/8620214427/job/23626651978?pr=52 :

[2024-04-09T18:03:30.811Z] ['error'] There was an error running the uploader: Error uploading to [https://codecov.io:](https://codecov.io/) Error: There was an error fetching the storage URL during POST: 404 - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}

Could it be that the upload token has expired?

Windows tests are failing

---- context_diff::tests::test_permutations_reverse stdout ----
thread 'context_diff::tests::test_permutations_reverse' panicked at src\context_diff.rs:653:33:
Output { status: ExitStatus(ExitStatus(3)), stdout: "patching file target/context-diff//alefr\r\n", stderr: "Assertation failed!\r\n\r\nProgram: C:\\Strawberry\\c\\bin\\patch.exe\r\nFile: .\\src\\patch\\2.5.9\\patch-2.5.9-src\\patch.c, Line 354\r\n\r\nExpression: hunk\r\n" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- ed_diff::tests::test_permutations stdout ----
thread 'ed_diff::tests::test_permutations' panicked at src\ed_diff.rs:222:38:
called `Result::unwrap()` on an `Err` value: Error { kind: NotFound, message: "program not found" }

I wonder if this isn't the Windows "patch" command failing with \n ?!

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Detected dependencies

cargo
Cargo.toml
  • chrono 0.4.38
  • diff 0.1.13
  • regex 1.10.4
  • same-file 1.0.6
  • unicode-width 0.1.11
  • pretty_assertions 1
  • assert_cmd 2.0.14
  • predicates 3.1.0
  • tempfile 3.10.1
fuzz/Cargo.toml
  • libfuzzer-sys 0.4
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/checkout v4
  • actions/upload-artifact v4
  • actions/checkout v4
  • codecov/codecov-action v4
.github/workflows/fuzzing.yml
  • actions/checkout v4
  • Swatinem/rust-cache v2
  • actions/checkout v4
  • Swatinem/rust-cache v2
  • actions/cache v4
  • actions/cache v4
.github/workflows/release.yml
  • actions/checkout v4
  • actions/upload-artifact v4
  • actions/checkout v4
  • swatinem/rust-cache v2
  • actions/download-artifact v4
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/download-artifact v4
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/download-artifact v4
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/download-artifact v4
  • ncipollo/release-action v1
  • ubuntu 20.04
  • ubuntu 20.04
  • ubuntu 20.04

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.