Compare commits
10 commits
d989d1c844
...
0cd0a4343a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cd0a4343a | ||
|
|
37bc9b3dad | ||
|
|
e15b805427 | ||
|
|
5c7c2b38af | ||
|
|
71bf2bfc5b | ||
|
|
ad225b4e25 | ||
|
|
747b1bee17 | ||
|
|
c464efa4cd | ||
|
|
32b0d4299e | ||
|
|
a637e549ce |
10 changed files with 57 additions and 32 deletions
2
.idea/.name
generated
2
.idea/.name
generated
|
|
@ -1 +1 @@
|
||||||
hello-world-plugin
|
commit-message-prefixer
|
||||||
16
.idea/csv-editor.xml
generated
16
.idea/csv-editor.xml
generated
|
|
@ -1,16 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CsvFileAttributes">
|
|
||||||
<option name="attributeMap">
|
|
||||||
<map>
|
|
||||||
<entry key="/foo">
|
|
||||||
<value>
|
|
||||||
<Attribute>
|
|
||||||
<option name="separator" value="," />
|
|
||||||
</Attribute>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
15
.idea/git_toolbox_prj.xml
generated
Normal file
15
.idea/git_toolbox_prj.xml
generated
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GitToolBoxProjectSettings">
|
||||||
|
<option name="commitMessageIssueKeyValidationOverride">
|
||||||
|
<BoolValueOverride>
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
</BoolValueOverride>
|
||||||
|
</option>
|
||||||
|
<option name="commitMessageValidationEnabledOverride">
|
||||||
|
<BoolValueOverride>
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
</BoolValueOverride>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
|
|
||||||
15
README.md
Normal file
15
README.md
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
A plugin for JetBrains IDEs that automatically prefixes commit messages with information extracted from branch names.
|
||||||
|
|
||||||
|
You can find the plugin here: https://plugins.jetbrains.com/plugin/26938-commit-message-prefixer
|
||||||
|
|
||||||
|
Features:
|
||||||
|
- Extract information from branch names using configurable regex patterns
|
||||||
|
- Format commit messages using configurable format patterns
|
||||||
|
- Enable/disable the plugin from the commit dialog
|
||||||
|
|
||||||
|
The branch name extraction pattern is configurable from the IDE settings
|
||||||
|
|
||||||
|
Example:
|
||||||
|
- Branch name: `feature/12345-add-new-feature`
|
||||||
|
- Commit message: `Initial implementation`
|
||||||
|
- Result: `#12345 - Initial implementation`
|
||||||
23
build.gradle
23
build.gradle
|
|
@ -4,7 +4,7 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
group = 'org.cobalyte'
|
group = 'org.cobalyte'
|
||||||
version = '1.0.0'
|
version = '1.2.1'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
@ -12,7 +12,7 @@ repositories {
|
||||||
|
|
||||||
// Configure Gradle IntelliJ Plugin
|
// Configure Gradle IntelliJ Plugin
|
||||||
intellij {
|
intellij {
|
||||||
version = '2023.1.5'
|
version = '2024.3.5'
|
||||||
type = 'IC' // Target IDE Platform - IC for IntelliJ IDEA Community Edition
|
type = 'IC' // Target IDE Platform - IC for IntelliJ IDEA Community Edition
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ dependencies {
|
||||||
// Configure plugin metadata
|
// Configure plugin metadata
|
||||||
patchPluginXml {
|
patchPluginXml {
|
||||||
sinceBuild = '231'
|
sinceBuild = '231'
|
||||||
untilBuild = '241.*'
|
untilBuild = ''
|
||||||
pluginDescription = '''
|
pluginDescription = '''
|
||||||
A plugin for JetBrains IDEs that automatically prefixes commit messages with information extracted from branch names.
|
A plugin for JetBrains IDEs that automatically prefixes commit messages with information extracted from branch names.
|
||||||
|
|
||||||
|
|
@ -43,7 +43,22 @@ patchPluginXml {
|
||||||
<li>Result: "#12345 - Initial implementation"</li>
|
<li>Result: "#12345 - Initial implementation"</li>
|
||||||
</ul>
|
</ul>
|
||||||
'''
|
'''
|
||||||
changeNotes = 'Initial release of the Commit Message Prefixer plugin'
|
changeNotes = '''
|
||||||
|
<h3>Version 1.2.1</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Added support for 2025.1</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>Version 1.2.0</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Extended compatibility to support 2024.3.x IDEs including Rider 2024.3.6</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>Version 1.1.0</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Initial release of the Commit Message Prefixer plugin</li>
|
||||||
|
</ul>
|
||||||
|
'''
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,6 @@ public class CommitPrefixerCheckinHandlerFactory extends CheckinHandlerFactory {
|
||||||
return checkBox;
|
return checkBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void refresh() {
|
|
||||||
checkBox.setSelected(settings.isEnabled());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveState() {
|
public void saveState() {
|
||||||
settings.setEnabled(checkBox.isSelected());
|
settings.setEnabled(checkBox.isSelected());
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ public class CommitPrefixerConfigurable implements Configurable {
|
||||||
formatHelp.setForeground(JBColor.GRAY);
|
formatHelp.setForeground(JBColor.GRAY);
|
||||||
|
|
||||||
JBLabel prefixingHelp = new JBLabel("<html>Select how the prefix should be added to commit messages:<br>" +
|
JBLabel prefixingHelp = new JBLabel("<html>Select how the prefix should be added to commit messages:<br>" +
|
||||||
"<b>Pre-fill in commit dialog</b>: You need to click the 'Add Prefix' button in the commit dialog.<br>" +
|
"<b>Manual</b>: You manually click the 'Add Prefix' button in the commit tool window.<br>" +
|
||||||
"<b>Before commit</b>: The prefix will be added automatically before commit.</html>");
|
"<b>Automatic</b>: The prefix is added automatically after you click Commit.</html>");
|
||||||
prefixingHelp.setForeground(JBColor.GRAY);
|
prefixingHelp.setForeground(JBColor.GRAY);
|
||||||
|
|
||||||
// Build the form
|
// Build the form
|
||||||
|
|
@ -99,7 +99,7 @@ public class CommitPrefixerConfigurable implements Configurable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void apply() throws ConfigurationException {
|
public void apply() {
|
||||||
CommitPrefixerSettings settings = CommitPrefixerSettings.getInstance(project);
|
CommitPrefixerSettings settings = CommitPrefixerSettings.getInstance(project);
|
||||||
settings.setBranchExtractionPattern(branchExtractionPatternField.getText());
|
settings.setBranchExtractionPattern(branchExtractionPatternField.getText());
|
||||||
settings.setCommitMessageFormat(commitMessageFormatField.getText());
|
settings.setCommitMessageFormat(commitMessageFormatField.getText());
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ public class CommitPrefixerSettings implements PersistentStateComponent<CommitPr
|
||||||
|
|
||||||
// Enum for prefixing modes
|
// Enum for prefixing modes
|
||||||
public enum PrefixingMode {
|
public enum PrefixingMode {
|
||||||
MANUAL("Pre-fill in commit dialog"),
|
MANUAL("Manual"),
|
||||||
AUTOMATIC("Before commit");
|
AUTOMATIC("Automatic");
|
||||||
|
|
||||||
private final String displayName;
|
private final String displayName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
<!-- Add the commit prefix action to the VCS menu -->
|
<!-- Add the commit prefix action to the VCS menu -->
|
||||||
<action id="org.cobalyte.AddCommitPrefixAction"
|
<action id="org.cobalyte.AddCommitPrefixAction"
|
||||||
class="org.cobalyte.AddCommitPrefixAction"
|
class="org.cobalyte.AddCommitPrefixAction"
|
||||||
text="Add Prefix"
|
text="Add Prefix to Commit Message"
|
||||||
description="Add a prefix to the commit message based on the current branch name">
|
description="Add a prefix to the commit message based on the current branch name">
|
||||||
<add-to-group group-id="Vcs.MessageActionGroup" anchor="first"/>
|
<add-to-group group-id="Vcs.MessageActionGroup" anchor="first"/>
|
||||||
</action>
|
</action>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue