dyff icon indicating copy to clipboard operation
dyff copied to clipboard

simuluate git diff output

Open williamjoy opened this issue 2 years ago • 2 comments

Code mostly copied from dyff between , trying to resolve #189

  • accepts all arguments passed from git
  • generate similar diff context like built-in git diff
  • omit dyff header when running as external git diff tool
  • set GIT_CONFIG_PARAMETERS="'color.ui=always'" to enable color output

Tested with GIT_CONFIG_PARAMETERS="'color.ui=always'" git log --ext-diff -p '**/*.yml' in current repo:

Example output (and limitations)

commit c45a66f9da22f6676b31767dca2a9e68dd62a8a3
Author: Matthias Diester <[email protected]>
Date:   Sun Mar 27 22:32:28 2022 +0200

    Fix timestamp parse issue in JSON command
    
    Fixes #217
    
    Bump `github.com/gonvenience/neat` to pick up timestamp parsing fix.
    
    Add test case based on user feedback.

dyff --git a/assets/issues/issue-217/datestring.yml b/assets/issues/issue-217/datestring.yml
new file mode 100644
index 0000000..71d2450
--- /dev/null
+++ b/assets/issues/issue-217/datestring.yml

(root level)
+ ten map entries added:
  Datestring: 2033-12-20
  ThirteenthMonth: 2033-13-20
  FortyDays: 2033-13-40
  TheYear9999: 9999-11-20
  OneShortDatestring: 999-99-99
  ExtDatestring: 2021-01-01-04-05
  DatestringFake: 9999-99-99
  DatestringNonHyphenated: 99999999
  DatestringOneHyphen: 9999-9999
  DatestringSlashes: 2022/01/01


commit 9f044ad62aaa0354937be279cb7e815011c673b8
Author: Matthias Diester <[email protected]>
Date:   Mon Dec 6 20:45:04 2021 +0100

    Add Kubernetes specific document compare
    
    Introduce function to compare Kubernetes resources by their name.

dyff --git a/assets/issues/issue-184/from.yml b/assets/issues/issue-184/from.yml
new file mode 100644
index 0000000..cfaa8a4
--- /dev/null
+++ b/assets/issues/issue-184/from.yml
╭ Error: failed to compare input files
│ comparing YAMLs with a different number of documents is
│ currently not supported
╵
fatal: external diff died, stopping at assets/issues/issue-184/from.yml

williamjoy avatar Apr 28 '22 21:04 williamjoy

I am sorry, but I was very busy lately, but I am working through my backlog now. This PR will come next.

HeavyWombat avatar May 11 '22 14:05 HeavyWombat

I had a look already. For PRs like these, I tend to play around with the problem a bit to get a better feeling.

HeavyWombat avatar May 31 '22 19:05 HeavyWombat