#git-commit #commit-message #line #signed-off-by

app dco

A simple tool for adding a DCO Signed-off-by: line to a git commit message

2 releases

0.1.3 Oct 15, 2023
0.1.2 Oct 15, 2023
0.1.1 Oct 15, 2023
0.1.0 Oct 15, 2023

#26 in #commit-message

MIT license

6KB
97 lines

dco

A simple tool for adding a DCO Signed-off-by: line to a git commit message

It takes a commit message on stdin, and spits it out with the DCO line in the right place:

$ cat demo
commit title

message body

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch main
# Changes to be committed:
#       modified:   README.md
$ dco < demo
commit title

message body

Signed-off-by: User Person <user@localhost>
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch main
# Changes to be committed:
#       modified:   README.md

Installation

cargo install dco

Configuration

I initially made this for the Helix editor, but there's nothing specific to it. I'd be happy to include configuration blurbs for any editors submitted.

Helix

In languages.toml:

[[language]]
name = "Git"
language-id = "Git"
scope = "source.git"
formatter = { command = "dco" }
file-types = ["COMMIT_EDITMSG"]
roots = [".git"]

Usage

While editing a git commit message, type :format

No runtime deps