summaryrefslogtreecommitdiff
path: root/home/xyz/.local/bin/gitmetap
diff options
context:
space:
mode:
Diffstat (limited to 'home/xyz/.local/bin/gitmetap')
-rwxr-xr-xhome/xyz/.local/bin/gitmetap6
1 files changed, 2 insertions, 4 deletions
diff --git a/home/xyz/.local/bin/gitmetap b/home/xyz/.local/bin/gitmetap
index 2a1e603e..5ebc8597 100755
--- a/home/xyz/.local/bin/gitmetap
+++ b/home/xyz/.local/bin/gitmetap
@@ -2,13 +2,11 @@
# -rw-r--r-- == binary 110100100 == octal 644
# https://stackoverflow.com/a/1796009
-$1 ls-tree -r --name-only --full-tree HEAD | awk -v a="$2/" '{printf("%s%s\n",a,$0)}' | tr '\n' '\0' | xargs -0 ls -ldA -- | awk '
-{
+$1 ls-tree -r --name-only --full-tree HEAD | awk -v a="$2/" '{printf("%s%s\n",a,$0)}' | tr '\n' '\0' | xargs -0 ls -ldA -- | awk '{
k=0
for(i=0;i<=8;i++)
k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i))
- if(k)
- {
+ if(k) {
for(i=10;$i && $i!="->";i++)
$9=$9" "$i
printf("%0o %s %s %s\n",k,$3,$4,$9)