Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placeholders in the commit template #2

Open
kristo-godari opened this issue Feb 14, 2017 · 8 comments
Open

Placeholders in the commit template #2

kristo-godari opened this issue Feb 14, 2017 · 8 comments

Comments

@kristo-godari
Copy link

kristo-godari commented Feb 14, 2017

Hi, this plugin is very useful, thank you for sharing it with us.

Although it will be nice if we had the opportunity to define placeholders in the template, that will be automatically filled when you press CTRL+K to commit. One placeholder very useful is the git branch name. Where i work we need to write the branch name for every commit.
Ex: In the template i write " [#branch_name] " and when i commit the plugin will automatically replace #branch_name with the current git branch name.

Thanks

@gorenm
Copy link
Collaborator

gorenm commented Apr 15, 2017

I'll look into it.

@gkohen
Copy link

gkohen commented Jun 6, 2017

Even better (and without getting greedy), be able to apply a regex on the branch name to get the actual string we want. Let me know if you feel like getting help on this.
Toda Matan!

@gorenm
Copy link
Collaborator

gorenm commented Jun 7, 2017

@gkohen It'll be great if you can lend a hand. I have no idea when I'll be able to get it.

@gkohen
Copy link

gkohen commented Jun 7, 2017

@gorenm , I started working on it but I'm stuck on trying to resolve the branch name from the project object.
I've opened a SO object here:
https://stackoverflow.com/questions/44411970/in-a-intellij-plugin-how-to-resolve-the-current-projects-branch-name

Like mentioned, any pointers would be appreciated.

@gorenm
Copy link
Collaborator

gorenm commented Jun 24, 2017

@gkohen I think that the getCurrentBranchName function from com.intellij.dvcs.repo.Repository might work.
Haven't tried it out yet though.

@unglud
Copy link

unglud commented Oct 30, 2017

can you just run command git rev-parse --abbrev-ref HEAD in current directory maybe?

@lazb
Copy link

lazb commented Mar 12, 2018

Any progress on this one? It would be a really useful feature.

@simonschaufi
Copy link

simonschaufi commented May 10, 2021

@gkohen ping. This might also help: https://github.com/JanGatting/GitCommitMessage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants