←back to thread

577 points Delgan | 2 comments | | HN request time: 0s | source
Show context
oftenwrong ◴[] No.44347165[source]
Another little-known feature is git trailers:

https://alchemists.io/articles/git_trailers

These are key-value structures data that can be included on a commit when it is created. These are used by some systems for attaching metadata. For example, Gerrit uses this for attaching its Change-Id.

replies(10): >>44347282 #>>44347522 #>>44347679 #>>44347997 #>>44348063 #>>44348331 #>>44348367 #>>44348438 #>>44351063 #>>44352844 #
imiric ◴[] No.44348331[source]
Interesting, I wasn't familiar with this feature.

I'm a big fan of conventional commits, and trailers seem like a better way of adding such metadata.

Is adding them manually to the commit message functionally equivalent to using the `--trailer` flag?

replies(2): >>44349005 #>>44350967 #
1. chuckadams ◴[] No.44350967[source]
I like the idea of conventional commits, but the lack of many useful categories is a real `chore:` to where I end up making my own, which tooling of course doesn’t recognize. The codification of something called conventional commits strikes me as kind of counterintuitive anyway.
replies(1): >>44353547 #
2. imiric ◴[] No.44353547[source]
Well, they're just commonly used commit types. I don't follow the "spec" strictly and have my own conventions as well. I don't use any tooling that reads them, and I'd probably write my own if needed.

I mainly find them helpful for sticking to atomic commits. If a change doesn't align with the commit type, or it touches too many parts of the codebase, that means it should be in a separate commit.