Prompt or config for auto generated commits #26503
Replies: 14 comments 13 replies
-
|
Yes It would be nice to have some amount of customisation to guide the model to generate messages with a specific format. Like say, "add the <branch_name | name | date> as header and number the commit messages" |
Beta Was this translation helpful? Give feedback.
-
|
Not so good now, because it's hardcoded let mut diff_text = diff.await??;
const ONE_MB: usize = 1_000_000;
if diff_text.len() > ONE_MB {
diff_text = diff_text.chars().take(ONE_MB).collect()
}
let subject = this.update(&mut cx, |this, cx| {
this.commit_editor.read(cx).text(cx).lines().next().map(ToOwned::to_owned).unwrap_or_default()
})?;
let text_empty = subject.trim().is_empty();
let content = if text_empty {
format!("{PROMPT}\nHere are the changes in this commit:\n{diff_text}")
} else {
format!("{PROMPT}\nHere is the user's subject line:\n{subject}\nHere are the changes in this commit:\n{diff_text}\n")
};
const PROMPT: &str = include_str!("commit_message_prompt.txt");
let request = LanguageModelRequest {
messages: vec![LanguageModelRequestMessage {
role: Role::User,
content: vec![content.into()],
cache: false,
}],
tools: Vec::new(),
stop: Vec::new(),
temperature: None,
};commit_message_prompt.txt |
Beta Was this translation helpful? Give feedback.
-
|
Being able to customize the prompt would allow some specific git commit message specification like gitmoji / conventional commits / etc. |
Beta Was this translation helpful? Give feedback.
-
|
This seems simple enough to update :
const PROMPT: &str = GitPanelSettings::get_global(cx)
.git_commit_prompt
.unwrap_or(include_str!("commit_message_prompt.txt");I'm not too sure about the syntax as I'm definitely not a Rust expert, but if that sounds like something you guys would like to see implemented, I'll be more than happy to try to work on a PR 🙂 |
Beta Was this translation helpful? Give feedback.
-
|
I agree! The feature to generate a commit message using AI is superb! I use it quite a lot. In most cases, the message is constructed quite well. One thing that I feel is missing is that there is no way for me to tell the AI the format and structure of the commit message. Just like how I can interact with the Assistant Panel and define custom prompts, there should be a way to add a prompt for how the commit needs to be generated and what to consider. |
Beta Was this translation helpful? Give feedback.
-
|
it would be nice if we can attach a rule in |
Beta Was this translation helpful? Give feedback.
-
|
Is it possible to keep commit message from previuos commit? In case I have a bunch of commits, so i don't have to retype same message every time. |
Beta Was this translation helpful? Give feedback.
-
|
It would also be nice to make it aware to the previous commit messages so that it can generate a consistent commit message. |
Beta Was this translation helpful? Give feedback.
-
|
Can we choose the model thats being used? if not that would also be a nice option |
Beta Was this translation helpful? Give feedback.
-
|
Conventional commits should be the default of its output. It would be nice if the user could customise the rules then. |
Beta Was this translation helpful? Give feedback.
-
|
Support for "Commit Rules Library" would be REALLY nice. Different projects requires different commit patterns. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
You can now customize the prompt used for commit messages in the Rules Library in version 0.219 (preview). This will be in stable next week! |
Beta Was this translation helpful? Give feedback.
-
|
Where has the generate commit message with ai button been moved to? I cannot seem to find it anyware |
Beta Was this translation helpful? Give feedback.






Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to configure or give instructions on how i need the generated messages to be? I have a project with an automated changelog based on commits with conventional format, it would be nice to tell zed to use that format on auto generated commits
Beta Was this translation helpful? Give feedback.
All reactions