Feature Request: View transformation operator for git commit object's read
From: Jacek Lipiec <hidden>
Date: 2021-01-22 17:51:33
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 [off-list ref]
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 [off-list ref]
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 [off-list ref]
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