I'm tryingto write log alias
git config --global --replace-all alias.lol6 "! f() { echo "\$1"; git --no-pager log --oneline --graph -15 \${@}; }; f"
and use it like this:
git lol5 '@{-1}'
git log '@{-1}' #works
but the commit-ish passged to git is @-1
fatal: ambiguous argument '@-1': unknown revision or path not in the working tree
I read this post but didn't understand how to use it
Thanks Boaz
Some more information, tried @vonc advise
git config --global --replace-all alias.lol6 '! f() { echo "$1"; git --no-pager log --oneline --graph -15 ${@}; }; f'
Got same results, turn on GIT_TRACE
git lol6 @{-1}
20:20:37.454153 git.c:576 trace: exec: git-lol6 '@{-1}'
20:20:37.454153 run-command.c:640 trace: run_command: git-lol6 '@{-1}'
20:20:37.463150 run-command.c:640 trace: run_command: ' f() { echo "$1"; git --no-pager log --oneline --graph -15 ${@}; }; f' '@{-1}'
@-1
22:20:37.607150 git.c:344 trace: built-in: git log --oneline --graph -15 @-1
fatal: ambiguous argument '@-1': unknown revision or path not in the working tree.
Git is adding '' around first argument
But !!!, if I tried
git lol6 HEAD
20:30:35.621257 run-command.c:640 trace: run_command: ' f() { echo "$1"; git --no-pager log --oneline --graph -15 ${@}; }; f' HEAD
Git doesn't add '' around HEAD