mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Add --no-email to git-author
This feature is used to generate AUTHORS in 4.2.0 release.
This commit is contained in:
parent
805d43831f
commit
1b84048bfc
14
Commands.md
14
Commands.md
|
|
@ -726,7 +726,6 @@ Updating AUTHORS file:
|
|||
$ git authors && cat AUTHORS
|
||||
|
||||
TJ Holowaychuk <tj@vision-media.ca>
|
||||
Tj Holowaychuk <tj@vision-media.ca>
|
||||
hemanth.hm <hemanth.hm@gmail.com>
|
||||
Jonhnny Weslley <jw@jonhnnyweslley.net>
|
||||
nickl- <github@jigsoft.co.za>
|
||||
|
|
@ -739,13 +738,24 @@ Listing authors:
|
|||
$ git authors --list
|
||||
|
||||
TJ Holowaychuk <tj@vision-media.ca>
|
||||
Tj Holowaychuk <tj@vision-media.ca>
|
||||
hemanth.hm <hemanth.hm@gmail.com>
|
||||
Jonhnny Weslley <jw@jonhnnyweslley.net>
|
||||
nickl- <github@jigsoft.co.za>
|
||||
Leila Muhtasib <muhtasib@gmail.com>
|
||||
```
|
||||
|
||||
Listing authors without email:
|
||||
|
||||
```bash
|
||||
$ git authors --list --no-email
|
||||
|
||||
TJ Holowaychuk
|
||||
hemanth.hm
|
||||
Jonhnny Weslley
|
||||
nickl-
|
||||
Leila Muhtasib
|
||||
```
|
||||
|
||||
## git back
|
||||
|
||||
Removes the latest commits, and add their changes to your staging area.
|
||||
|
|
|
|||
|
|
@ -1,15 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
LIST=false
|
||||
NO_EMAIL=false
|
||||
FILE=""
|
||||
EDITOR=$(git var GIT_EDITOR)
|
||||
|
||||
if test "$1" = "-l" || test "$1" = "--list"; then
|
||||
LIST=true
|
||||
else
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-l|--list )
|
||||
LIST=true
|
||||
shift
|
||||
;;
|
||||
--no-email )
|
||||
NO_EMAIL=true
|
||||
shift
|
||||
;;
|
||||
* )
|
||||
break
|
||||
esac
|
||||
done
|
||||
|
||||
if ! $LIST; then
|
||||
FILE=$1
|
||||
if test "$FILE" = ""; then
|
||||
FILE=`ls | egrep 'authors|contributors' -i|head -n1`
|
||||
FILE=$(ls | egrep 'authors|contributors' -i|head -n1)
|
||||
if test "$FILE" = ""; then
|
||||
FILE='AUTHORS'
|
||||
fi
|
||||
|
|
@ -21,7 +35,13 @@ fi
|
|||
#
|
||||
|
||||
authors() {
|
||||
git shortlog -sne | awk '{$1=""; sub(" ", ""); print}' | awk -F'<' '!x[$1]++' | awk -F'<' '!x[$2]++'
|
||||
if $NO_EMAIL; then
|
||||
# eamil will be used to uniq authors.
|
||||
git shortlog -sne | awk '{$1=""; sub(" ", ""); print}' | awk -F'<' '!x[$1]++' | awk -F'<' '!x[$2]++' \
|
||||
| awk -F'<' '{print $1}'
|
||||
else
|
||||
git shortlog -sne | awk '{$1=""; sub(" ", ""); print}' | awk -F'<' '!x[$1]++' | awk -F'<' '!x[$2]++'
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
|
|
@ -29,7 +49,7 @@ authors() {
|
|||
#
|
||||
|
||||
if $LIST; then
|
||||
echo "$(authors)"
|
||||
authors
|
||||
else
|
||||
authors >> $FILE
|
||||
test -n "$EDITOR" && $EDITOR $FILE
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ _git_chore(){
|
|||
}
|
||||
|
||||
_git_authors(){
|
||||
__gitcomp "-l --list"
|
||||
__gitcomp "-l --list --no-email"
|
||||
}
|
||||
|
||||
_git_contrib(){
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ __gitex_author_names() {
|
|||
_git-authors() {
|
||||
_arguments -C \
|
||||
'(--list -l)'{--list,-l}'[show authors]' \
|
||||
'--no-email[without email]' \
|
||||
}
|
||||
|
||||
_git-bug() {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "GIT\-AUTHORS" "1" "December 2015" "" ""
|
||||
.TH "GIT\-AUTHORS" "1" "October 2016" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBgit\-authors\fR \- Generate authors report
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
\fBgit\-authors\fR [\-l, \-\-list]
|
||||
\fBgit\-authors\fR [\-l, \-\-list] [\-\-no\-email]
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Populates the file matching \fIauthors|contributors \-i\fR with the authors of commits, according to the number of commits per author\. Opens the file in \fB$EDITOR\fR when set\.
|
||||
|
|
@ -21,6 +21,12 @@ See the "MAPPING AUTHORS" section of \fBgit\-shortlog\fR(1) to coalesce together
|
|||
.P
|
||||
Show authors\.
|
||||
.
|
||||
.P
|
||||
\-\-no\-email
|
||||
.
|
||||
.P
|
||||
Don\'t show authors\' email\.
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.TP
|
||||
|
|
@ -40,7 +46,6 @@ $ git authors \-\-list
|
|||
.nf
|
||||
|
||||
TJ Holowaychuk <tj@vision\-media\.ca>
|
||||
Tj Holowaychuk <tj@vision\-media\.ca>
|
||||
hemanth\.hm <hemanth\.hm@gmail\.com>
|
||||
Jonhnny Weslley <jw@jonhnnyweslley\.net>
|
||||
nickl\- <github@jigsoft\.co\.za>
|
||||
|
|
@ -50,6 +55,27 @@ Leila Muhtasib <muhtasib@gmail\.com>
|
|||
.
|
||||
.IP "" 0
|
||||
|
||||
.
|
||||
.TP
|
||||
Listing authors without email:
|
||||
.
|
||||
.IP
|
||||
$ git authors \-\-list \-\-no\-email
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
TJ Holowaychuk
|
||||
hemanth\.hm
|
||||
Jonhnny Weslley
|
||||
nickl\-
|
||||
Leila Muhtasib
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
|
||||
.
|
||||
.SH "AUTHOR"
|
||||
Written by Titus Wormer <\fItituswormer@gmail\.com\fR>
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
||||
|
||||
<p><code>git-authors</code> [-l, --list]</p>
|
||||
<p><code>git-authors</code> [-l, --list] [--no-email]</p>
|
||||
|
||||
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
||||
|
||||
|
|
@ -91,6 +91,10 @@
|
|||
|
||||
<p> Show authors.</p>
|
||||
|
||||
<p> --no-email</p>
|
||||
|
||||
<p> Don't show authors' email.</p>
|
||||
|
||||
<h2 id="EXAMPLES">EXAMPLES</h2>
|
||||
|
||||
<dl>
|
||||
|
|
@ -102,18 +106,27 @@
|
|||
<p>$ git authors --list</p>
|
||||
|
||||
<pre><code>TJ Holowaychuk <tj@vision-media.ca>
|
||||
Tj Holowaychuk <tj@vision-media.ca>
|
||||
hemanth.hm <hemanth.hm@gmail.com>
|
||||
Jonhnny Weslley <jw@jonhnnyweslley.net>
|
||||
nickl- <github@jigsoft.co.za>
|
||||
Leila Muhtasib <muhtasib@gmail.com>
|
||||
</code></pre></dd>
|
||||
<dt>Listing authors without email:</dt><dd><p></p>
|
||||
|
||||
<p>$ git authors --list --no-email</p>
|
||||
|
||||
<pre><code>TJ Holowaychuk
|
||||
hemanth.hm
|
||||
Jonhnny Weslley
|
||||
nickl-
|
||||
Leila Muhtasib
|
||||
</code></pre></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
<h2 id="AUTHOR">AUTHOR</h2>
|
||||
|
||||
<p>Written by Titus Wormer <<a href="mailto:tituswormer@gmail.com" data-bare-link="true">tituswormer@gmail.com</a>></p>
|
||||
<p>Written by Titus Wormer <<a href="mailto:tituswormer@gmail.com" data-bare-link="true">tituswormer@gmail.com</a>></p>
|
||||
|
||||
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
|
||||
|
||||
|
|
@ -126,7 +139,7 @@ Leila Muhtasib <muhtasib@gmail.com>
|
|||
|
||||
<ol class='man-decor man-foot man foot'>
|
||||
<li class='tl'></li>
|
||||
<li class='tc'>December 2015</li>
|
||||
<li class='tc'>October 2016</li>
|
||||
<li class='tr'>git-authors(1)</li>
|
||||
</ol>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ git-authors(1) -- Generate authors report
|
|||
|
||||
## SYNOPSIS
|
||||
|
||||
`git-authors` [-l, --list]
|
||||
`git-authors` [-l, --list] [--no-email]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
|
|
@ -18,6 +18,10 @@ git-authors(1) -- Generate authors report
|
|||
|
||||
Show authors.
|
||||
|
||||
--no-email
|
||||
|
||||
Don't show authors' email.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* Updating AUTHORS file:
|
||||
|
|
@ -30,13 +34,24 @@ git-authors(1) -- Generate authors report
|
|||
|
||||
```
|
||||
TJ Holowaychuk <tj@vision-media.ca>
|
||||
Tj Holowaychuk <tj@vision-media.ca>
|
||||
hemanth.hm <hemanth.hm@gmail.com>
|
||||
Jonhnny Weslley <jw@jonhnnyweslley.net>
|
||||
nickl- <github@jigsoft.co.za>
|
||||
Leila Muhtasib <muhtasib@gmail.com>
|
||||
```
|
||||
|
||||
* Listing authors without email:
|
||||
|
||||
$ git authors --list --no-email
|
||||
|
||||
```
|
||||
TJ Holowaychuk
|
||||
hemanth.hm
|
||||
Jonhnny Weslley
|
||||
nickl-
|
||||
Leila Muhtasib
|
||||
```
|
||||
|
||||
## AUTHOR
|
||||
|
||||
Written by Titus Wormer <<tituswormer@gmail.com>>
|
||||
|
|
|
|||
Loading…
Reference in a new issue