Open devshorts opened 2 weeks ago
@devshorts Thank you for raising this issue.
Do you mean that add --hook-mode
flag so you can chain hooks like this in the prepare-commit-msg
file?
#!/bin/bash
COMMIT_EDITMSG_FILE_PATH=$1
DEFAULT_COMMIT_MSG=$(cat $COMMIT_EDITMSG_FILE_PATH)
CURRENT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
ISSUE_TICKET=$(echo "$CURRENT_BRANCH_NAME" | sed 's/.*\///')
echo "[#$ISSUE_TICKET] $DEFAULT_COMMIT_MSG" > $COMMIT_EDITMSG_FILE_PATH
...
aicommit2 --hook-mode
Yes exactly! This would be really slick On Nov 10, 2024, at 9:09 PM, Tak @.***> wrote: @devshorts Thank you for raising this issue. Do you mean that add --hook-mode flag so you can chain hooks like this in the prepare-commit-msg file?
COMMIT_EDITMSG_FILE_PATH=$1 DEFAULT_COMMIT_MSG=$(cat $COMMIT_EDITMSG_FILE_PATH) CURRENT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) ISSUE_TICKET=$(echo "$CURRENT_BRANCH_NAME" | sed 's/.*\///')
echo "[#$ISSUE_TICKET] $DEFAULT_COMMIT_MSG" > $COMMIT_EDITMSG_FILE_PATH
... aicommit2 --hook-mode
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
Feature request
The current code looks to determine if it's a git hook from the calling process name, however if you already have a git hook and want to chain them together (for example, prepending a Jira ticket name parsed from the branch name) then the hook's can't be staged together gracefully.
Ideally the cli would take a flag that you could indicate "--hook-mode" or something which then allows the auto generation of the commits without falling into a STDIN mode that isn't workable during a git hook
Why?
see request
Alternatives
No response
Additional context
No response