From 4ccec6a4d0730e8e0ee13dabddaf8d67410b5dff Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Tue, 5 Apr 2022 12:34:48 -0700 Subject: [PATCH] diff: use `git diff --stat` instead of requiring `diffstat` Using the --stat flag also has the benefit of automatically colorizing the output when appropriate. Signed-off-by: Patrick McCarty --- Makefile.toplevel | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.toplevel b/Makefile.toplevel index 5eae9fd..c7444ec 100644 --- a/Makefile.toplevel +++ b/Makefile.toplevel @@ -159,11 +159,11 @@ status: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL)) if [ -d "$$p/.git" ] && [ -n "$$(git -C $$p status -uno --porcelain)" ]; then echo "Uncommitted changes in $$p:"; git -C "$$p" status --short; fi ;\ done -#help diff: Runs git diff for all package repos and displays the output using -#help diffstat. Requires that diffstat is installed. +#help diff: Runs git diff for all package repos and displays the diffstat using +#help the --stat flag. diff: $(PACKAGES_FILE) $(addprefix packages/,$(PKGS_LOCAL)) @for p in projects/common $(addprefix packages/,$(PKGS_LOCAL)); do \ - (cd $$p; git status --porcelain | grep -vq '^?? ' && (echo "Uncommitted changes in: $$p"; git diff | diffstat -p1); :) ;\ + (cd $$p; git status --porcelain | grep -vq '^?? ' && (echo "Uncommitted changes in: $$p"; git diff --stat); :) ;\ done #help log: Run git log origin/master..HEAD for all package repos, thus