From: Konstantin Khomoutov Date: Tue, 05 Jul 2022 09:30:57 GMT Subject: Re: How to display "HEAD~*" in "git log" Message-ID: <20220705093057.5ewqobdjrqr3ul2k@carbon> In-Reply-To: <20220705092514.hsm7cou5bqvajvgq@carbon> On Tue, Jul 05, 2022 at 12:25:14PM +0300, Konstantin Khomoutov wrote: [...] > This is admittedly not convenient so it makes sense to turn into an alias: > > [alias] > relog = "!relog() { git log --oneline \"$@\" | { n=0; while read line; do printf 'HEAD~%d\t%s\n' $n \"$line\"; n=$((n+1)); done; }; }; relog" [...] An alternative to an alias it creating a specially named script file which must be executable and located in a directorly listed in the environment variable PATH. For instance, if you have ~/bin listed in your PATH, you can create a file named "git-relog" containing the encantation from my first mail in this thread, then call $ git relog and that script will be found and executed.