git:alias:track: Name the table columns

Also use `column` to reorder the columns instead of `sed`.
This commit is contained in:
2021-11-17 01:36:21 +01:00
parent 11dab14da3
commit 7b5dbd7851

View File

@@ -16,7 +16,7 @@
[alias] [alias]
root = rev-parse --show-toplevel root = rev-parse --show-toplevel
spull = "!__git_spull() { git pull \"$@\" && git submodule sync --recursive && git submodule update --init --recursive; }; __git_spull" 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:(.*),(.*):\\2,\\1:; s:^/::' | column -ts,; }; track" 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"
[status] [status]
submodulesummary = true submodulesummary = true
[diff] [diff]