From 98d86f6cfae788a52ea3630eec53abd390f6a0f6 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Mon, 14 Nov 2022 21:11:56 -0800 Subject: [PATCH] Pare down git alias command, expand on its TODOs As-is, the `column -t` invocation works very poorly and is effectively useless as it can't communicate the information it ought to. For the time being (until the next Debian stable coreutils update) the format `alias = 'cmd'` is more readable and useful. This commit also expands a good bit on the ideal command chain of the post-coreutils update alias and the possible issues left to solve after that implementation is done. --- src/.gitconfig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/.gitconfig b/src/.gitconfig index 0651b4b..0cb77f5 100644 --- a/src/.gitconfig +++ b/src/.gitconfig @@ -1,7 +1,10 @@ [alias] - # TODO: fix columnizing (-l arg with v2.37+, or some other workaround?) - # TODO: wrap command column for long commands - alias = !git config --get-regexp '^alias\\.' | cut -d '.' -f '2-' | sed -re 's/^([^ ]+) /\\1*/g' | column -s '*' -t | sort + # TODO: add columnizing (after -l arg with linux-utils v2.37+, or some other workaround?) + # eg. git config -l | grep '^alias\\.' | cut -d '.' -f '2-' | column -s '=' -t -l 2 | sort + # TODO: wrap command column for long commands (depends on above) + # eg. column -s '=' -t -l 2 -N 'alias,val' -W val -d + # TODO: reduce extra space shown in command output from multiline aliases, see `co-pr` + alias = !git config -l | grep '^alias\\.' | cut -d '.' -f '2-' | sed -r -e 's/=/ = /' | sort amend = commit --amend amend-a = commit -a --amend # TODO: fix below; that method is not accurate