mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Add the current branch git summary (#1034)
Co-authored-by: guenthgr <guenther.grill@frauscher.com>
This commit is contained in:
parent
b372bab52a
commit
d5eaa1895b
|
|
@ -153,6 +153,7 @@ $ git summary
|
|||
|
||||
project : git-extras
|
||||
repo age : 10 months ago
|
||||
branch : master
|
||||
last active : 3 weeks ago
|
||||
active on : 93 days
|
||||
commits : 163
|
||||
|
|
@ -226,11 +227,11 @@ This is how the `tebular` output style and `oneline` output style look like
|
|||
|
||||
```bash
|
||||
$ git summary --output-style tabular
|
||||
# Repo | Age | Last active | Active on | Commits | Uncommitted
|
||||
git-extras | 13 years | 7 hours ago | 807 days | 1703 | 3
|
||||
# Repo | Age | Last active | Active on | Commits | Uncommitted | Branch
|
||||
git-extras | 13 years | 7 hours ago | 807 days | 1703 | 3 | master
|
||||
|
||||
$ git summary --output-style oneline
|
||||
git-extras / age: 13 years / last active: 7 hours ago / active on 807 days / commits: 1703 / uncommitted: 3
|
||||
git-extras / age: 13 years / last active: 7 hours ago / active on 807 days / commits: 1703 / uncommitted: 3 / branch: master
|
||||
```
|
||||
|
||||
## git effort
|
||||
|
|
|
|||
|
|
@ -172,6 +172,10 @@ single_file() {
|
|||
done
|
||||
}
|
||||
|
||||
current_branch_name() {
|
||||
git rev-parse --abbrev-ref HEAD
|
||||
}
|
||||
|
||||
#
|
||||
# list the author for all file
|
||||
#
|
||||
|
|
@ -211,14 +215,15 @@ print_summary_by_line() {
|
|||
|
||||
print_summary() {
|
||||
if [ "$OUTPUT_STYLE" == "tabular" ]; then
|
||||
tabular_headers="# Repo $SP Age $SP Last active $SP Active on $SP Commits $SP Uncommitted"
|
||||
echo -e "$tabular_headers\n$project $SP $(repository_age) $SP $(last_active) $SP $(active_days "$commit") days $SP $(commit_count "$commit") $SP $(uncommitted_changes_count)" | column -t -s "$COLUMN_CMD_DELIMTER"
|
||||
tabular_headers="# Repo $SP Age $SP Last active $SP Active on $SP Commits $SP Uncommitted $SP Branch"
|
||||
echo -e "$tabular_headers\n$project $SP $(repository_age) $SP $(last_active) $SP $(active_days $commit) days $SP $(commit_count $commit) $SP $(uncommitted_changes_count) $SP $(current_branch_name)" | column -t -s "$COLUMN_CMD_DELIMTER"
|
||||
elif [ "$OUTPUT_STYLE" == "oneline" ]; then
|
||||
echo "$project / age: $(repository_age) / last active: $(last_active) / active on $(active_days "$commit") days / commits: $(commit_count "$commit") / uncommitted: $(uncommitted_changes_count)"
|
||||
echo "$project / age: $(repository_age) / last active: $(last_active) / active on $(active_days $commit) days / commits: $(commit_count $commit) / uncommitted: $(uncommitted_changes_count) / branch: $(current_branch_name)"
|
||||
else
|
||||
echo
|
||||
echo " project : $project"
|
||||
echo " repo age : $(repository_age)"
|
||||
echo " branch: : $(current_branch_name)"
|
||||
echo " last active : $(last_active)"
|
||||
# shellcheck disable=SC2086
|
||||
echo " active on : $(active_days $commit) days"
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ This option can not be used together with \fB\-\-dedup\-by\-email\fR or \fB\-\-n
|
|||
\-\-output\-style <style>
|
||||
.
|
||||
.P
|
||||
Summarizes the repository and print the output accoring to the specified style\. Styles: * \fBtabular\fR: Prints the summary in a tabular form having a header in the first line and the values in the second * \fBoneline\fR: Prints the summary in a single line
|
||||
Summarizes the repository and print the output accoring to the specified style\. Styles: * \fBtabular\fR: Prints the summary in a tabular form having a header in the first line and the values in the second\. Column separator is a \fB|\fR sorrounded by at least one space on each side\. * \fBoneline\fR: Prints the summary in a single line\. Fields are separated by a \fB/\fR sorrounded by one space on each side\.
|
||||
.
|
||||
.P
|
||||
Some information like the authors cannot be displayed in this mode\.
|
||||
|
|
@ -85,6 +85,7 @@ $ git summary
|
|||
|
||||
project : express
|
||||
repo age : 10 months ago
|
||||
branch : master
|
||||
last active : 3 weeks ago
|
||||
active on : 93 days
|
||||
commits : 1893
|
||||
|
|
@ -171,8 +172,8 @@ Tabular summary
|
|||
.nf
|
||||
|
||||
$ git summary \-\-output\-style tabular
|
||||
# Repo | Age | Last active | Active on | Commits | Uncommitted
|
||||
git\-extras | 13 years | 7 hours ago | 807 days | 1703 | 3
|
||||
# Repo | Age | Last active | Active on | Commits | Uncommitted | Branch
|
||||
git\-extras | 13 years | 7 hours ago | 807 days | 1703 | 3 | master
|
||||
.
|
||||
.fi
|
||||
.
|
||||
|
|
@ -186,7 +187,7 @@ Oneline summary
|
|||
.nf
|
||||
|
||||
$ git summary \-\-output\-style oneline
|
||||
git\-extras / age: 13 years / last active: 7 hours ago / active on 807 days / commits: 1703 / uncommitted: 3
|
||||
git\-extras / age: 13 years / last active: 7 hours ago / active on 807 days / commits: 1703 / uncommitted: 3 / branch: master
|
||||
.
|
||||
.fi
|
||||
.
|
||||
|
|
|
|||
|
|
@ -124,8 +124,10 @@ $ git summary --dedup-by-email
|
|||
<p> Summarizes the repository and print the output accoring to the specified style.
|
||||
Styles:
|
||||
* <code>tabular</code>: Prints the summary in a tabular form having a header in the
|
||||
first line and the values in the second
|
||||
* <code>oneline</code>: Prints the summary in a single line</p>
|
||||
first line and the values in the second. Column separator is a <code>|</code>
|
||||
sorrounded by at least one space on each side.
|
||||
* <code>oneline</code>: Prints the summary in a single line. Fields are separated by a <code>/</code>
|
||||
sorrounded by one space on each side.</p>
|
||||
|
||||
<p> Some information like the authors cannot be displayed in this mode.</p>
|
||||
|
||||
|
|
@ -137,6 +139,7 @@ $ git summary --dedup-by-email
|
|||
|
||||
project : express
|
||||
repo age : 10 months ago
|
||||
branch : master
|
||||
last active : 3 weeks ago
|
||||
active on : 93 days
|
||||
commits : 1893
|
||||
|
|
@ -192,19 +195,19 @@ authors :
|
|||
<p> Tabular summary</p>
|
||||
|
||||
<pre><code>$ git summary --output-style tabular
|
||||
# Repo | Age | Last active | Active on | Commits | Uncommitted
|
||||
git-extras | 13 years | 7 hours ago | 807 days | 1703 | 3
|
||||
# Repo | Age | Last active | Active on | Commits | Uncommitted | Branch
|
||||
git-extras | 13 years | 7 hours ago | 807 days | 1703 | 3 | master
|
||||
</code></pre>
|
||||
|
||||
<p> Oneline summary</p>
|
||||
|
||||
<pre><code>$ git summary --output-style oneline
|
||||
git-extras / age: 13 years / last active: 7 hours ago / active on 807 days / commits: 1703 / uncommitted: 3
|
||||
git-extras / age: 13 years / last active: 7 hours ago / active on 807 days / commits: 1703 / uncommitted: 3 / branch: master
|
||||
</code></pre>
|
||||
|
||||
<h2 id="AUTHOR">AUTHOR</h2>
|
||||
|
||||
<p>Written by Tj Holowaychuk <<a href="mailto:tj@vision-media.ca" data-bare-link="true">tj@vision-media.ca</a>></p>
|
||||
<p>Written by Tj Holowaychuk <<a href="mailto:tj@vision-media.ca" data-bare-link="true">tj@vision-media.ca</a>></p>
|
||||
|
||||
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
|
||||
|
||||
|
|
|
|||
|
|
@ -50,8 +50,10 @@ Shows a summary of the repository or a path within it.
|
|||
Summarizes the repository and print the output accoring to the specified style.
|
||||
Styles:
|
||||
* `tabular`: Prints the summary in a tabular form having a header in the
|
||||
first line and the values in the second
|
||||
* `oneline`: Prints the summary in a single line
|
||||
first line and the values in the second. Column separator is a `|`
|
||||
sorrounded by at least one space on each side.
|
||||
* `oneline`: Prints the summary in a single line. Fields are separated by a `/`
|
||||
sorrounded by one space on each side.
|
||||
|
||||
Some information like the authors cannot be displayed in this mode.
|
||||
|
||||
|
|
@ -63,6 +65,7 @@ Shows a summary of the repository or a path within it.
|
|||
|
||||
project : express
|
||||
repo age : 10 months ago
|
||||
branch : master
|
||||
last active : 3 weeks ago
|
||||
active on : 93 days
|
||||
commits : 1893
|
||||
|
|
@ -114,13 +117,13 @@ Shows a summary of the repository or a path within it.
|
|||
Tabular summary
|
||||
|
||||
$ git summary --output-style tabular
|
||||
# Repo | Age | Last active | Active on | Commits | Uncommitted
|
||||
git-extras | 13 years | 7 hours ago | 807 days | 1703 | 3
|
||||
# Repo | Age | Last active | Active on | Commits | Uncommitted | Branch
|
||||
git-extras | 13 years | 7 hours ago | 807 days | 1703 | 3 | master
|
||||
|
||||
Oneline summary
|
||||
|
||||
$ git summary --output-style oneline
|
||||
git-extras / age: 13 years / last active: 7 hours ago / active on 807 days / commits: 1703 / uncommitted: 3
|
||||
git-extras / age: 13 years / last active: 7 hours ago / active on 807 days / commits: 1703 / uncommitted: 3 / branch: master
|
||||
|
||||
## AUTHOR
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue