diff --git a/Commands.md b/Commands.md index 26876b4..dfcbd72 100644 --- a/Commands.md +++ b/Commands.md @@ -9,6 +9,7 @@ - [`git chore`](#git-featurerefactorbugchore) - [`git clear`](#git-clear) - [`git clear-soft`](#git-clear-soft) + - [`git coauthor`](#git-coauthor) - [`git commits-since`](#git-commits-since) - [`git contrib`](#git-contrib) - [`git count`](#git-count) @@ -347,6 +348,30 @@ Straight from the shell! git (master)> quit ``` +## git coauthor + +Add a co-author to the last commit + +```bash +$ git coauthor user user@email.com + +[master b62ceae] Add documentation files + Date: Sat Aug 17 17:33:53 2019 -0500 + 2 files changed, 145 insertions(+), 0 deletions(-) + create mode 100644 README.md + create mode 100644 CONTRIBUTING.md + + $ git log -1 + +commit b62ceae2685e6ece071f3c3754e9b77fd0a35c88 (HEAD -> master) +Author: user person +Date: Sat Aug 17 17:33:53 2019 -0500 + + Add documentation files + + Co-authored-by: user +``` + ## git commits-since List commits since `date` (defaults to "last week"): diff --git a/bin/git-coauthor b/bin/git-coauthor new file mode 100755 index 0000000..2d69a37 --- /dev/null +++ b/bin/git-coauthor @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +old_message="$(git log --format=%B -n1)" +git commit --amend -m "$old_message" -m "Co-authored-by: $1 <$2>" diff --git a/etc/git-extras-completion.zsh b/etc/git-extras-completion.zsh index 7131210..0552eca 100644 --- a/etc/git-extras-completion.zsh +++ b/etc/git-extras-completion.zsh @@ -196,6 +196,11 @@ _git-chore() { '(--remote -r)'{--remote,-r}'[setup remote tracking branch]' } +_git-coauthor() { + _arguments \ + ':co-author[co-author to add]' \ + ':co-author-email[email address of co-author to add]' +} _git-contrib() { _arguments \ @@ -441,6 +446,7 @@ zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \ chore:'create chore branch' \ clear-soft:'soft clean up a repository' \ clear:'rigorously clean up a repository' \ + coauthor: 'add a co-author to the last commit' \ commits-since:'show commit logs since some date' \ contrib:'show user contributions' \ count:'show commit count' \ diff --git a/man/git-coauthor.1 b/man/git-coauthor.1 new file mode 100644 index 0000000..9e8acf4 --- /dev/null +++ b/man/git-coauthor.1 @@ -0,0 +1,42 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "GIT\-COAUTHOR" "1" "August 2019" "" "Git Extras" +. +.SH "NAME" +\fBgit\-coauthor\fR \- Add a co\-author to the last commit +. +.SH "SYNOPSIS" +\fBgit\-coauthor\fR +. +.SH "DESCRIPTION" +Add a co\-author to the last commit +. +.SH "OPTIONS" + +. +.P +The username of the co\-author you want to add\. +. +.P + +. +.P +The email address of the author you want to add\. +. +.SH "EXAMPLES" +. +.nf + +$ git coauthor user user@email\.com +. +.fi +. +.SH "AUTHOR" +Written by Jacob Herrington \fIjacobherringtondeveloper@gmail\.com\fR +. +.SH "REPORTING BUGS" +<\fIhttps://github\.com/tj/git\-extras/issues\fR> +. +.SH "SEE ALSO" +<\fIhttps://github\.com/tj/git\-extras\fR> diff --git a/man/git-coauthor.html b/man/git-coauthor.html new file mode 100644 index 0000000..f7a7ac7 --- /dev/null +++ b/man/git-coauthor.html @@ -0,0 +1,121 @@ + + + + + + git-coauthor(1) - Add a co-author to the last commit + + + + +
+ + + +
    +
  1. git-coauthor(1)
  2. +
  3. Git Extras
  4. +
  5. git-coauthor(1)
  6. +
+ +

NAME

+

+ git-coauthor - Add a co-author to the last commit +

+ +

SYNOPSIS

+ +

git-coauthor <co-author> <co-author-email>

+ +

DESCRIPTION

+ +

Add a co-author to the last commit

+ +

OPTIONS

+ +

<co-author>

+ +

The username of the co-author you want to add.

+ +

<co-author-email>

+ +

The email address of the author you want to add.

+ +

EXAMPLES

+ +
$ git coauthor user user@email.com
+
+ +

AUTHOR

+ +

Written by Jacob Herrington jacobherringtondeveloper@gmail.com

+ +

REPORTING BUGS

+ +

<https://github.com/tj/git-extras/issues>

+ +

SEE ALSO

+ +

<https://github.com/tj/git-extras>

+ + +
    +
  1. +
  2. August 2019
  3. +
  4. git-coauthor(1)
  5. +
+ +
+ + diff --git a/man/git-coauthor.md b/man/git-coauthor.md new file mode 100644 index 0000000..15d8181 --- /dev/null +++ b/man/git-coauthor.md @@ -0,0 +1,36 @@ +git-coauthor(1) -- Add a co-author to the last commit +================================ + +## SYNOPSIS + +`git-coauthor` <co-author> <co-author-email> + +## DESCRIPTION + + Add a co-author to the last commit + +## OPTIONS + + <co-author> + + The username of the co-author you want to add. + + <co-author-email> + + The email address of the author you want to add. + +## EXAMPLES + + $ git coauthor user user@email.com + +## AUTHOR + +Written by Jacob Herrington + +## REPORTING BUGS + +<> + +## SEE ALSO + +<> diff --git a/man/git-extras.md b/man/git-extras.md index ab09ec6..788653d 100644 --- a/man/git-extras.md +++ b/man/git-extras.md @@ -31,6 +31,7 @@ git-extras(1) -- Awesome GIT utilities - **git-chore(1)** Create chore branch - **git-clear-soft(1)** Soft clean up a repository - **git-clear(1)** Rigorously clean up a repository + - **git-coauthor(1)** Add a co-author to the last commit - **git-commits-since(1)** Show commit logs since some date - **git-contrib(1)** Show user's contributions - **git-count(1)** Show commit count diff --git a/man/index.txt b/man/index.txt index e90c14c..f4ab5c0 100644 --- a/man/index.txt +++ b/man/index.txt @@ -9,6 +9,7 @@ git-changelog(1) git-changelog git-chore(1) git-chore git-clear-soft(1) git-clear-soft git-clear(1) git-clear +git-coauthor(1) git-coauthor git-commits-since(1) git-commits-since git-contrib(1) git-contrib git-count(1) git-count