{"thread":{"id":"61913","subject":"[Question] git-commit: --template from cmd output","startedAt":"2024-08-07T01:35:08Z","lastAt":"2024-08-07T01:35:08Z","messageCount":1,"participants":["Avid Seeker"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"500257","messageId":"exd_wMoR3eM-2oo-XbhCudo6nHa1cgm9cBIpSNvj5EFHBPeqveBW-44rILPLINIB5fxxrBLCpApjFYI55ckzEYNZr9qibkFcHnMI8FLQOj8=@protonmail.com","threadId":"61913","inReplyTo":null,"subject":"[Question] git-commit: --template from cmd output","fromName":"Avid Seeker","fromEmail":"avidseeker7@protonmail.com","sentAt":"2024-08-07T01:34:56Z","receivedAt":"2024-08-07T01:35:08Z","isPatch":false,"sender":{"key":"avidseeker7@protonmail.com","avatar":null},"body":"I'm trying to customize the commit message instructions showing up in text\neditor after `git commit`. Checking the docs, I found these flags of interest:\n\n- commit.verbose: useful flag to see the diff of changes done.\n- commit.status: for toggling whether to show status or not.\n- commit.template: this is what I was looking for, but when I checked the doc,\n  it turned out to be a useless.\n\nIMO, all of these flags are redundant and should be combined in one flag done in\nthe Unix way of doing one thing and doing it well, which is displaying commit\nmessage comments within the editor.\n\nThe way to do it is by having commit.template as a script:\n\ncommit.template = \"echo $COMMENTED_INSTRUCTIONS; git diff\" # commit --verbose\ncommit.template = \"echo $COMMENTED_INSTRUCTIONS; git status\" # commit --status\ncommit.template = \"\" # commit --no-status\ncommit.template = \"cat path/to/commit-msg-template\" # original commit --template\n\nWhere COMMENTED_INSTRUCTIONS are the lorem ipsum printed every time git commit is issued:\n# Please enter the commit message for your changes. Lines starting\n# with '#' will be ignored, and an empty message aborts the commit.\n\nOf course, to maintain compatibility, these options would stay, but my\nsuggestion is to have a way for commit.template to read from command output\ninstead of a file.\n\n-- Avid Seeker"}]}