Skip to contentSkip to conversation

cogito: cg-status option to show modified/uncommitted files

PATCH New Matt Porter 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cogito: cg-status option to show modified/uncommitted files

Adds a -a option to show all status of the working tree. After hacking around I like to see what's new AND what's modified but uncommitted.

-Matt

===================================================================

cg-status (mode:100755) renamed from cg-status (mode:100755 sha1:c9b69b9d54b6a6756f0ecad5324642eb66810b33) +17 -1
@@ -3,7 +3,8 @@
 # Show status of entries in your working tree.
 # Copyright (c) Petr Baudis, 2005
 #
-# Takes no arguments.
+# Takes an optional -a argument which will cause all repository status
+# to be shown, including modified but uncommitted files
 
 . cg-Xlib
 
@@ -20,3 +21,18 @@
 	shift
 done
 ' padding
+
+
+if [ "$1" = "-a" ]; then
+	{
+		update-cache --refresh
+	} | xargs -0 sh -c '
+while [ "$1" ]; do
+tag="M";
+filename=${1%: *};
+echo "$tag $filename";
+shift
+done
+' padding
+fi
+