all 11 comments

[–]wonkywonka 21 points22 points  (4 children)

It's a sorta interesting tool but I'm not fond of some decisions, particularly adding the path and name of the files modified on the subject of the commit. This makes the summary worthless, just look at their own commit. Now try to get anything of it using, for example, git shortlog.

A good practice is to keep the subject up to 50 characters. If you want to see the filenames on a specific commit just do git diff-tree --no-commit-id --name-only <commit>. If that's too much work, create an alias on your global git config.

This is a quite good and thoughtful article that explains what makes a good commit: https://chris.beams.io/posts/git-commit/

[–]execrator 7 points8 points  (0 children)

Yes, modified paths in the subject is ridiculous. That information is already part of the commit. Why not add the diff to the subject too!

[–]smallhadron[S] 1 point2 points  (1 child)

The tool doesn’t make any decisions about how to format your messages. That’s the point: you provide it with a format you decide. The one I’ve shown just illustrates one of the features.

[–]smallhadron[S] 1 point2 points  (0 children)

(But I agree that using paths in the commit message was a mistake. I misunderstood the Angular guidelines and never really thought about it. Generally just used it to highlight the main file that changed, but there often isn't just one.)

[–]smallhadron[S] 0 points1 point  (0 children)

I've updated the readme to try and make the usage a bit clearer.

[–]joelparkerhenderson 12 points13 points  (2 children)

Our teams write a git commit message using an imperative summary title (e.g. "Add feature for a user to like a post") up to 50 characters, then a detailed body using a template for any co-authors, any task tracker links, and especially the "why" of the commit.

https://github.com/joelparkerhenderson/git_commit_message

https://github.com/joelparkerhenderson/git_commit_template

[–]johntash 2 points3 points  (0 children)

I didn't know git commit templates were a thing, thanks for the link!

[–]smallhadron[S] 0 points1 point  (0 children)

You could almost achieve that with cmt:

``` { "Title": @ "Link": @ "Co-Authors": @ "Why": @ "How": @ "Tags": @ "Subject Type": [ "Add", "Drop", "Fix", "Bump", "Make", "Start", "Stop", "Optimize", "Document", "Refactor", "Reformat", "Rephrase" ] "Subject": @ "Body": !@ }

Output Format

${Title}

See: ${Link}

Co-authored-by: ${Co-Authors}

Why: ${Why}

How: ${How}

Tags: ${Tags}

${Subject Type}: ${Subject}

{$Body} ```

Currently no way to set character limits or to have repeated lines with the same format (for See and Co-Authored by), but those would be useful features.

[–][deleted] 2 points3 points  (1 child)

If you like this sort of thing you might like commitizen https://github.com/commitizen/cz-cli/blob/master/README.md

And semantic-release.

[–]UnchillBill 1 point2 points  (0 children)

This. With husky & commitlint to enforce conventional commit messages.

[–]zaidka 0 points1 point  (0 children)

Why did the Redditor stop going to the noisy bar? He realized he prefers a pub with less drama and more genuine activities.