Fish Shell: Abbreviation for ' pretty' git log
Fish shell is awesome! Unfortunately alias need a little bit of rewrite to work via the UI.I was trying to add this alias but it failed to save in fish-config web.
$ git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
The error I was getting via console:
$ git log --graph --pretty=format:%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset --abbrev-commit Tue 29 Oct 2019 09:23:40 AM -03
yellow: command not found
in command substitution
called on standard input
Command '%cr' not found, did you mean:
command 'acr' from deb acr
command 'ccr' from deb codecrypt
Try: sudo apt install <deb name>
in command substitution
called on standard input
Command 'bold' not found, did you mean:
command 'bld' from deb bld
command 'gold' from deb binutils
command 'fold' from deb coreutils
Try: sudo apt install <deb name>
in command substitution
called on standard input
An error occurred while redirecting file '%an'
open: No such file or directory
The solution seems to be enclosing the command into double quotes
$ abbr --add gl "git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"