]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - gitconfig.m4
gitconfig: Add alias for log with --color-words (lpw).
[config/dotfiles.git] / gitconfig.m4
index 1977f2e67955ff47e85d4a29e2ac8b6ee353b383..fa52f07e0fe9477ac074cc2d5aef2102152f0d60 100644 (file)
@@ -69,6 +69,7 @@ include(../lib.m4)
        l   = log
        ls  = log --stat
        lp  = log --patch PATIENCE
+       lpw = log --patch PATIENCE --color-words
        a   = add
        ap  = add --patch
        au  = add --update
@@ -127,6 +128,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