Feature Request: View transformation operator for git commit object's read
- From
- Jacek 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