Skip to content

Commit

Permalink
Update docs for git diff usages
Browse files Browse the repository at this point in the history
  • Loading branch information
William Wei committed Apr 29, 2022
1 parent 47c2dc0 commit 9b3878d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ _Please note:_ This will install `dyff` based on the latest available code base.

```bash
# Setup
export KUBECTL_EXTERNAL_DIFF="dyff between --omit-header --set-exit-code"
export KUBECTL_EXTERNAL_DIFF="dyff between --omit-header --set-exit-code --kubectl-external-diff"

# Usage
kubectl diff [...]
Expand All @@ -96,12 +96,14 @@ _Please note:_ This will install `dyff` based on the latest available code base.

```bash
# Setup...
git config --local diff.dyff.command 'dyff_between() { dyff --color on between --omit-header "$2" "$5"; }; dyff_between'
echo '*.yml diff=dyff' >> .gitattributes
git config --local diff.dyff.command 'dyff git-diff'
echo '*.yml diff=dyff' >> .gitattributes
echo '*.yaml diff=dyff' >> .gitattributes
# And have fun, e.g.:
git log --ext-diff -u
git show --ext-diff HEAD
GIT_CONFIG_PARAMETERS="'color.ui=always'" git log --ext-diff -u '**/*.yaml' '**/*.yml'
```

![dyff between example of a Git commit](.docs/dyff-between-git-commits-example.png?raw=true "dyff in Git example of an example commit")
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/git_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
)

const (
// Arbitrary length of the git SHA1 in sortable format
// Arbitrary length of the git SHA1 in short format
// It does not calculate git-sha1
GIT_SHA1_LENGTH = 7
)
Expand Down

0 comments on commit 9b3878d

Please sign in to comment.