Skip to content

Commit 42b9a4e

Browse files
committed
Merge branch 'main' into develop
2 parents 4d587e2 + 39fa8ed commit 42b9a4e

File tree

4 files changed

+2
-92
lines changed

4 files changed

+2
-92
lines changed

Cargo.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
1919

2020
[[package]]
2121
name = "aigitcommit"
22-
<<<<<<< HEAD
23-
version = "1.1.0"
24-
=======
2522
version = "1.2.0"
26-
>>>>>>> release/1.2.0
2723
dependencies = [
2824
"arboard",
2925
"askama",

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
[package]
22
name = "aigitcommit"
3-
<<<<<<< HEAD
4-
version = "1.1.0"
5-
=======
63
version = "1.2.0"
7-
>>>>>>> release/1.2.0
84
edition = "2021"
95
description = "A simple git commit message generator by OpenAI compaction model."
106
license = "MIT"

src/cli.rs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@
99
* File Created: 2025-03-03 19:31:27
1010
*
1111
* Modified By: mingcheng ([email protected])
12-
<<<<<<< HEAD
13-
* Last Modified: 2025-03-04 13:13:16
14-
=======
15-
<<<<<<< HEAD
16-
* Last Modified: 2025-03-04 11:38:55
17-
=======
18-
* Last Modified: 2025-03-04 13:13:16
19-
>>>>>>> release/1.2.0
20-
>>>>>>> main
12+
* Last Modified: 2025-03-04 16:31:19
2113
*/
2214

2315
use clap::Parser;
@@ -56,11 +48,6 @@ If not specified, the current directory will be used"#,
5648

5749
#[arg(
5850
long,
59-
<<<<<<< HEAD
60-
=======
61-
<<<<<<< HEAD
62-
=======
63-
>>>>>>> main
6451
short,
6552
help = "Accept the commit message without prompting",
6653
default_value_t = false,
@@ -70,20 +57,11 @@ If not specified, the current directory will be used"#,
7057

7158
#[arg(
7259
long,
73-
<<<<<<< HEAD
74-
=======
75-
>>>>>>> release/1.2.0
76-
>>>>>>> main
7760
help = "Copy the commit message to clipboard",
7861
default_value_t = false,
7962
required = false
8063
)]
8164
pub copy: bool,
82-
<<<<<<< HEAD
83-
=======
84-
<<<<<<< HEAD
85-
=======
86-
>>>>>>> main
8765

8866
#[arg(
8967
long,
@@ -93,8 +71,4 @@ If not specified, the current directory will be used"#,
9371
required = false
9472
)]
9573
pub save: String,
96-
<<<<<<< HEAD
97-
=======
98-
>>>>>>> release/1.2.0
99-
>>>>>>> main
10074
}

src/main.rs

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@
99
* File Created: 2025-03-01 17:17:30
1010
*
1111
* Modified By: mingcheng ([email protected])
12-
<<<<<<< HEAD
13-
* Last Modified: 2025-03-04 14:46:51
14-
=======
15-
<<<<<<< HEAD
16-
* Last Modified: 2025-03-04 11:39:25
17-
=======
18-
* Last Modified: 2025-03-04 14:46:51
19-
>>>>>>> release/1.2.0
20-
>>>>>>> main
12+
* Last Modified: 2025-03-04 16:30:20
2113
*/
2214

2315
use aigitcommit::cli::Cli;
@@ -119,7 +111,6 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
119111
trace!("write to stdout, and finish the process");
120112
writeln!(std::io::stdout(), "{}", result)?;
121113

122-
<<<<<<< HEAD
123114
// Copy the commit message to clipboard if the --copy option is enabled
124115
if cli.copy {
125116
let mut clipboard = Clipboard::new()?;
@@ -133,42 +124,13 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
133124
// directly commit the changes to the repository if the --commit option is enabled
134125
if cli.commit {
135126
trace!("Commit option is enabled, will commit the changes to the repository");
136-
=======
137-
<<<<<<< HEAD
138-
// directly commit the changes to the repository if the --commit option is enabled
139-
if cli.commit {
140-
trace!("Commit option is enabled, will commit the changes to the repository");
141-
if Confirm::new()
142-
.with_prompt("\nDo you want to commit the changes with the generated commit message?")
143-
.default(false)
144-
.interact()?
145-
{
146-
=======
147-
// Copy the commit message to clipboard if the --copy option is enabled
148-
if cli.copy {
149-
let mut clipboard = Clipboard::new()?;
150-
clipboard.set_text(&result)?;
151-
writeln!(
152-
std::io::stdout(),
153-
"The commit message has been copied to clipboard."
154-
)?;
155-
}
156-
157-
// directly commit the changes to the repository if the --commit option is enabled
158-
if cli.commit {
159-
trace!("Commit option is enabled, will commit the changes to the repository");
160-
>>>>>>> main
161127
let mut confirm = Confirm::new();
162128
confirm
163129
.with_prompt("Do you want to commit the changes with the generated commit message?")
164130
.default(false);
165131

166132
// Prompt the user for confirmation if --yes option is not enabled
167133
if cli.yes || confirm.interact()? {
168-
<<<<<<< HEAD
169-
=======
170-
>>>>>>> release/1.2.0
171-
>>>>>>> main
172134
match repository.commit(&result) {
173135
Ok(_) => {
174136
writeln!(std::io::stdout(), "Commit successful!")?;
@@ -178,21 +140,7 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
178140
}
179141
}
180142
}
181-
<<<<<<< HEAD
182-
}
183-
=======
184-
<<<<<<< HEAD
185-
} else if cli.copy {
186-
let mut clipboard = Clipboard::new()?;
187-
clipboard.set_text(&result)?;
188-
write!(
189-
std::io::stdout(),
190-
"\n The commit message has been copied to clipboard."
191-
)?;
192-
}
193-
=======
194143
}
195-
>>>>>>> main
196144

197145
// If the --save option is enabled, save the commit message to a file
198146
if !cli.save.is_empty() {
@@ -207,9 +155,5 @@ async fn main() -> std::result::Result<(), Box<dyn Error>> {
207155
writeln!(std::io::stdout(), "Commit message saved to {}", &save_path)?;
208156
}
209157

210-
<<<<<<< HEAD
211-
=======
212-
>>>>>>> release/1.2.0
213-
>>>>>>> main
214158
Ok(())
215159
}

0 commit comments

Comments
 (0)