summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2026-01-07 13:25:41 +0100
committerache <ache@ache.one>2026-01-07 13:25:41 +0100
commit67fb495dfc488db2c64b7206697975b31ef43776 (patch)
tree052a4c7b4d273f6d8b3c9c38817dcca3de01c466
parentUse zoxide for the z directory shortcut (diff)
feat: Uses `env` when reading commit message from `/tmp/prev-ia-commit-message`
This change ensures that the environment variables are correctly propagated when reading the commit message from the temporary file, resolving potential issues with variable expansion.
-rwxr-xr-xfunctions/ia-commit.fish5
1 files changed, 2 insertions, 3 deletions
diff --git a/functions/ia-commit.fish b/functions/ia-commit.fish
index 8b35b63..1ea3135 100755
--- a/functions/ia-commit.fish
+++ b/functions/ia-commit.fish
@@ -12,7 +12,7 @@ function _ask
git commit -m (cat /tmp/prev-ia-commit-message | head -n 1)
else if [ $response = e ]
$EDITOR /tmp/prev-ia-commit-message
- cat /tmp/prev-ia-commit-message | head -n 1
+ env cat /tmp/prev-ia-commit-message
_ask
return $status
else if [ $response = r ]
@@ -25,10 +25,9 @@ function _ask
end
function ia-commit
- echo -e "Write a professional git commit message based on the a diff below. \nDo not preface the commit with anything, use the present tense, return the full sentence, and use the conventional commits specification (<type in lowercase>: <subject>)\n\n-----\n\n$(git diff --staged)" | hailper -p b-code | tee /tmp/prev-ia-commit-message
+ echo -e "Write a professional git commit message based on the diff below. DO NOT CODE. You goal is only to propose a **professionnal git commit message** corresponding to the git diff below. Here are the rulses\n\n1. Do not preface the commit message with greeting. \n2. Use the present tense. \n3. The first line MUST be a sentence that describe the following diff. \n4. The first line MUST follow the conventional commits specification (<type in lowercase>: <commit message>).\n\n\nHere is the git diff:\n\n\n----------\n\n\n$(git diff --staged)" | hailper -p commit-message | tee /tmp/prev-ia-commit-message
_ask
set -l ret $status
rm /tmp/prev-ia-commit-message 2>/dev/null
return $ret
-
end