git:alias:track: Separate remotes with newlines

This commit is contained in:
2021-11-18 00:53:56 +01:00
parent 7b5dbd7851
commit 227495e7c7

View File

@@ -16,7 +16,7 @@
[alias]
root = rev-parse --show-toplevel
spull = "!__git_spull() { git pull \"$@\" && git submodule sync --recursive && git submodule update --init --recursive; }; __git_spull"
track = "!track() { git for-each-ref --format='%(upstream),%(refname)' refs/heads refs/remotes | sort -d | sed -Ez 's:,([^\\n]*)\\n\\1:\\1:g' | sed -E 's:(^|,)refs/(heads|remotes/):\\1:g; s:^,([^/].*):\\1,:; s:,/:,:' | column -ts, -N remote,local -O local,remote; }; track"
track = "!track() { git for-each-ref --format='%(upstream),%(refname)' refs/heads refs/remotes | sort -d | sed -E 's:(^|,)refs/(heads|remotes/):\\1:g; s:^,([^/].*):\\1,:; s:,/:,:' | sed -Ez 's:(^|\\n)([^,]+),\\n\\2:\\1\\2:g; s:(^|\\n)([^/,]*)([^\\n]*\\n\\2(,|/))*:\\n&:g; s:\\n+$:\\n:' | column -tLs, -N remote,local -O local,remote; }; track"
[status]
submodulesummary = true
[diff]