git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to display "HEAD~*" in "git log"

From
KKKonstantin Khomoutov <kostix@bswap.ru>
Date
Jul 5, 2022, 09:30 UTC
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.
Previous: Konstantin KhomoutovNext: wuzhouhui
Message 3 of 11 in “How to display "HEAD~*" in "git log"”
  1. wuzhouhuiJul 5, 2022
  2. Konstantin KhomoutovJul 5, 2022
  3. Konstantin KhomoutovJul 5, 2022
  4. wuzhouhuiJul 5, 2022
  5. kostix@bswap.ruJul 6, 2022
  6. Jeff KingJul 6, 2022
  7. Konstantin KhomoutovJul 6, 2022
  8. Jeff KingJul 6, 2022
  9. Konstantin KhomoutovJul 6, 2022
  10. Jeff KingJul 7, 2022
  11. Junio C HamanoJul 6, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.