git:alias:track: Fix multiple branch filtering

This fixes the deletion/filtering of branches if there were multiple
local branches tracking the same remote branch.
This commit is contained in:
2021-11-15 18:51:55 +01:00
parent 3297ba81b4
commit f11be2c1a9

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)%(if)%(upstream)%(then),%(end)%(refname)' refs/heads refs/remotes | sort -uk1,1 -t, | sed -E 's/(.*),(.*)/\\2,\\1/; s:(heads/[^,]*)$:\\1,:; s:^refs/remotes/:,:; s:refs/[^/]*/::g' | column -ts,; }; track"
track = "!track() { git for-each-ref --format='%(upstream)%(if)%(upstream)%(then),%(end)%(refname)' refs/heads refs/remotes | sort | sed -Ez 's:(refs/remotes/[^\\n]*)\\n\\1:\\1:g' | sed -E 's/(.*),(.*)/\\2,\\1/; s:(heads/[^,]*)$:\\1,:; s:^refs/remotes/:,:; s:refs/[^/]*/::g' | column -ts,; }; track"
[status]
submodulesummary = true
[diff]