atom / github

:octocat: Git and GitHub integration for Atom
https://github.atom.io
MIT License
1.11k stars 392 forks source link

Feature Request: Support .gitmessage file #1469

Closed JamesChevalier closed 5 years ago

JamesChevalier commented 6 years ago

Description

I love this plugin! I'd love it even more if it supported commit templates. I have a ~/.gitmessage file set up to help guide me towards better commit messages. The 'Commit message' input for this plugin does not pull content in from that file.

Steps to Reproduce

  1. Create a ~/.gitmessage file that contains this git commit template (for example):

Why:

*

This change addresses the need by:

*

Reference Links:

*

2. Add this section to your `~/.gitconfig` file:

[commit] template = ~/.gitmessage

3. Make some changes in a repository
4. Open the Git plugin by opening the Packages menu, opening the GitHub sub menu, and selecting Toggle Git Tab
5. Click into the 'Commit message' text area

**Expected behavior:**

The 'Commit message' text area should be pre-populated with the contents of my `~/.gitmessage` file.

**Actual behavior:**

The 'Commit message' text area is blank.

**Reproduces how often:**

πŸ’― 

### Versions

Mac OS 10.13.4

Output of `atom --version`:

Atom : 1.27.0 Electron: 1.7.11 Chrome : 58.0.3029.110 Node : 7.9.0


Output of `apm --version`:

apm 1.19.0 npm 3.10.10 node 6.9.5 x64 atom 1.27.0 python 2.7.15 git 2.17.0

annthurium commented 6 years ago

hi @JamesChevalier! I've chatted about this with some other maintainers of the atom-github package. This is a great idea. Is there any chance you'd be interested in working on it yourself? We'd be happy to work with you on coming up with an architecture plan, designs, etc.

If not, that's totally fine of course -- we can add it to our roadmap of things we'd like to build in the future.

JamesChevalier commented 6 years ago

Sounds fun!

I'm primarily a Ruby developer and I've never worked on an Atom plugin before, but I'm happy to help out as much as I can and learn along the way. πŸ‘ πŸš€

gauravchl commented 5 years ago

@JamesChevalier @annthurium Hi, this is really a great feature. I use commit.template a lot. And probably the reason still using git+ for committing the changes. Is it work in progress? I would love to work on this.

Is there already any specs for this feature?

Two ideas:

  1. If 'commit.template' is set in gitconfig then:

    • Load the commit message from template into input field when atom opens.
    • Skip loading the commit message if there is an active merging.
    • After committing the changes, reload the commit message from template.
  2. If 'commit.template' is set in gitconfig then:

    • Show a button "load message from template" next to "add co-authors"
    • Don't load any commit message by default to input field, load only when user click on load button.
    • If there is a message in commit input field, show another button "save message to template". Clicking on this button should update the commit.template file.
annthurium commented 5 years ago

@gauravchl sorry I never responded to your question on this issue!

Since https://github.com/atom/github/pull/1713 has been merged, I'm going to go ahead and close this out. Thanks again for your contribution! ✨