Skip to content

Commit

Permalink
Support including authors as Co-authored-by
Browse files Browse the repository at this point in the history
Add a config option, git-together.co-authored, which will switch
git-together from using Signed-off-by to Co-authored-by.

This makes it easier to support mobbing, as all authors are included in
the commit message, and this is supported by GitHub (c.f.
https://help.github.com/en/github/committing-changes-to-your-project/creating-a-commit-with-multiple-authors
). This is mutually exlusive with signing off commits - you have to
choose one or the other. This is mostly because it doesn't make sense to
include a single extra committer as the one who signed it off, but it
also means that, in the event that a commit _must_ be signed off, e.g.,
when committing to the Linux Kernel, you don't lose information.

This is a little fragile, as we are parsing multiple git options, and
potentially reading from stdin, as there are at least six different ways
to create a commit message in Git, four of which we care about, and two
of which we should at least acknowledge, even though we don't modify
them in any way.

This also fixes kejadlen#20 by excluding --signoff from the list of args when
using --amend.
  • Loading branch information
ipsi committed Dec 19, 2019
1 parent bc5c88b commit f7349e3
Show file tree
Hide file tree
Showing 4 changed files with 277 additions and 20 deletions.
123 changes: 113 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ edition = "2018"
[dependencies]
error-chain = "0.10"
git2 = "0.7"
tempfile = "3.1.0"
7 changes: 6 additions & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
error_chain! {}
error_chain! {
foreign_links {
Fmt(::std::fmt::Error);
Io(::std::io::Error);
}
}
Loading

0 comments on commit f7349e3

Please sign in to comment.