From: Simon Ruderich Date: Tue, 2 Apr 2013 03:15:26 +0000 (+0200) Subject: gitconfig: Add alias to display content of untracked files (u). X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=commitdiff_plain;h=17f6bf8640f51f1dc043106670edb39d22d2a5c6 gitconfig: Add alias to display content of untracked files (u). --- 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