From 5794af1c52bfa5d4b7364538364c769a3e79172d Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Thu, 17 Feb 2022 15:38:49 +0100 Subject: [PATCH] zsh:autoload:git-track: Make more portable Some distributions ship older versions of `column` that do not have the flags `-dNLO`. This is a workaround around this limitation that creates the same output using other tools. --- .config/zsh/autoload/git/git-track | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/zsh/autoload/git/git-track b/.config/zsh/autoload/git/git-track index 04ae6b1..79080c9 100755 --- a/.config/zsh/autoload/git/git-track +++ b/.config/zsh/autoload/git/git-track @@ -7,9 +7,10 @@ git for-each-ref --format='%(upstream),%(refname)' refs/heads refs/remotes \ s:(^|\n),([^/][^\n]*):\1\2,:g s:,/:,:g s:(^|\n)([^,]+),\n\2:\1\2:g - s:(^|\n)([^/,]*)([^\n]*\n\2(,|/))*:\n&:g - s:\n+$:\n: + s:(^|\n)([^/,]*)([^\n]*\n\2(,|/))*:\n,\n&:g + s:\n,\n+$:\n: ' \ | (echo remote,local; cat) \ - | column -tdLs, -Na,b -Ob,a \ + | sed -E 's:(.*),(.*):\2,\1:g; s:^,: ,:; s:,$:, :' \ + | column -ts, \ | sed '2d; 1{p;s/./―/g}'