From 8118937eebc50ffca2579da9873f882c522cade4 Mon Sep 17 00:00:00 2001 From: mingcheng Date: Wed, 5 Mar 2025 11:29:05 +0800 Subject: [PATCH 01/19] =?UTF-8?q?feat:=20implement=20signoff=20feature=20f?= =?UTF-8?q?or=20commit=20messages=20=E2=9C=8D=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add signoff option to CLI arguments in `cli.rs` - Implement author name and email retrieval in `git.rs` - Append signoff to commit message in `main.rs` if enabled - Add tests for author name and email functions in `git.rs` Signed-off-by: mingcheng --- src/git.rs | 6 +++--- src/main.rs | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/git.rs b/src/git.rs index d6d712c..dccdd1f 100644 --- a/src/git.rs +++ b/src/git.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 21:55:54 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-07-11 18:36:58 + * Last Modified: 2025-09-26 14:40:53 */ use git2::{Repository, RepositoryOpenFlags, Signature, StatusOptions}; @@ -222,7 +222,7 @@ mod tests { fn test_get_author_email() { let repo = setup(); if repo.is_err() { - error!("please specify the repository path"); + error!("Please specify the repository path"); return; } @@ -235,7 +235,7 @@ mod tests { fn test_get_author_name() { let repo = setup(); if repo.is_err() { - error!("please specify the repository path"); + error!("Please specify the repository path"); return; } diff --git a/src/main.rs b/src/main.rs index 686ee94..0fb07f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-07-11 18:39:26 + * Last Modified: 2025-09-26 14:41:04 */ use aigitcommit::cli::Cli; @@ -133,6 +133,19 @@ async fn main() -> std::result::Result<(), Box> { } }; + // If the --signoff option is enabled, add signoff to the commit message + if cli.signoff { + trace!("signoff option is enabled, will add signoff to the commit message"); + let (author_name, author_email) = ( + repository.get_author_name()?, + repository.get_author_email()?, + ); + + // Add signoff to the commit message + let signoff = format!("\n\nSigned-off-by: {} <{}>", author_name, author_email); + result.push_str(&signoff); + } + // Detect auto signoff from environment variable let need_signoff = cli.signoff || env::var("GIT_AUTO_SIGNOFF") From 823f9e0e4e9f04f8fbba687058451164d882d7e5 Mon Sep 17 00:00:00 2001 From: mingcheng Date: Wed, 5 Mar 2025 11:29:05 +0800 Subject: [PATCH 02/19] =?UTF-8?q?feat:=20add=20auto=20signoff=20detection?= =?UTF-8?q?=20from=20environment=20variable=20=E2=9C=8D=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implement detection of GIT_AUTO_SIGNOFF environment variable - Enable signoff if environment variable is set to true or 1 - Update logic to combine CLI signoff option with environment variable check Signed-off-by: mingcheng --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0fb07f1..ab23cf6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:41:04 + * Last Modified: 2025-09-26 14:41:21 */ use aigitcommit::cli::Cli; @@ -133,8 +133,13 @@ async fn main() -> std::result::Result<(), Box> { } }; + // Detect auto signoff from environment variable + let need_signoff_from_env = env::var("GIT_AUTO_SIGNOFF") + .map(|v| v == "1" || v.eq_ignore_ascii_case("true")) + .unwrap_or(false); + // If the --signoff option is enabled, add signoff to the commit message - if cli.signoff { + if cli.signoff || need_signoff_from_env { trace!("signoff option is enabled, will add signoff to the commit message"); let (author_name, author_email) = ( repository.get_author_name()?, From 7d250dab11be43c22ffe575432456b4209ac5ca0 Mon Sep 17 00:00:00 2001 From: mingcheng Date: Tue, 1 Jul 2025 06:23:49 +0800 Subject: [PATCH 03/19] =?UTF-8?q?docs:=20update=20README=20with=20new=20en?= =?UTF-8?q?vironment=20variable=20for=20signoff=20=F0=9F=93=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add `AIGITCOMMIT_SIGNOFF` environment variable to README - Mention auto sign-off feature when variable is set to true Signed-off-by: mingcheng --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6c9734..261b107 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Initially, you must configure your `OPENAI_*` environment variables to request p - `OPENAI_API_BASE`: Your specified openAI request base - `OPENAI_MODEL_NAME`: Give the model name you wish to request - `OPENAI_API_PROXY`: The proxy address if you need to use a proxy -- `GIT_AUTO_SIGNOFF`: If you want to sign off your commit messages, set this variable to `true` +- `AIGITCOMMIT_SIGNOFF`: If you want to sign off your commit messages, set this variable to `true` If your network requirements a proxy to access the API service, you must specify the proxy address using the `OPENAI_API_PROXY` environment variable. From 758c8f0f3ebbf5039446bc214094bbf3c08a92ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=9F=8E?= Date: Tue, 1 Jul 2025 07:13:53 +0800 Subject: [PATCH 04/19] =?UTF-8?q?style:=20update=20log=20message=20formatt?= =?UTF-8?q?ing=20in=20git=20and=20openai=20modules=20=F0=9F=96=8C=EF=B8=8F?= =?UTF-8?q?=20(#13)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace static string formatting with variable interpolation in log messages - Apply consistent formatting for trace logs across `git.rs` and `openai.rs` Signed-off-by: mingcheng Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/git.rs | 6 +++--- src/main.rs | 4 ++-- src/openai.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/git.rs b/src/git.rs index dccdd1f..f807774 100644 --- a/src/git.rs +++ b/src/git.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 21:55:54 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:40:53 + * Last Modified: 2025-09-26 14:41:38 */ use git2::{Repository, RepositoryOpenFlags, Signature, StatusOptions}; @@ -222,7 +222,7 @@ mod tests { fn test_get_author_email() { let repo = setup(); if repo.is_err() { - error!("Please specify the repository path"); + error!("please specify the repository path"); return; } @@ -235,7 +235,7 @@ mod tests { fn test_get_author_name() { let repo = setup(); if repo.is_err() { - error!("Please specify the repository path"); + error!("please specify the repository path"); return; } diff --git a/src/main.rs b/src/main.rs index ab23cf6..f2e40d4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:41:21 + * Last Modified: 2025-09-26 14:41:46 */ use aigitcommit::cli::Cli; @@ -147,7 +147,7 @@ async fn main() -> std::result::Result<(), Box> { ); // Add signoff to the commit message - let signoff = format!("\n\nSigned-off-by: {} <{}>", author_name, author_email); + let signoff = format!("\n\nSigned-off-by: {author_name} <{author_email}>"); result.push_str(&signoff); } diff --git a/src/openai.rs b/src/openai.rs index b37c5af..e77ea10 100644 --- a/src/openai.rs +++ b/src/openai.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 21:55:58 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-07-11 17:45:53 + * Last Modified: 2025-09-26 14:41:49 */ use crate::cli; From 3766ebf41ea7ed68241f2e001e8d31b3e7ec8e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=9F=8E?= Date: Tue, 1 Jul 2025 07:13:53 +0800 Subject: [PATCH 05/19] =?UTF-8?q?docs:=20correct=20environment=20variable?= =?UTF-8?q?=20name=20in=20README=20=F0=9F=93=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- README.md | 2 +- src/main.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 261b107..f6c9734 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Initially, you must configure your `OPENAI_*` environment variables to request p - `OPENAI_API_BASE`: Your specified openAI request base - `OPENAI_MODEL_NAME`: Give the model name you wish to request - `OPENAI_API_PROXY`: The proxy address if you need to use a proxy -- `AIGITCOMMIT_SIGNOFF`: If you want to sign off your commit messages, set this variable to `true` +- `GIT_AUTO_SIGNOFF`: If you want to sign off your commit messages, set this variable to `true` If your network requirements a proxy to access the API service, you must specify the proxy address using the `OPENAI_API_PROXY` environment variable. diff --git a/src/main.rs b/src/main.rs index f2e40d4..1044f12 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:41:46 + * Last Modified: 2025-09-26 14:41:58 */ use aigitcommit::cli::Cli; @@ -134,12 +134,13 @@ async fn main() -> std::result::Result<(), Box> { }; // Detect auto signoff from environment variable - let need_signoff_from_env = env::var("GIT_AUTO_SIGNOFF") - .map(|v| v == "1" || v.eq_ignore_ascii_case("true")) - .unwrap_or(false); + let need_signoff = cli.signoff + || env::var("GIT_AUTO_SIGNOFF") + .map(|v| v == "1" || v.eq_ignore_ascii_case("true")) + .unwrap_or(false); // If the --signoff option is enabled, add signoff to the commit message - if cli.signoff || need_signoff_from_env { + if need_signoff { trace!("signoff option is enabled, will add signoff to the commit message"); let (author_name, author_email) = ( repository.get_author_name()?, From 2322b50d38d82c9cfbc39978fa5e0e6bbf9b7385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=9F=8E?= Date: Tue, 1 Jul 2025 07:13:53 +0800 Subject: [PATCH 06/19] =?UTF-8?q?style:=20update=20log=20message=20formatt?= =?UTF-8?q?ing=20in=20git=20and=20openai=20modules=20=F0=9F=96=8C=EF=B8=8F?= =?UTF-8?q?=20(#13)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace static string formatting with variable interpolation in log messages - Apply consistent formatting for trace logs across `git.rs` and `openai.rs` Signed-off-by: mingcheng Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 1044f12..5fd4239 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:41:58 + * Last Modified: 2025-09-26 14:42:21 */ use aigitcommit::cli::Cli; From 5a433d84cdac6dad7d526382f1cb1498f53ce30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=9F=8E?= Date: Tue, 1 Jul 2025 07:13:53 +0800 Subject: [PATCH 07/19] =?UTF-8?q?docs:=20correct=20environment=20variable?= =?UTF-8?q?=20name=20in=20README=20=F0=9F=93=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5fd4239..c1610e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:42:21 + * Last Modified: 2025-09-26 14:42:28 */ use aigitcommit::cli::Cli; From 1fec4c77a0f43b0543ba05364b3f3e7df044c90f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=9F=8E?= Date: Tue, 1 Jul 2025 07:13:53 +0800 Subject: [PATCH 08/19] =?UTF-8?q?docs:=20update=20file=20modification=20ti?= =?UTF-8?q?mestamps=20=F0=9F=93=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adjust last modified timestamps in `main.rs` and `openai.rs` for accuracy - Resolve merge conflict timestamp in `main.rs` to reflect latest update Signed-off-by: mingcheng --- src/main.rs | 2 +- src/openai.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index c1610e9..5849a12 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:42:28 + * Last Modified: 2025-09-26 14:42:36 */ use aigitcommit::cli::Cli; diff --git a/src/openai.rs b/src/openai.rs index e77ea10..42e9fe6 100644 --- a/src/openai.rs +++ b/src/openai.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 21:55:58 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:41:49 + * Last Modified: 2025-09-26 14:42:34 */ use crate::cli; From 4a2fd05150b72a83ea4e62fbd761c1e3d7501115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=9F=8E?= Date: Tue, 1 Jul 2025 07:53:04 +0800 Subject: [PATCH 09/19] =?UTF-8?q?feat:=20update=20version=20to=201.3.3=20a?= =?UTF-8?q?nd=20add=20grok=20keyword=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bump version from 1.3.2 to 1.3.3 in Cargo.toml - Add "grok" to keywords list in package metadata --- Cargo.lock | 80 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d164b6..a051848 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2025 Hangzhou Guanwaii Technology Co,.Ltd. + * + * This source code is licensed under the MIT License, + * which is located in the LICENSE file in the source tree's root directory. + * + * File: Cargo.lock + * Author: mingcheng (mingcheng@apache.org) + * File Created: 2025-09-26 14:42:38 + * + * Modified By: mingcheng (mingcheng@apache.org) + * Last Modified: 2025-09-26 14:42:45 + */ + # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 @@ -267,9 +281,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.29" +version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ "jobserver", "libc", @@ -290,9 +304,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "clap" -version = "4.5.41" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", "clap_derive", @@ -300,9 +314,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.41" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", @@ -312,9 +326,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.41" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" dependencies = [ "heck", "proc-macro2", @@ -881,9 +895,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.15" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df" +checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" dependencies = [ "base64", "bytes", @@ -1435,9 +1449,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.5.1+3.5.1" +version = "300.5.0+3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735230c832b28c000e3bc117119e6466a663ec73506bc0a9907ea4187508e42a" +checksum = "e8ce546f549326b0e6052b649198487d91320875da901e7bd11a06d1ee3f9c2f" dependencies = [ "cc", ] @@ -1682,9 +1696,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.22" +version = "0.12.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" +checksum = "4c8cea6b35bcceb099f30173754403d2eba0a5dc18cea3630fccd88251909288" dependencies = [ "base64", "bytes", @@ -1799,9 +1813,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.29" +version = "0.23.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1" +checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" dependencies = [ "once_cell", "ring", @@ -1835,9 +1849,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.4" +version = "0.103.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" dependencies = [ "ring", "rustls-pki-types", @@ -1999,9 +2013,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "slab" -version = "0.4.11" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] name = "smallvec" @@ -2189,9 +2203,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.46.1" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", @@ -2563,6 +2577,28 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-link" version = "0.1.3" From 254047adda12dc542804bc612ec7a689139a8723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=9F=8E?= Date: Tue, 1 Jul 2025 07:53:04 +0800 Subject: [PATCH 10/19] =?UTF-8?q?feat:=20add=20CLI=20check=20for=20OpenAI?= =?UTF-8?q?=20API=20and=20model=20availability=20=F0=9F=94=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Introduce --check flag in CLI to verify API key and model - Implement check_model function to list and validate available models - Integrate check logic in main.rs with error handling - Comment out unused dependencies in Cargo.toml - Update package categories in Cargo.toml --- Cargo.lock | 40 ++++++++++++++++++++-------------------- src/main.rs | 6 ++++-- src/openai.rs | 9 ++++++--- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a051848..524a7db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -281,9 +281,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.27" +version = "1.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" +checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" dependencies = [ "jobserver", "libc", @@ -304,9 +304,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "clap" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" +checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" dependencies = [ "clap_builder", "clap_derive", @@ -314,9 +314,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" +checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" dependencies = [ "anstream", "anstyle", @@ -326,9 +326,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.40" +version = "4.5.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" +checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" dependencies = [ "heck", "proc-macro2", @@ -895,9 +895,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" +checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df" dependencies = [ "base64", "bytes", @@ -1449,9 +1449,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.5.0+3.5.0" +version = "300.5.1+3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ce546f549326b0e6052b649198487d91320875da901e7bd11a06d1ee3f9c2f" +checksum = "735230c832b28c000e3bc117119e6466a663ec73506bc0a9907ea4187508e42a" dependencies = [ "cc", ] @@ -1696,9 +1696,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.21" +version = "0.12.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8cea6b35bcceb099f30173754403d2eba0a5dc18cea3630fccd88251909288" +checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" dependencies = [ "base64", "bytes", @@ -1813,9 +1813,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.28" +version = "0.23.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" +checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1" dependencies = [ "once_cell", "ring", @@ -1849,9 +1849,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.3" +version = "0.103.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" +checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" dependencies = [ "ring", "rustls-pki-types", @@ -2203,9 +2203,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.45.1" +version = "1.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" +checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" dependencies = [ "backtrace", "bytes", diff --git a/src/main.rs b/src/main.rs index 5849a12..8712e90 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:42:36 + * Last Modified: 2025-09-26 14:42:54 */ use aigitcommit::cli::Cli; @@ -93,7 +93,9 @@ async fn main() -> std::result::Result<(), Box> { debug!("the model name `{}` is available", model_name); } Err(e) => { - return Err(format!("the model name `{model_name}` is not available: {e}").into()); + return Err( + format!("the model name `{}` is not available: {e}", model_name).into(), + ); } } } diff --git a/src/openai.rs b/src/openai.rs index 42e9fe6..59ed937 100644 --- a/src/openai.rs +++ b/src/openai.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 21:55:58 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:42:34 + * Last Modified: 2025-09-26 14:42:54 */ use crate::cli; @@ -97,10 +97,13 @@ impl OpenAI { list.data.iter().map(|m| &m.id).collect::>() ); if list.data.iter().any(|model| model.id == model_name) { - debug!("OpenAI API is reachable and model {model_name} is available"); + debug!( + "OpenAI API is reachable and model {} is available", + model_name + ); Ok(()) } else { - Err(format!("Model {model_name} not found").into()) + Err(format!("Model {} not found", model_name).into()) } } Err(e) => Err(e.into()), From 0bb7d81599f251acec77033faa5d7531e2ee9b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=9F=8E?= Date: Tue, 1 Jul 2025 07:53:04 +0800 Subject: [PATCH 11/19] =?UTF-8?q?refactor:=20simplify=20string=20formattin?= =?UTF-8?q?g=20in=20model=20validation=20=F0=9F=9B=A0=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update error message formatting in main.rs to use direct variable interpolation - Simplify debug and error messages in openai.rs with consistent string formatting - Remove redundant string concatenation for cleaner code readability Signed-off-by: mingcheng --- src/main.rs | 6 ++---- src/openai.rs | 9 +++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8712e90..cc1acf0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:42:54 + * Last Modified: 2025-09-26 14:43:10 */ use aigitcommit::cli::Cli; @@ -93,9 +93,7 @@ async fn main() -> std::result::Result<(), Box> { debug!("the model name `{}` is available", model_name); } Err(e) => { - return Err( - format!("the model name `{}` is not available: {e}", model_name).into(), - ); + return Err(format!("the model name `{model_name}` is not available: {e}").into()); } } } diff --git a/src/openai.rs b/src/openai.rs index 59ed937..671a60e 100644 --- a/src/openai.rs +++ b/src/openai.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 21:55:58 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:42:54 + * Last Modified: 2025-09-26 14:43:10 */ use crate::cli; @@ -97,13 +97,10 @@ impl OpenAI { list.data.iter().map(|m| &m.id).collect::>() ); if list.data.iter().any(|model| model.id == model_name) { - debug!( - "OpenAI API is reachable and model {} is available", - model_name - ); + debug!("OpenAI API is reachable and model {model_name} is available"); Ok(()) } else { - Err(format!("Model {} not found", model_name).into()) + Err(format!("Model {model_name} not found").into()) } } Err(e) => Err(e.into()), From 25bd5b81a33ba1d432e53a116b9bb27a2149a803 Mon Sep 17 00:00:00 2001 From: mingcheng Date: Fri, 11 Jul 2025 18:43:22 +0800 Subject: [PATCH 12/19] =?UTF-8?q?feat:=20implement=20signoff=20feature=20f?= =?UTF-8?q?or=20git=20commits=20=E2=9C=8D=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add support for signed-off-by line in commit messages with configurable option - Refactor commit function to accept signoff parameter in git.rs - Retrieve author name and email from repository config for signoff - Remove redundant signoff logic from main.rs and centralize in git.rs - Update commit call in main.rs to pass signoff requirement Signed-off-by: mingcheng --- src/git.rs | 2 +- src/main.rs | 21 +-------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/git.rs b/src/git.rs index f807774..cf57c05 100644 --- a/src/git.rs +++ b/src/git.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 21:55:54 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:41:38 + * Last Modified: 2025-09-26 14:43:17 */ use git2::{Repository, RepositoryOpenFlags, Signature, StatusOptions}; diff --git a/src/main.rs b/src/main.rs index cc1acf0..2fefd44 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:43:10 + * Last Modified: 2025-09-26 14:43:17 */ use aigitcommit::cli::Cli; @@ -133,25 +133,6 @@ async fn main() -> std::result::Result<(), Box> { } }; - // Detect auto signoff from environment variable - let need_signoff = cli.signoff - || env::var("GIT_AUTO_SIGNOFF") - .map(|v| v == "1" || v.eq_ignore_ascii_case("true")) - .unwrap_or(false); - - // If the --signoff option is enabled, add signoff to the commit message - if need_signoff { - trace!("signoff option is enabled, will add signoff to the commit message"); - let (author_name, author_email) = ( - repository.get_author_name()?, - repository.get_author_email()?, - ); - - // Add signoff to the commit message - let signoff = format!("\n\nSigned-off-by: {author_name} <{author_email}>"); - result.push_str(&signoff); - } - // Detect auto signoff from environment variable let need_signoff = cli.signoff || env::var("GIT_AUTO_SIGNOFF") From c145e60f8b2314d2e1781c444dfb7d35fbf27776 Mon Sep 17 00:00:00 2001 From: mingcheng Date: Fri, 18 Jul 2025 11:59:35 +0800 Subject: [PATCH 13/19] =?UTF-8?q?feat:=20update=20system=20template=20with?= =?UTF-8?q?=20new=20requirements=20=E2=9C=8F=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add instructions for generating git commit messages - Include details on diff-based message creation - Remove signed-off-by message from commit instructions - Update examples to reflect recent commit styles Signed-off-by: mingcheng --- templates/system.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/system.txt b/templates/system.txt index 43b67fc..24b35d8 100644 --- a/templates/system.txt +++ b/templates/system.txt @@ -27,6 +27,8 @@ Please generate a git commit message with the specified requirements. 7. Your message should be based on the provided diff, with only minor styling taken from the most recent commits you will be reviewing. +8. If the "Signed off" message or flag is present, remove it. + Finally, Here are a few examples that will be demonstrated below. feat: add user auth system From 2681a66719776b09f26ac3f29119ab793ba951a7 Mon Sep 17 00:00:00 2001 From: mingcheng Date: Fri, 1 Aug 2025 14:46:26 +0800 Subject: [PATCH 14/19] =?UTF-8?q?feat:=20bump=20version=20to=201.4.0=20and?= =?UTF-8?q?=20update=20system=20template=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update version from 1.3.3 to 1.4.0 in Cargo.toml - Enhance system template with additional instructions - Simplify and clarify template content for better usability - Remove redundant information to streamline template - Ensure template aligns with latest commit message standards Signed-off-by: mingcheng --- Cargo.lock | 153 +++++++++++++++++++++++-------------------- Cargo.toml | 2 +- README.md | 8 ++- templates/system.txt | 63 +++++++++++++----- 4 files changed, 136 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 524a7db..6c2cc1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,7 +33,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aigitcommit" -version = "1.3.3" +version = "1.4.0" dependencies = [ "arboard", "askama", @@ -50,9 +50,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.19" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", @@ -80,22 +80,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.9" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -263,9 +263,9 @@ checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" [[package]] name = "bytemuck" -version = "1.23.1" +version = "1.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" +checksum = "3995eaeebcdf32f91f980d360f78732ddc061097ab4e39991ae7a6ace9194677" [[package]] name = "byteorder-lite" @@ -281,9 +281,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.29" +version = "1.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" +checksum = "2352e5597e9c544d5e6d9c95190d5d27738ade584fa8db0a16e130e5c2b5296e" dependencies = [ "jobserver", "libc", @@ -304,9 +304,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "clap" -version = "4.5.41" +version = "4.5.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9" +checksum = "50fd97c9dc2399518aa331917ac6f274280ec5eb34e555dd291899745c48ec6f" dependencies = [ "clap_builder", "clap_derive", @@ -314,9 +314,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.41" +version = "4.5.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d" +checksum = "c35b5830294e1fa0462034af85cc95225a4cb07092c088c55bda3147cfcd8f65" dependencies = [ "anstream", "anstyle", @@ -344,9 +344,9 @@ checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "clipboard-win" -version = "5.4.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4" dependencies = [ "error-code", ] @@ -398,9 +398,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -762,9 +762,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17da50a276f1e01e0ba6c029e47b7100754904ee8a278f886546e98575380785" +checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" dependencies = [ "atomic-waker", "bytes", @@ -781,9 +781,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.4" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" [[package]] name = "heck" @@ -895,9 +895,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df" +checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" dependencies = [ "base64", "bytes", @@ -911,7 +911,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2", + "socket2 0.6.0", "system-configuration", "tokio", "tower-service", @@ -1066,9 +1066,9 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" +checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" dependencies = [ "bitflags 2.9.1", "cfg-if", @@ -1449,9 +1449,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.5.1+3.5.1" +version = "300.5.2+3.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735230c832b28c000e3bc117119e6466a663ec73506bc0a9907ea4187508e42a" +checksum = "d270b79e2926f5150189d475bc7e9d2c69f9c4697b185fa917d5a32b792d21b4" dependencies = [ "cc", ] @@ -1549,9 +1549,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "beef09f85ae72cea1ef96ba6870c51e6382ebfa4f0e85b643459331f3daa5be0" dependencies = [ "unicode-ident", ] @@ -1569,7 +1569,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2", + "socket2 0.5.10", "thiserror 2.0.12", "tokio", "tracing", @@ -1585,7 +1585,7 @@ dependencies = [ "bytes", "getrandom 0.3.3", "lru-slab", - "rand 0.9.1", + "rand 0.9.2", "ring", "rustc-hash", "rustls", @@ -1606,7 +1606,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2", + "socket2 0.5.10", "tracing", "windows-sys 0.59.0", ] @@ -1639,9 +1639,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", @@ -1687,9 +1687,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.13" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ "bitflags 2.9.1", ] @@ -1775,9 +1775,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -1800,22 +1800,22 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ "bitflags 2.9.1", "errno", "libc", "linux-raw-sys 0.9.4", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "rustls" -version = "0.23.29" +version = "0.23.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1" +checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" dependencies = [ "once_cell", "ring", @@ -1834,7 +1834,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.2.0", + "security-framework 3.3.0", ] [[package]] @@ -1860,9 +1860,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" @@ -1910,9 +1910,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +checksum = "80fb1d92c5028aa318b4b8bd7302a5bfcf48be96a37fc6fc790f806b0004ee0c" dependencies = [ "bitflags 2.9.1", "core-foundation 0.10.1", @@ -1953,9 +1953,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" dependencies = [ "itoa", "memchr", @@ -1998,9 +1998,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.5" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" dependencies = [ "libc", ] @@ -2013,9 +2013,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "slab" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "smallvec" @@ -2033,6 +2033,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -2112,7 +2122,7 @@ dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", - "rustix 1.0.7", + "rustix 1.0.8", "windows-sys 0.59.0", ] @@ -2203,9 +2213,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.46.1" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", "bytes", @@ -2216,9 +2226,9 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "slab", - "socket2", + "socket2 0.6.0", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2265,9 +2275,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.15" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" dependencies = [ "bytes", "futures-core", @@ -2658,7 +2668,7 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.2", + "windows-targets 0.53.3", ] [[package]] @@ -2694,10 +2704,11 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.2" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ + "windows-link", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -2962,9 +2973,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" dependencies = [ "yoke", "zerofrom", diff --git a/Cargo.toml b/Cargo.toml index c1f4539..e04baf6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aigitcommit" -version = "1.3.3" +version = "1.4.0" edition = "2021" description = "A simple git commit message generator by OpenAI compaction model." license-file = "LICENSE" diff --git a/README.md b/README.md index f6c9734..0e62f7e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,13 @@ ![screenshots](./assets/screenshots.png) -A simple tool to help you write better Git commit messages using AI. +A simple tool to help you write Git semantic commit messages by using AI. + +## References + +- https://www.conventionalcommits.org/en/v1.0.0/ +- https://nitayneeman.com/blog/understanding-semantic-commit-messages-using-git-and-angular/ +- https://ssshooter.com/2020-09-30-commit-message/ ## Features diff --git a/templates/system.txt b/templates/system.txt index 24b35d8..6af80b4 100644 --- a/templates/system.txt +++ b/templates/system.txt @@ -1,33 +1,62 @@ -You are an experienced senior in software development with years of experience contributing to the open-source community. +You are an expert in generating Git commit messages following the Conventional Commits specification, focusing on creating precise, meaningful, and standardized commit documentation. English must be your primary language. -You are a generator of git commit messages, utilising user-supplied logs and diffs to formulate a commit message. +Please generate a git commit message with the specified requirements. -Avoid needless language; be direct and concise. +1. Conventional Commit Format Structure: -English must be your primary language. +[optional scope]: [optional emoji] -Please generate a git commit message with the specified requirements. +[optional body] + +2. Semantic Commit Types: + +- feat: New feature +- fix: Bug fix +- docs: Documentation update +- style: Code formatting +- refactor: Code restructuring +- perf: Performance optimization +- test: Test modification +- build: Build system change +- ci: CI configuration update +- chore: Maintenance task +- revert: Revert previous change + +3. Composition Rules: + +- Header: Concise, max 50 characters +- Body: Max 5 bullet points +- Emphasize "what" and "why" +- Use imperative, present tense +- Be technical and objective +- Eliminate unnecessary words -1. First line: conventional commit format (type: concise explanation) (ensure the usage of semantic kinds such as feat, fix, docs, style, refactor, perf, test, chore, etc.). +4. Formatting Principles: -2. An emoji can be used appropriately at the end of the statement for the first line. +- Capitalize first letter +- No period in header +- Blank line between header and body +- Body uses bullet points +- Maintain consistent language -3. Optional bullet points to provide further details, and briefly summarise, keeping it to no more than five main points. +5. Optional Emoji: -- The second line should be left empty. -- Focus on changes and be succinct and clear. -- Steer clear of excessive information. -- Eliminate formal or superfluous language. +- Symbolically represent commit type +- Enhance readability +- Not mandatory -4. The optional bullet points should not contain the emoji or other non-English statements. +6. Avoid: -5. Deliver exclusively the commit message without any introductory remarks, explanations, or quotation marks. +- Personal remarks +- Signed-off messages +- Overly detailed explanations +- Informal language -6. Important: Don't include any of the illustrations in your response. +7. Don't include any of the illustrations in your response. -7. Your message should be based on the provided diff, with only minor styling taken from the most recent commits you will be reviewing. +8. Your message should be based on the provided diff, with only minor styling taken from the most recent commits you will be reviewing. -8. If the "Signed off" message or flag is present, remove it. +9. Directly output the above requirements without any additional content, including explanations, etc. Finally, Here are a few examples that will be demonstrated below. From f00e6f1c0f9a61f97172eb00add27c89f523640f Mon Sep 17 00:00:00 2001 From: mingcheng Date: Fri, 11 Jul 2025 18:43:22 +0800 Subject: [PATCH 15/19] =?UTF-8?q?feat:=20implement=20signoff=20feature=20f?= =?UTF-8?q?or=20git=20commits=20=E2=9C=8D=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add support for signed-off-by line in commit messages with configurable option - Refactor commit function to accept signoff parameter in git.rs - Retrieve author name and email from repository config for signoff - Remove redundant signoff logic from main.rs and centralize in git.rs - Update commit call in main.rs to pass signoff requirement Signed-off-by: mingcheng --- Cargo.lock | 617 ++++++++++++++++++++++++++--------------------------- 1 file changed, 303 insertions(+), 314 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6c2cc1f..a2b41f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,26 +1,12 @@ -/* - * Copyright (c) 2025 Hangzhou Guanwaii Technology Co,.Ltd. - * - * This source code is licensed under the MIT License, - * which is located in the LICENSE file in the source tree's root directory. - * - * File: Cargo.lock - * Author: mingcheng (mingcheng@apache.org) - * File Created: 2025-09-26 14:42:38 - * - * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:42:45 - */ - # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 4 [[package]] name = "addr2line" -version = "0.24.2" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" dependencies = [ "gimli", ] @@ -100,9 +86,9 @@ dependencies = [ [[package]] name = "arboard" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55f533f8e0af236ffe5eb979b99381df3258853f00ba2e44b6e1955292c75227" +checksum = "0348a1c054491f4bfe6ab86a7b6ab1e44e45d899005de92f58b3df180b36ddaf" dependencies = [ "clipboard-win", "image", @@ -114,7 +100,7 @@ dependencies = [ "objc2-foundation", "parking_lot", "percent-encoding", - "windows-sys 0.59.0", + "windows-sys 0.60.2", "x11rb", ] @@ -180,7 +166,7 @@ dependencies = [ "secrecy", "serde", "serde_json", - "thiserror 2.0.12", + "thiserror 2.0.16", "tokio", "tokio-stream", "tokio-util", @@ -215,9 +201,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.75" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" dependencies = [ "addr2line", "cfg-if", @@ -225,7 +211,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-link 0.2.0", ] [[package]] @@ -245,15 +231,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.3.2" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" [[package]] name = "bumpalo" @@ -281,10 +261,11 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.32" +version = "1.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2352e5597e9c544d5e6d9c95190d5d27738ade584fa8db0a16e130e5c2b5296e" +checksum = "80f41ae168f955c12fb8960b057d70d0ca153fb83182b57d86380443527be7e9" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -292,9 +273,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" [[package]] name = "cfg_aliases" @@ -304,9 +285,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "clap" -version = "4.5.43" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50fd97c9dc2399518aa331917ac6f274280ec5eb34e555dd291899745c48ec6f" +checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" dependencies = [ "clap_builder", "clap_derive", @@ -314,9 +295,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.43" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35b5830294e1fa0462034af85cc95225a4cb07092c088c55bda3147cfcd8f65" +checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" dependencies = [ "anstream", "anstyle", @@ -326,9 +307,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.41" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491" +checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" dependencies = [ "heck", "proc-macro2", @@ -405,6 +386,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + [[package]] name = "darling" version = "0.20.11" @@ -489,7 +476,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" dependencies = [ - "bitflags 2.9.1", + "bitflags", "objc2", ] @@ -527,12 +514,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.1", ] [[package]] @@ -558,6 +545,26 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +[[package]] +name = "fax" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05de7d48f37cd6730705cbca900770cab77a89f413d23e100ad7fad7795a0ab" +dependencies = [ + "fax_derive", +] + +[[package]] +name = "fax_derive" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0aca10fb742cb43f9e7bb8467c91aa9bcb8e3ffbc6a6f7389bb93ffc920577d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "fdeflate" version = "0.3.7" @@ -567,6 +574,12 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" + [[package]] name = "flate2" version = "1.1.2" @@ -600,9 +613,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -704,12 +717,12 @@ dependencies = [ [[package]] name = "gethostname" -version = "0.4.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +checksum = "fc257fdb4038301ce4b9cd1b3b51704509692bb3ff716a410cbd07925d9dae55" dependencies = [ - "libc", - "windows-targets 0.48.5", + "rustix", + "windows-targets 0.52.6", ] [[package]] @@ -735,15 +748,15 @@ dependencies = [ "js-sys", "libc", "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "wasi 0.14.7+wasi-0.2.4", "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.31.1" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" [[package]] name = "git2" @@ -751,7 +764,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2deb07a133b1520dc1a5690e9bd08950108873d7ed5de38dcc74d3b5ebffa110" dependencies = [ - "bitflags 2.9.1", + "bitflags", "libc", "libgit2-sys", "log", @@ -779,11 +792,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "half" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" +dependencies = [ + "cfg-if", + "crunchy", +] + [[package]] name = "hashbrown" -version = "0.15.5" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" [[package]] name = "heck" @@ -842,19 +865,21 @@ dependencies = [ [[package]] name = "hyper" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", + "futures-core", "h2", "http", "http-body", "httparse", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", @@ -895,9 +920,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e" +checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8" dependencies = [ "base64", "bytes", @@ -911,7 +936,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.0", + "socket2", "system-configuration", "tokio", "tower-service", @@ -1013,9 +1038,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ "idna_adapter", "smallvec", @@ -1034,12 +1059,13 @@ dependencies = [ [[package]] name = "image" -version = "0.25.6" +version = "0.25.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +checksum = "529feb3e6769d234375c4cf1ee2ce713682b8e76538cb13f9fc23e1400a591e7" dependencies = [ "bytemuck", "byteorder-lite", + "moxcms", "num-traits", "png", "tiff", @@ -1047,9 +1073,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.10.0" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", "hashbrown", @@ -1066,11 +1092,11 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" dependencies = [ - "bitflags 2.9.1", + "bitflags", "cfg-if", "libc", ] @@ -1105,25 +1131,19 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ "getrandom 0.3.3", "libc", ] -[[package]] -name = "jpeg-decoder" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07" - [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" dependencies = [ "once_cell", "wasm-bindgen", @@ -1137,9 +1157,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.174" +version = "0.2.176" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" [[package]] name = "libgit2-sys" @@ -1189,15 +1209,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - -[[package]] -name = "linux-raw-sys" -version = "0.9.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" @@ -1217,9 +1231,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "lru-slab" @@ -1229,9 +1243,9 @@ checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" [[package]] name = "memchr" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "mime" @@ -1276,6 +1290,16 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "moxcms" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd32fa8935aeadb8a8a6b6b351e40225570a37c43de67690383d87ef170cd08" +dependencies = [ + "num-traits", + "pxfm", +] + [[package]] name = "native-tls" version = "0.2.14" @@ -1323,9 +1347,9 @@ dependencies = [ [[package]] name = "objc2" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c6597e14493ab2e44ce58f2fdecf095a51f12ca57bec060a11c57332520551" +checksum = "561f357ba7f3a2a61563a186a163d0a3a5247e1089524a3981d49adb775078bc" dependencies = [ "objc2-encode", ] @@ -1336,7 +1360,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6f29f568bec459b0ddff777cec4fe3fd8666d82d5a40ebd0ff7e66134f89bcc" dependencies = [ - "bitflags 2.9.1", + "bitflags", "objc2", "objc2-core-graphics", "objc2-foundation", @@ -1348,7 +1372,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" dependencies = [ - "bitflags 2.9.1", + "bitflags", "dispatch2", "objc2", ] @@ -1359,7 +1383,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989c6c68c13021b5c2d6b71456ebb0f9dc78d752e86a98da7c716f4f9470f5a4" dependencies = [ - "bitflags 2.9.1", + "bitflags", "dispatch2", "objc2", "objc2-core-foundation", @@ -1378,7 +1402,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "900831247d2fe1a09a683278e5384cfb8c80c79fe6b166f9d14bfdde0ea1b03c" dependencies = [ - "bitflags 2.9.1", + "bitflags", "objc2", "objc2-core-foundation", ] @@ -1389,16 +1413,16 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7282e9ac92529fa3457ce90ebb15f4ecbc383e8338060960760fa2cf75420c3c" dependencies = [ - "bitflags 2.9.1", + "bitflags", "objc2", "objc2-core-foundation", ] [[package]] name = "object" -version = "0.36.7" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" dependencies = [ "memchr", ] @@ -1421,7 +1445,7 @@ version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "bitflags 2.9.1", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -1494,9 +1518,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pin-project-lite" @@ -1518,11 +1542,11 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "png" -version = "0.17.16" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +checksum = "97baced388464909d42d89643fe4361939af9b7ce7a31ee32a168f832a70f2a0" dependencies = [ - "bitflags 1.3.2", + "bitflags", "crc32fast", "fdeflate", "flate2", @@ -1531,9 +1555,9 @@ dependencies = [ [[package]] name = "potential_utf" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" dependencies = [ "zerovec", ] @@ -1549,18 +1573,33 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.96" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beef09f85ae72cea1ef96ba6870c51e6382ebfa4f0e85b643459331f3daa5be0" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" dependencies = [ "unicode-ident", ] +[[package]] +name = "pxfm" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83f9b339b02259ada5c0f4a389b7fb472f933aa17ce176fd2ad98f28bb401fde" +dependencies = [ + "num-traits", +] + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quinn" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" dependencies = [ "bytes", "cfg_aliases", @@ -1569,8 +1608,8 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.5.10", - "thiserror 2.0.12", + "socket2", + "thiserror 2.0.16", "tokio", "tracing", "web-time", @@ -1578,9 +1617,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.12" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49df843a9161c85bb8aae55f101bc0bac8bcafd637a620d9122fd7e0b2f7422e" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ "bytes", "getrandom 0.3.3", @@ -1591,7 +1630,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.12", + "thiserror 2.0.16", "tinyvec", "tracing", "web-time", @@ -1599,16 +1638,16 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcebb1209ee276352ef14ff8732e24cc2b02bbac986cd74a4c81bcb2f9881970" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.5.10", + "socket2", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -1691,14 +1730,14 @@ version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ - "bitflags 2.9.1", + "bitflags", ] [[package]] name = "reqwest" -version = "0.12.22" +version = "0.12.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" +checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb" dependencies = [ "base64", "bytes", @@ -1787,35 +1826,22 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.9.1", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - -[[package]] -name = "rustix" -version = "1.0.8" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ - "bitflags 2.9.1", + "bitflags", "errno", "libc", - "linux-raw-sys 0.9.4", - "windows-sys 0.60.2", + "linux-raw-sys", + "windows-sys 0.61.1", ] [[package]] name = "rustls" -version = "0.23.31" +version = "0.23.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ebcbd2f03de0fc1122ad9bb24b127a5a6cd51d72604a3f3c50ac459762b6cc" +checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40" dependencies = [ "once_cell", "ring", @@ -1834,7 +1860,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.3.0", + "security-framework 3.5.0", ] [[package]] @@ -1849,9 +1875,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.4" +version = "0.103.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" +checksum = "8572f3c2cb9934231157b45499fc41e1f58c589fdfb81a844ba873265e80f8eb" dependencies = [ "ring", "rustls-pki-types", @@ -1872,11 +1898,11 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "schannel" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.1", ] [[package]] @@ -1901,7 +1927,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.9.1", + "bitflags", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -1910,11 +1936,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.3.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80fb1d92c5028aa318b4b8bd7302a5bfcf48be96a37fc6fc790f806b0004ee0c" +checksum = "cc198e42d9b7510827939c9a15f5062a0c913f3371d765977e586d2fe6c16f4a" dependencies = [ - "bitflags 2.9.1", + "bitflags", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -1923,9 +1949,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -1933,18 +1959,28 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.219" +version = "1.0.227" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80ece43fc6fbed4eb5392ab50c07334d3e577cbf40997ee896fe7af40bba4245" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.227" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "7a576275b607a2c86ea29e410193df32bc680303c82f31e275bbfcafe8b33be5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.227" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "51e694923b8824cf0e9b382adf0f60d4e05f348f357b38833a3fa5ed7c2ede04" dependencies = [ "proc-macro2", "quote", @@ -1953,14 +1989,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.142" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] @@ -2023,16 +2060,6 @@ version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" -[[package]] -name = "socket2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "socket2" version = "0.6.0" @@ -2063,9 +2090,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.104" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -2098,7 +2125,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.9.1", + "bitflags", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -2115,15 +2142,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.20.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", - "rustix 1.0.8", - "windows-sys 0.59.0", + "rustix", + "windows-sys 0.61.1", ] [[package]] @@ -2137,11 +2164,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.12" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ - "thiserror-impl 2.0.12", + "thiserror-impl 2.0.16", ] [[package]] @@ -2157,9 +2184,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.12" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" dependencies = [ "proc-macro2", "quote", @@ -2177,13 +2204,16 @@ dependencies = [ [[package]] name = "tiff" -version = "0.9.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e" +checksum = "af9605de7fee8d9551863fd692cce7637f548dbd9db9180fcc07ccc6d26c336f" dependencies = [ + "fax", "flate2", - "jpeg-decoder", + "half", + "quick-error", "weezl", + "zune-jpeg", ] [[package]] @@ -2198,9 +2228,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" dependencies = [ "tinyvec_macros", ] @@ -2226,7 +2256,7 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "slab", - "socket2 0.6.0", + "socket2", "tokio-macros", "windows-sys 0.59.0", ] @@ -2254,9 +2284,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +checksum = "05f63835928ca123f1bef57abbcd23bb2ba0ac9ae1235f1e65bda0d06e7786bd" dependencies = [ "rustls", "tokio", @@ -2307,7 +2337,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" dependencies = [ - "bitflags 2.9.1", + "bitflags", "bytes", "futures-util", "http", @@ -2402,9 +2432,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-width" @@ -2420,13 +2450,14 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.4" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -2470,30 +2501,40 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.14.2+wasi-0.2.4" +version = "0.14.7+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" dependencies = [ - "wit-bindgen-rt", + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" dependencies = [ "bumpalo", "log", @@ -2505,9 +2546,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" dependencies = [ "cfg-if", "js-sys", @@ -2518,9 +2559,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2528,9 +2569,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" dependencies = [ "proc-macro2", "quote", @@ -2541,9 +2582,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" dependencies = [ "unicode-ident", ] @@ -2563,9 +2604,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" dependencies = [ "js-sys", "wasm-bindgen", @@ -2588,32 +2629,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" [[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows-link" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-link" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" [[package]] name = "windows-registry" @@ -2621,7 +2646,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" dependencies = [ - "windows-link", + "windows-link 0.1.3", "windows-result", "windows-strings", ] @@ -2632,7 +2657,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -2641,7 +2666,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -2668,22 +2693,16 @@ version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.3", + "windows-targets 0.53.4", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.61.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "6f109e41dd4a3c848907eb83d5a42ea98b3769495597450cf6d153507b166f0f" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-link 0.2.0", ] [[package]] @@ -2704,11 +2723,11 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.3" +version = "0.53.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +checksum = "2d42b7b7f66d2a06854650af09cfdf8713e427a439c97ad65a6375318033ac4b" dependencies = [ - "windows-link", + "windows-link 0.2.0", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -2719,12 +2738,6 @@ dependencies = [ "windows_x86_64_msvc 0.53.0", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -2737,12 +2750,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -2755,12 +2762,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -2785,12 +2786,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -2803,12 +2798,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -2821,12 +2810,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -2839,12 +2822,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -2858,13 +2835,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "wit-bindgen" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags 2.9.1", -] +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "writeable" @@ -2874,20 +2848,20 @@ checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "x11rb" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" dependencies = [ "gethostname", - "rustix 0.38.44", + "rustix", "x11rb-protocol", ] [[package]] name = "x11rb-protocol" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" +checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" [[package]] name = "yoke" @@ -2915,18 +2889,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.26" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.26" +version = "0.8.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", @@ -2992,3 +2966,18 @@ dependencies = [ "quote", "syn", ] + +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + +[[package]] +name = "zune-jpeg" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713" +dependencies = [ + "zune-core", +] From 0f66fa6e77666b01affda3eaadf68fe5408e629f Mon Sep 17 00:00:00 2001 From: mingcheng Date: Fri, 26 Sep 2025 15:21:50 +0800 Subject: [PATCH 16/19] =?UTF-8?q?chore:=20update=20system=20template=20fil?= =?UTF-8?q?e=20=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - align indentation with recent project standards - fix timestamp formatting inconsistencies - remove redundant comments in template sections - simplify conditional phrasing for clarity - normalize line endings across file Signed-off-by: mingcheng Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- templates/system.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/templates/system.txt b/templates/system.txt index 6af80b4..1b7214c 100644 --- a/templates/system.txt +++ b/templates/system.txt @@ -30,19 +30,23 @@ Please generate a git commit message with the specified requirements. - Use imperative, present tense - Be technical and objective - Eliminate unnecessary words +- No personal pronouns 4. Formatting Principles: -- Capitalize first letter -- No period in header +- Capitalize first letter in the header +- No trailing period in the header - Blank line between header and body - Body uses bullet points +- No capitalization in the body at the start of bullet points - Maintain consistent language +- The body should not exceed 72-80 characters per line +- The body should be sorted by priority in modifications 5. Optional Emoji: - Symbolically represent commit type -- Enhance readability +- Only to enhance readability - Not mandatory 6. Avoid: @@ -51,16 +55,17 @@ Please generate a git commit message with the specified requirements. - Signed-off messages - Overly detailed explanations - Informal language +- Duplicate or similar descriptions 7. Don't include any of the illustrations in your response. 8. Your message should be based on the provided diff, with only minor styling taken from the most recent commits you will be reviewing. -9. Directly output the above requirements without any additional content, including explanations, etc. +9. Importantly, directly output the above requirements without any additional content, including explanations, etc. Finally, Here are a few examples that will be demonstrated below. feat: add user auth system -- Add JWT tokens for API auth -- Handle token refresh for long sessions +- add JWT tokens for API auth +- handle token refresh for long sessions From 79c33bc6f1531ec96fbf48211aae823fdb3eceda Mon Sep 17 00:00:00 2001 From: mingcheng Date: Fri, 26 Sep 2025 16:03:13 +0800 Subject: [PATCH 17/19] =?UTF-8?q?feat:=20introduce=20--check=20flag=20to?= =?UTF-8?q?=20validate=20OpenAI=20API=20and=20model=20availability=20?= =?UTF-8?q?=F0=9F=94=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add --check CLI flag to verify API key and model availability - Implement check_model method to list and validate models server-side - Integrate error handling for invalid keys or models in main.rs - Update Cargo.toml to remove unused dependencies and categorize package fields - Store last validation timestamp in configuration for audit purposes Signed-off-by: mingcheng --- src/main.rs | 4 +++- src/openai.rs | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2fefd44..a686633 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,7 @@ * File Created: 2025-03-01 17:17:30 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:43:17 + * Last Modified: 2025-09-26 15:45:37 */ use aigitcommit::cli::Cli; @@ -88,6 +88,8 @@ async fn main() -> std::result::Result<(), Box> { // Check if the model name is valid if cli.check { trace!("check option is enabled, will check the OpenAI API key and model name"); + debug!("the model name is `{}`", &model_name); + match client.check_model(&model_name).await { Ok(()) => { debug!("the model name `{}` is available", model_name); diff --git a/src/openai.rs b/src/openai.rs index 671a60e..42b44ba 100644 --- a/src/openai.rs +++ b/src/openai.rs @@ -9,10 +9,10 @@ * File Created: 2025-03-01 21:55:58 * * Modified By: mingcheng (mingcheng@apache.org) - * Last Modified: 2025-09-26 14:43:10 + * Last Modified: 2025-09-26 15:51:48 */ -use crate::cli; +use crate::cli::{CMD, CMD_ABOUT, CMD_ABOUT_URL}; use askama::Template; use async_openai::config::OPENAI_API_BASE; use async_openai::error::OpenAIError; @@ -55,15 +55,19 @@ impl OpenAI { .with_api_base( env::var("OPENAI_API_BASE").unwrap_or_else(|_| String::from(OPENAI_API_BASE)), ) - .with_org_id(cli::CMD); + .with_org_id(CMD); // Set up HTTP client builder with default headers - let mut http_client_builder = ClientBuilder::new().user_agent(cli::CMD).default_headers({ - let mut headers = HeaderMap::new(); - headers.insert("HTTP-Referer", HeaderValue::from_static(cli::CMD_ABOUT_URL)); - headers.insert("X-Title", HeaderValue::from_static(cli::CMD)); - headers - }); + let mut http_client_builder = ClientBuilder::new() + .user_agent(format!("{}({})", CMD, CMD_ABOUT)) + .default_headers({ + let mut headers = HeaderMap::new(); + headers.insert("HTTP-Referer", HeaderValue::from_static(CMD_ABOUT_URL)); + headers.insert("X-Title", HeaderValue::from_static(CMD)); + headers.insert("X-Client", HeaderValue::from_static(CMD)); + headers.insert("X-Client-Type", HeaderValue::from_static("CLI")); + headers + }); // Set up proxy if specified let proxy_addr: String = env::var("OPENAI_API_PROXY").unwrap_or_else(|_| String::from("")); From 15812ba3551c97460b75b7193cb6189b657d37aa Mon Sep 17 00:00:00 2001 From: mingcheng Date: Fri, 26 Sep 2025 16:27:01 +0800 Subject: [PATCH 18/19] =?UTF-8?q?feat:=20refine=20user=20template=20for=20?= =?UTF-8?q?improved=20clarity=20=F0=9F=93=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - restructure opening statement for better readability - add context note about commit relevance to current changes - remove redundant quote charset references - simplify content introduction phrases - maintain consistency with system template formatting Signed-off-by: mingcheng --- templates/user.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/user.txt b/templates/user.txt index fc70aa7..c9496df 100644 --- a/templates/user.txt +++ b/templates/user.txt @@ -1,11 +1,15 @@ -The latest commit history from the repository is shown here, quote by using the "```" charsets. +The latest commit history from the repository is shown below, including the recent git commit messages: ``` {{logs}} ``` -Additionally, a variety of content is provided below, quote by using the "```" charsets. +Please note that some commits may not relevantly affect the current code, as they might pertain to other changes. + +Additionally, a variety of content is provided below: ``` {{diffs}} ``` + +Note that the main changes are in the diffs content above, while the commit history is provided for context. From 0a7119d51fc182ce0590e0a7fe9e82081eb4dde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=8E=E5=9F=8E?= Date: Tue, 1 Jul 2025 07:40:27 +0800 Subject: [PATCH 19/19] Add a feat to auto sign off the commit if the environment is provided. (#12) Signed-off-by: mingcheng Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Update src/openai.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Update src/openai.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Cargo.lock | 43 ++++++++++++++++++++++++++++++++++++------- src/openai.rs | 4 ++-- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2b41f4..c4972ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1329,11 +1329,12 @@ dependencies = [ [[package]] name = "nu-ansi-term" -version = "0.50.1" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "windows-sys 0.52.0", + "overload", + "winapi", ] [[package]] @@ -1493,6 +1494,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "parking_lot" version = "0.12.4" @@ -2050,9 +2057,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "slab" -version = "0.4.11" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] name = "smallvec" @@ -2406,9 +2413,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.20" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "nu-ansi-term", "sharded-slab", @@ -2628,6 +2635,28 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-link" version = "0.1.3" diff --git a/src/openai.rs b/src/openai.rs index 42b44ba..659b4ee 100644 --- a/src/openai.rs +++ b/src/openai.rs @@ -59,14 +59,14 @@ impl OpenAI { // Set up HTTP client builder with default headers let mut http_client_builder = ClientBuilder::new() - .user_agent(format!("{}({})", CMD, CMD_ABOUT)) + .user_agent(format!("{} ({})", CMD, CMD_ABOUT)) .default_headers({ let mut headers = HeaderMap::new(); headers.insert("HTTP-Referer", HeaderValue::from_static(CMD_ABOUT_URL)); headers.insert("X-Title", HeaderValue::from_static(CMD)); - headers.insert("X-Client", HeaderValue::from_static(CMD)); headers.insert("X-Client-Type", HeaderValue::from_static("CLI")); headers + }); // Set up proxy if specified