From 17f6bf8640f51f1dc043106670edb39d22d2a5c6 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Tue, 2 Apr 2013 05:15:26 +0200 Subject: [PATCH] gitconfig: Add alias to display content of untracked files (u). --- gitconfig.m4 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gitconfig.m4 b/gitconfig.m4 index 1977f2e..1b7dc45 100644 --- a/gitconfig.m4 +++ b/gitconfig.m4 @@ -127,6 +127,24 @@ include(../lib.m4) \"Backup on $(date -R)\" >/dev/null \ && git stash apply >/dev/null" + # Display list and content of untracked files. Untracked directories + # and symbolic links are only listed. + u = "! git ls-files --other --exclude-standard --directory -z \ + | xargs -0 sh -c '\ + for x; do \ + printf \"\\033[1;33m-> %s\\033[0m:\" \"$x\"; \ + if test -d \"$x\"; then \ + echo \" directory\"; \ + elif test -h \"$x\"; then \ + echo \" symbolic link\"; \ + else \ + echo; \ + cat \"$x\"; \ + fi; \ + echo; \ + done' argv0 \ + | less" + [diff] # Detect copies and renames. renames = copy -- 2.45.2