Commit the current staged changes.
- Run
git diff --staged. If empty, tell the user there is nothing staged and stop. - Run
git log --oneline -5to understand this repo's commit message style and conventions. - Run
git branch --show-currentto get the branch name. If it matches<type>/issue-<number>-<description>, the commit body isRefs linuxfoundation/lfx-cdp-insights-ops#<number>. Otherwise ask the user for the tracking issue number inlinuxfoundation/lfx-cdp-insights-ops; if they have none, commit without a body. - Generate a single commit message following Conventional Commits format:
type: description. Subject max 72 characters, lowercase, no trailing period, no issue reference. No scope required. The only body line is theRefsline from step 3. No extra trailers, no Co-Authored-By. (TheSigned-off-bytrailer is added automatically by-s.) - Run
git commit -s -S -m "<subject>" -m "<body>"using exactly the generated message (omit the second-mwhen there is no body). - Output only the commit hash and subject line from the result.