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

Feature Request: View transformation operator for git commit object's read

From
JLJacek Lipiec <jacek.lipiec.bc@gmail.com>
Date
Jan 22, 2021, 17:27 UTC
Message-ID
<CAPGWkwdGvG5mAg85Ys_0NcwhsRoQ7_ago3nTPVo0oDBBZsf80Q@mail.gmail.com>
In-Reply-To
<001e01d6f0cd$f5aaed30$e100c790$@gmail.com>
Hey,

Recently I was thinking about various methods to bring order to a chaos of commit messages that are used throughout the dev space – namely conventional commits and, as alternative, emoji-log. First method focuses on context, while the second one focuses on presentation. Both are trying to bend current GIT capabilities to convey context.

Feature request: Option to add a transforming script to the output of all read operations on commit object.

Example:
   $ GIT SHOW FDCCAE00C2D112717306F91A21BFA2BBDDB7DCF6
   COMMIT FDCCAE00C2D112717306F91A21BFA2BBDDB7DCF6
   MERGE: 6A235DB 0FCD13B
   AUTHOR: JACEK LIPIEC <jacek.lipiec.bc@gmail.com>
   DATE:   THU NOV 7 21:11:45 2020 +0100
       FEAT(LANG): SOME LANG FEATURE
with view transformation script of, either:
   /^FEAT\((?<SCOPE>.+?)\)/ => 👌
   /^FEAT\((?<SCOPE>.+?)\)/ => <SPAN TITLE=”SCOPE: $SCOPE”>👌</SPAN>
it could work like this:
   $ GIT CONFIG VIEW.TRANSFORMATION.EMOJI=/^FEAT\((?<SCOPE>.+?)\):/ => 👌
   $ GIT CONFIG VIEW.TRANSFORMATION.FULLTEXT=/^FEAT\((?<SCOPE>.+?)\):/
=> FEATURE $REST WITH SCOPE $SCOPE
   $ GIT CONFIG
VIEW.TRANSFORMATION.SHELLSCRIPT=/HOME/JACEK/PARSE-COMMIT-MESSAGE.SH
   $ GIT SHOW –TRANSFORM=EMOJI FDCCAE00C2D112717306F91A21BFA2BBDDB7DCF6
   COMMIT FDCCAE00C2D112717306F91A21BFA2BBDDB7DCF6
   MERGE: 6A235DB 0FCD13B
   AUTHOR: JACEK LIPIEC <JACEK.LIPIEC.BC@GMAIL.COM>
   DATE:   THU NOV 7 21:11:45 2020 +0100
      👌: SOME LANG FEATURE
   $ GIT SHOW –TRANSFORM= FULLTEXT FDCCAE00C2D112717306F91A21BFA2BBDDB7DCF6
   COMMIT FDCCAE00C2D112717306F91A21BFA2BBDDB7DCF6
   MERGE: 6A235DB 0FCD13B
   AUTHOR: JACEK LIPIEC <JACEK.LIPIEC.BC@GMAIL.COM>
   DATE:   THU NOV 7 21:11:45 2020 +0100
    FEATURE SOME LANG FEATURE WITH SCOPE LANG

Would allow both backwards compatibility and an option to return a result in a way that can be easily read by humans, or alternatively, easily parsable by machine.

Z poważaniem/Regards, Jacek Lipiec

Message 1 of 1 in “Feature Request: View transformation operator for git commit object's read”
  1. Jacek LipiecJan 22, 2021

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.