All Projects → PurpleBooth → git-mit

PurpleBooth / git-mit

Licence: CC0-1.0 license
Minimalist set of hooks to aid pairing and link commits to issues

Programming Languages

rust
11053 projects
Dockerfile
14818 projects
shell
77523 projects
Jinja
831 projects

Projects that are alternatives of or similar to git-mit

node-actionlint
Run actionlint from Node.js
Stars: ✭ 18 (-59.09%)
Mutual labels:  lint
ticket-check-action
Verify that pull request titles start with a ticket ID
Stars: ✭ 29 (-34.09%)
Mutual labels:  jira
ghaction-cmake
cmake swiss army knife github docker action
Stars: ✭ 19 (-56.82%)
Mutual labels:  lint
postee
Simple message routing system that receives input messages through a webhook interface and can enforce actions using predefined outputs via integrations.
Stars: ✭ 160 (+263.64%)
Mutual labels:  jira
jira-sprint-reporting
Reporting in a Google Sheet on a Sprint level using JIRA REST API
Stars: ✭ 25 (-43.18%)
Mutual labels:  jira
jira.sh
JIRA Client for Bash Scripts
Stars: ✭ 15 (-65.91%)
Mutual labels:  jira
vscode-confluence-markup
Visual Studio Code extension for Confluence® markup
Stars: ✭ 21 (-52.27%)
Mutual labels:  jira
CVE-2019-8449
CVE-2019-8449 Exploit for Jira v2.1 - v8.3.4
Stars: ✭ 66 (+50%)
Mutual labels:  jira
therapist
Work out your commitment issues.
Stars: ✭ 29 (-34.09%)
Mutual labels:  lint
lint-to-the-future
A modern way to progressively update your code to the best practices
Stars: ✭ 28 (-36.36%)
Mutual labels:  lint
lint-html-with-css
Lint HTML with CSS. A collection of CSS snippets from the hashtag #lintHTMLwithCSS on twitter. These CSS snippets intend to warn developers about common mistakes made in HTML.
Stars: ✭ 35 (-20.45%)
Mutual labels:  lint
npm-groovy-lint
Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line
Stars: ✭ 124 (+181.82%)
Mutual labels:  lint
vira
Create and update your Jira issues while inside Vim!
Stars: ✭ 76 (+72.73%)
Mutual labels:  jira
ticketutil
Python ticketing utility for working with tickets in popular tools
Stars: ✭ 58 (+31.82%)
Mutual labels:  jira
eslint-plugin-roku
ESLint plugin to parse and lint BrightScript files
Stars: ✭ 44 (+0%)
Mutual labels:  lint
Confluence-and-Jira
Docker部署并破解Jira、Confluence及相关插件;若图片加载不出来可以访问我的博客原文查看
Stars: ✭ 60 (+36.36%)
Mutual labels:  jira
jiraworklogtool
A simple Chrome Extension that allows adding worklog in Jira easily.
Stars: ✭ 38 (-13.64%)
Mutual labels:  jira
mllint
`mllint` is a command-line utility to evaluate the technical quality of Python Machine Learning (ML) projects by means of static analysis of the project's repository.
Stars: ✭ 67 (+52.27%)
Mutual labels:  lint
tempo-api-python-client
Python bindings for Tempo - https://apidocs.tempo.io/
Stars: ✭ 17 (-61.36%)
Mutual labels:  jira
Jiraffe
One stop place for exploiting Jira instances in your proximity
Stars: ✭ 157 (+256.82%)
Mutual labels:  jira

git-mit

git-mit is a suite of git hooks. It's aimed to make pair programming, adding issue numbers to your commits, and following good commit message practices something that happens without thinking about it.

Usage

Preparing the repository

This works via git hooks, so you need these hooks to be present in the git repository you're using to use them.

git init .
git mit-install

This works by creating a symlink in your repositories hooks directory. You can do this automatically by adding them to your init template. This is the template that git uses to create the .git directory when you run git init.

git mit-install --scope=global

You can also run this on an existing repository, to set up an already checked out repository. You can re-initialise all of your repositories, recursively from the home directory using this command.

find "$HOME" -type d -name .git -exec sh -c 'git init "$1"/..' -- {} \;

Lint list

