pulibrary / pul-it-handbook

Princeton Univ. Library Apps best practices and recommendations
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

[gitmessage] Add commit message specifics #283

Closed sandbergja closed 4 months ago

sandbergja commented 4 months ago

The git project recommends using imperative mood in its own commit messages.

hackartisan commented 4 months ago

Why do you want the issue number in the subject line, rather than the description? It doesn't create a link when it's part of the subject in github.

sandbergja commented 4 months ago

@hackartisan it looks like it can if it has the # symbol, for example https://github.com/pulibrary/allsearch_frontend/commit/98401d14e58522abd82463ef3bfaf8362b941188 has a link to issue 274.

hackartisan commented 4 months ago

Hm, okay, but it doesn't when it auto-populates a PR title, like https://github.com/pulibrary/allsearch_frontend/pull/282

Is this y'all's team's standard? For me having the numbers in the title distracts from the title as a place to concisely convey meaning, and the more characters we require in the title the less space we have to convey meaning. I don't think I've seen this convention much, and I wouldn't be excited to see it documented as our general practice.

christinach commented 4 months ago

apache/solr references the 'jira number ticket' link in the commit messageand we found it very helpful when going through the codebase and working on a specific issue.

sandbergja commented 4 months ago

@hackartisan I've definitely seen a lot of pulibrary commit messages with the issue number in them (sometimes with an i as a prefix, like i1234). And it's nice that with the #, it actually gets a link. It's not a standard on our team, though.

For this PR, we just wanted to add some more details about how to write commit messages, especially for folks who are new to writing commit messages.

Would it help if we made the issue number part more clearly optional?