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

Add support for commit templates #8698

Open
StefKors opened this issue Nov 25, 2019 · 32 comments
Open

Add support for commit templates #8698

StefKors opened this issue Nov 25, 2019 · 32 comments
Labels
enhancement not-planned Not in the team's roadmap

Comments

@StefKors
Copy link

Describe the feature you’d like to solve

I would like to add support for git templates. In some Open Source projects and organisations formatting of commit messages are important.

Proposed solution

Because this is a feature for more experienced users I suggests that github desktop honors the template in the .gitconfig. It should just prefill the body input field in the github desktop commit editor.

reference:

https://github.com/torvalds/subsurface-for-dirk/blob/a48494d2fbed58c751e9b7e8fbff88582f9b2d02/README#L88

@tierninho
Copy link
Contributor

@StefKors Thank you for sharing your proposal. I'd imagine this would be used like the "saved replies" feature in this commenting toolbar, which I find it rather useful.

It sounds like a lightweight version is honoring the .gitconfig and a more complex version is to build a feature to add/edit/delete multiple templates in the UI.

Leaving this open for now so others can weigh in.

@StefKors
Copy link
Author

I think indeed honoring the .gitconfig would be the easy way of solving this. I'm not familiar with the saved replies feature but in my view I think it should be possible to edit / add to the template before commiting.

@StefKors
Copy link
Author

StefKors commented Jan 6, 2020

@tierninho If nobody picks this up I would love to take a stab at it. Any pointers or similar features that already have been implemented into the desktop app? What would be the way in which the codebase interacts with the git .dotfiles

@tierninho
Copy link
Contributor

@StefKors We haven't attached a help-wanted label yet, so hold tight as I want to make sure everyone is on the same page here. Thanks for your interest in getting this out!

cc @billygriffin for thoughts.

@steveward
Copy link
Member

This was requested in #9057 by @HEBOS:

To comply with the company policy, we need to use a template for our code commits.
That is easy achievable using command-line git.
Firstly we need to create a file in our user folder, and populate it with our template".
Given the file name is .gitmessage, we configure it in git using:

git config --global commit.template ~/.gitmessage

To use it we just run:
git add .
git commit

Next Vim editor will pop-up, and after we close it, we will get what is expected. This proves that >command-line git works correctly.
However, we cannot do the same using Git Desktop.

@DanFullerBV
Copy link

@tierninho I certainly think to start with, the lightweight version would be a good idea. Simply just pre-populating the commit window with editable, formatted headers would be enough to provide guidance to the user of the expected format.

Maybe down the line, if there's a call for it, a more robust solution could be found to force the user to populate the necessary sections of the commit

I appreciate the same thing can be achieved by simply copy and pasting the template to the commit window and completing the relevant sections, but this fairly simple change would remove the risk of the user forgetting and leads to more consistent commits making everyone's life easier

@DanFullerBV
Copy link

Just wondered if there had been any further thoughts on this @tierninho @billygriffin ?

@Asvsmadhav
Copy link

Asvsmadhav commented Sep 10, 2021 via email

@corkupine
Copy link

👍 - our team has a template with a few Conventional Commits prefixes and descriptions. We've got team members who prefer Github Desktop over Git Extensions and other git tools with template support, but they miss this feature.

@ydubov
Copy link

ydubov commented Nov 9, 2021

Also missing this feature in desktop, any news about it?

@EATONJIANGHAHAHA
Copy link

Adding this feature will be really helpful. Looking forward to it.

@zxcv551133
Copy link

Are there any docs to use this feature?

@jcreek
Copy link

jcreek commented Apr 21, 2022

I'm astounded that this hasn't been implemented yet, especially given @StefKors offered to pick it up In Jan 2020 and was told to hold tight.

It's a simple feature request to just honour the .gitconfig - can we please get the help-wanted label added and let the community implement this if no one else is going to? @tierninho @billygriffin

@benjaminaaron
Copy link

+1

3 similar comments
@GxSupport
Copy link

+1

@HEBOS
Copy link

HEBOS commented May 26, 2022

+1

@sporchia
Copy link

+1

@ITJamie
Copy link

ITJamie commented May 30, 2022

really hoping this happens.
even just extending the default commit message to include the full file path and not just filename would make a big difference

@bipiane
Copy link

bipiane commented Oct 14, 2022

+1

@phineasla
Copy link

Still waiting for this 👀

@steveward
Copy link
Member

Requested in #16184.

@mrlacey
Copy link

mrlacey commented Mar 16, 2023

As someone who contributes to lots of different projects which have different conventions/rules/expectations/requirements around commit message formats and structure, having this would be really useful and could save loads of time in having to go back and change past commit messages (that are only validated when part of a PR)

@Adrien-LUDWIG
Copy link

Adrien-LUDWIG commented Mar 22, 2023

I'm also interested in this feature.
It would be nice to have some news on the matter.

@neeteshbhati
Copy link

Is there any update on this?

@steveward
Copy link
Member

This isn't on our roadmap at this time (we're a small team and have to prioritize accordingly), but thanks for letting us know you'd like to see this implemented.

@ElAktigre
Copy link

Our team also uses Conventional Commits (we currently use Commit Lint as a stand-in, until a feature like the proposed one exists natively in GitHub Desktop).

@johnowens99
Copy link

This would be an awesome feature! Hoping it can be added to the roadmap at some point.

@rmscode
Copy link

rmscode commented Oct 3, 2023

P L E A S E

@0xdevalias
Copy link

0xdevalias commented Dec 17, 2023

This isn't on our roadmap at this time (we're a small team and have to prioritize accordingly), but thanks for letting us know you'd like to see this implemented.

@steveward Understandable, but given that the community offered to implement it as far back as 2020 (Ref), and was told to 'hold tight' (Ref) can the help-wanted label be added to this issue so that the community can solve it (as was re-requested back in April 2022 (Ref))


See also:

@sinisarudan
Copy link

+1. Since our team has implemented the great policy of using Conventional Commits I can't use GitHub Desktop which I really liked.

And, Yes @0xdevalias, great suggestion!

@steveward Understandable, but given that the community offered to implement it as far back as 2020 ([Ref] ....

@rmscode
Copy link

rmscode commented Mar 13, 2024

+1. Since our team has implemented the great policy of using Conventional Commits I can't use GitHub Desktop which I really liked.

And, Yes @0xdevalias, great suggestion!

@steveward Understandable, but given that the community offered to implement it as far back as 2020 ([Ref] ....

Um...What about Github Desktop prevents you from using the Conventional Commits format? I use conventional commits myself.

@sinisarudan
Copy link

Sorry, to be more correct, it does not PREVENT, but it doesn't provide a set of templates and interactive wizard-like interface like
https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits. So the additional effort/time to do this kind of commits in GitDesktop makes us not using it.

@sergiou87 sergiou87 added the not-planned Not in the team's roadmap label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement not-planned Not in the team's roadmap
Projects
None yet
Development

No branches or pull requests