git mit-config lint available
╭───────────────────────────────────┬──────────╮
│ Lint                              ┆ Status   │
╞═══════════════════════════════════╪══════════╡
│ duplicated-trailers               ┆ enabled  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ pivotal-tracker-id-missing        ┆ disabled │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ jira-issue-key-missing            ┆ disabled │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ github-id-missing                 ┆ disabled │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ subject-not-separated-from-body   ┆ enabled  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ subject-longer-than-72-characters ┆ enabled  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ subject-line-not-capitalized      ┆ disabled │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ subject-line-ends-with-period     ┆ disabled │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ body-wider-than-72-characters     ┆ enabled  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ not-conventional-commit           ┆ disabled │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
│ not-emoji-log                     ┆ disabled │
╰───────────────────────────────────┴──────────╯

With only lints that ensure git will work properly enabled by default

git mit-config lint enabled
╭───────────────────────────────────┬─────────╮
│ Lint                              ┆ Status  │
╞═══════════════════════════════════╪═════════╡
│ duplicated-trailers               ┆ enabled │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ subject-not-separated-from-body   ┆ enabled │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ subject-longer-than-72-characters ┆ enabled │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
│ body-wider-than-72-characters     ┆ enabled │
╰───────────────────────────────────┴─────────╯

You can read more details about this, with examples on the lints page

Centralising lint config

You can add a .git-mit.toml or .git-mit.toml.dist to the root of your repository, and we will read it and try to enable the correct lints (with .git-mit.toml taking precedence).

I recommend you commit .git-mit.toml.dist and add .git-mit.toml to your .gitignore to allow easy local reconfiguration

For example

[mit.lint]
"pivotal-tracker-id-missing" = true

With this you can enable lints

git mit-config lint status pivotal-tracker-id-missing
╭────────────────────────────┬─────────╮
│ Lint                       ┆ Status  │
╞════════════════════════════╪═════════╡
│ pivotal-tracker-id-missing ┆ enabled │
╰────────────────────────────┴─────────╯

You can read more about this on the configuring page

Append issue number

In projects, it is nice to help out your co-workers by linking the commits you're making back to the issue in the backlog. This can get a bit tedious to remember though, so here's a command to reduce the amount of typing.

Say you've just made this awesome README.md for Pivotal Tracker ID [#12321513]

# The Best Readme

This is the best readme

If you run

git mit-relates-to "[#12321513]"

Next time you commit

git add README.md
git mit bt
git commit -m "Wrote a great README"

the commit message will contain the ID

git show --pretty='format:author: [%an %ae] signed-by: [%GS] 
---
%B' -q
author: [Billie Thompson [email protected]] signed-by: [] 
---
Wrote a great README

Relates-to: [#12321513]

Read more about this at the relates to page

Setting Authors and Co-Authors

Pairing is a great way to program, and it's even better when you give credit, you can give credit with the mit command

Configure your authors like the example by creating a config at $HOME/.config/git-mit/mit.toml

git-mit-config mit example
[ae]
name = "Anyone Else"
email = "[email protected]"

[bt]
name = "Billie Thompson"
email = "[email protected]"
signingkey = "0A46826A"

[se]
name = "Someone Else"
email = "[email protected]"

And you can run

git mit ae bt se

Then next when you make a commit the Co-authored-by trailers will be set of the author initials you selected.

echo "# Hello, world!" > README.md

git add .
git commit --message="Initial Commit" --quiet
git show --pretty='format:author: [%an %ae] signed-by: [%GS] 
---
%B' -q
author: [Anyone Else [email protected]] signed-by: [] 
---
Initial Commit

Co-authored-by: Billie Thompson <[email protected]>
Co-authored-by: Someone Else <[email protected]>
Relates-to: [#12321513]

Notice how the "Relates-to" tag is here even though we didn't trigger it? It's from the example higher on the page, git-mit remembers your author and ticket number for 60 min

For more information on this see the mit page

Installing

You can install this with brew! This is the preferred method of installing.

brew install PurpleBooth/repo/git-mit

You can use Cargo too, though this won't install the completions

cargo install git-mit-config
cargo install git-mit
cargo install git-mit-install
cargo install mit-commit-msg
cargo install mit-pre-commit
cargo install mit-prepare-commit-msg

You can also download the latest release and run it.

Completions

We generate completions for fish,zsh, and bash. They're installed with the homebrew package. You don't need to do anything to activate them.

You can also manually download them from the releases page.

Docs

Common Tasks

Usage

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].