Browse Source

cheatsheets & git: commit template material

Also includes a basic README for the cheatsheets directory.
master
Brennen Bearnes 2 years ago
parent
commit
c1546292e3
4 changed files with 50 additions and 0 deletions
  1. +1
    -0
      home/.gitconfig
  2. +17
    -0
      home/cheatsheets/README
  3. +16
    -0
      home/cheatsheets/git-commit.txt
  4. +16
    -0
      home/cheatsheets/git-meta.txt

+ 1
- 0
home/.gitconfig View File

@ -52,4 +52,5 @@
remote = origin
username = brennen
[commit]
template = ~/cheatsheets/git-commit.txt
template = /home/brennen/.git-commit-zomg

+ 17
- 0
home/cheatsheets/README View File

@ -0,0 +1,17 @@
This is a place to collect some useful cheatsheets, with the view that I may
eventually streamline accessing them in some way.
git-commit.txt is a terse and evolving version of some of the things found in
Vicky Lai's .gitmessage[0] and Tyler Cipriani's larger .git-commit-zomg[0].
It's pointed at by my ~/.gitconfig's commit.template value. I found the longer
version of these templates useful, but after a while realized that I was
routinely scrolling to the bottom of the commit to see the list of staged
files, and really only need a few of the prompts as general reminders most of
the time.
git-meta.txt includes a bunch of optional fields for commit messages, and is
pointed at by git-commit.txt so I can quickly access it with ctrl-w f in vim
while writing a commit.
[0]. https://victoria.dev/verbose/git-commit-practices-your-future-self-will-thank-you-for/
[1]. https://tylercipriani.com/blog/2019/03/11/of-git-commits-github-and-gerrit/

+ 16
- 0
home/cheatsheets/git-commit.txt View File

@ -0,0 +1,16 @@
# Subject: summary of your change
# * "If applied, this commit will..."
# * Imperative mood: Change/Add/Fix/Remove/Update/Refactor/Document
# * Optionally, prefix with subject / component (general area modified)
# * https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines#Subject
# Body:
# * Why? What's wrong with status quo? Are there other ways?
# * How to test/confirm?
# * https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines#Body
# Bug: TXXXXXX
#
# Other fields:
# ~/code/bpb-kit/home/cheatsheets/git-meta.txt

+ 16
- 0
home/cheatsheets/git-meta.txt View File

@ -0,0 +1,16 @@
# Gerrit specific:
# Change-Id: IXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Depends-On: IXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#
# Sign off:
# Signed-off-by: Example User <user@example.com>
#
# Acked-by: Example User <user@example.com>
# Cc: Example User <user@example.com>
# Co-Authored-by: Example User <user@example.com>
# Requested-by: Example User <user@example.com>
# Reported-by: Example User <user@example.com>
# Reviewed-by: Example User <user@example.com>
# Suggested-by: Example User <user@example.com>
# Tested-by: Example User <user@example.com>
# Thanks: Example User <user@example.com>

Loading…
Cancel
Save