feat(commit): exit early if no staged changes exist
This commit is contained in:
parent
ce3443f692
commit
bd1a29f1a4
1 changed files with 2 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
pkgs.writeShellScriptBin "commit" # bash
|
pkgs.writeShellScriptBin "commit" # bash
|
||||||
''
|
''
|
||||||
|
if git diff-index --quiet HEAD --; then exit 0; fi
|
||||||
|
|
||||||
PROMPT="Please generate a commit message for this diff."
|
PROMPT="Please generate a commit message for this diff."
|
||||||
GUIDELINES="1. Use conventional commit syntax, following the context. 2. Cap the commit message at 80 characters, preferably less. You must not go beyond this limit. 3. Do not include backticks. Only generate the raw text. 4. Be as succint as possible. Each commit should be atomic. You may throw a warning if it is not."
|
GUIDELINES="1. Use conventional commit syntax, following the context. 2. Cap the commit message at 80 characters, preferably less. You must not go beyond this limit. 3. Do not include backticks. Only generate the raw text. 4. Be as succint as possible. Each commit should be atomic. You may throw a warning if it is not."
|
||||||
NUM_ANCESTORS=0
|
NUM_ANCESTORS=0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue