Skip to content

Commit bad3eab

Browse files
committed
docs: correct environment variable name in README 📚
- Update `AIGITCOMMIT_SIGNOFF` to `GIT_AUTO_SIGNOFF` in README for consistency - Reflect the correct variable used in the code for auto signoff feature Signed-off-by: mingcheng <[email protected]>
1 parent 66f63e5 commit bad3eab

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Initially, you must configure your `OPENAI_*` environment variables to request p
4747
- `OPENAI_API_BASE`: Your specified openAI request base
4848
- `OPENAI_MODEL_NAME`: Give the model name you wish to request
4949
- `OPENAI_API_PROXY`: The proxy address if you need to use a proxy
50-
- `AIGITCOMMIT_SIGNOFF`: If you want to sign off your commit messages, set this variable to `true`
50+
- `GIT_AUTO_SIGNOFF`: If you want to sign off your commit messages, set this variable to `true`
5151

5252
If your network requirements a proxy to access the API service, you must specify the proxy address using the `OPENAI_API_PROXY` environment variable.
5353

src/main.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* File Created: 2025-03-01 17:17:30
1010
*
1111
* Modified By: mingcheng ([email protected])
12-
* Last Modified: 2025-07-01 07:05:11
12+
* Last Modified: 2025-07-01 07:18:20
1313
*/
1414

1515
use aigitcommit::cli::Cli;
@@ -128,12 +128,13 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
128128
};
129129

130130
// Detect auto signoff from environment variable
131-
let need_signoff_from_env = env::var("GIT_AUTO_SIGNOFF")
132-
.map(|v| v == "1" || v.eq_ignore_ascii_case("true"))
133-
.unwrap_or(false);
131+
let need_signoff = cli.signoff
132+
|| env::var("GIT_AUTO_SIGNOFF")
133+
.map(|v| v == "1" || v.eq_ignore_ascii_case("true"))
134+
.unwrap_or(false);
134135

135136
// If the --signoff option is enabled, add signoff to the commit message
136-
if cli.signoff || need_signoff_from_env {
137+
if need_signoff {
137138
trace!("signoff option is enabled, will add signoff to the commit message");
138139
let (author_name, author_email) = (
139140
repository.get_author_name()?,

0 commit comments

Comments
 (0)