From: wuzhouhui <wuzhouhui14@mails.ucas.ac.cn>
To: Konstantin Khomoutov <kostix@bswap.ru>
Cc: git@vger.kernel.org
Subject: Re: How to display "HEAD~*" in "git log"
Date: Tue, 5 Jul 2022 17:36:52 +0800 [thread overview]
Message-ID: <a1e53e52-cb08-bbff-f58a-391932707fb7@mails.ucas.ac.cn> (raw)
In-Reply-To: <20220705093057.5ewqobdjrqr3ul2k@carbon>
On 7/5/22 17:30, Konstantin Khomoutov wrote:
> 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.
Thanks for your reply, it does solve my problems.
next prev parent reply other threads:[~2022-07-05 9:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-05 7:11 How to display "HEAD~*" in "git log" wuzhouhui
2022-07-05 9:25 ` Konstantin Khomoutov
2022-07-05 9:30 ` Konstantin Khomoutov
2022-07-05 9:36 ` wuzhouhui [this message]
2022-07-06 12:38 ` kostix
2022-07-06 14:38 ` Jeff King
2022-07-06 16:28 ` Konstantin Khomoutov
2022-07-06 16:49 ` Jeff King
2022-07-06 18:21 ` Konstantin Khomoutov
2022-07-07 17:06 ` Jeff King
2022-07-06 17:31 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a1e53e52-cb08-bbff-f58a-391932707fb7@mails.ucas.ac.cn \
--to=wuzhouhui14@mails.ucas.ac.cn \
--cc=git@vger.kernel.org \
--cc=kostix@bswap.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).