Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: [PATCH 3/3] help: respect aliases

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:17

Possibly related (same subject, not in this thread)

Hi,

On Sun, 24 Feb 2008, Jay Soffian wrote:
This too would be less ugly as a built-in:

    alias      = "! sh -c 'if test -z \"$1\"; then git config --list \
                  | expand \
                  | sed \"/^alias\\./!d; s/^alias\\.//; s/=/ /; s/  */ /g\" \
                  | sort | while read n v; do \
                  printf \"%-16s\" \"$n\"; echo \"$v\" | gnused \
                  \"s/\\(.\\{68\\}\\) /\\1\\n\t\t/g\" | expand; \
                  done; else git config \"alias.$1\"; fi' -"
Wow.  This would look less ugly as an alias like this, too:

alias = "!sh -c 'case $# in \
        0) git config --get-regexp \"^alias\\.\" | sed \"s/^alias\\.//\";; \
        *) git config \"alias.$0\" ;; \
        esac'"

which incidentally fixes a bug in your alias: you ignore $0 which is the 
first parameter when using the sh -c '' idiom.

Of course, you can change the sed call to your liking...

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help