mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Feat: allow git-summary showing full path of repository (#1193)
* feat(git-summary): add --full-path option * docs(git-summary): add doc for --full-path option * docs(man): make using ronn * docs(git-extras-completion.zsh): add --full-path option of git-summary
This commit is contained in:
parent
8eed5f49ad
commit
a841845d9a
|
|
@ -3,12 +3,16 @@
|
|||
|
||||
cd "$(git root)" || { echo "Can't cd to top level directory";exit 1; }
|
||||
|
||||
PROJECT_FULL_PATH=
|
||||
SUMMARY_BY_LINE=
|
||||
DEDUP_BY_EMAIL=
|
||||
MERGES_ARG=
|
||||
OUTPUT_STYLE=
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--full-path)
|
||||
PROJECT_FULL_PATH=1
|
||||
;;
|
||||
--line)
|
||||
SUMMARY_BY_LINE=1
|
||||
;;
|
||||
|
|
@ -51,7 +55,12 @@ if [ -n "$SUMMARY_BY_LINE" ]; then
|
|||
else
|
||||
[ $# -ne 0 ] && commit=$*
|
||||
fi
|
||||
project=${PWD##*/}
|
||||
|
||||
if [[ -n "$PROJECT_FULL_PATH" ]]; then
|
||||
project=${PWD/${HOME}/\~}
|
||||
else
|
||||
project=${PWD##*/}
|
||||
fi
|
||||
|
||||
#
|
||||
# get date for the given <commit>
|
||||
|
|
|
|||
|
|
@ -370,6 +370,7 @@ _git-standup() {
|
|||
}
|
||||
|
||||
_git-summary() {
|
||||
_arguments '--full-path[show repository full path]'
|
||||
_arguments '--line[summarize with lines rather than commits]'
|
||||
_arguments '--dedup-by-email[remove duplicate users by the email address]'
|
||||
_arguments '--no-merges[exclude merge commits]'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
.\" generated with Ronn-NG/v0.9.1
|
||||
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
||||
.TH "GIT\-SUMMARY" "1" "June 2023" "" "Git Extras"
|
||||
.TH "GIT\-SUMMARY" "1" "February 2025" "" "Git Extras"
|
||||
.SH "NAME"
|
||||
\fBgit\-summary\fR \- Show repository summary
|
||||
.SH "SYNOPSIS"
|
||||
|
|
@ -38,6 +38,10 @@ $ git summary \-\-dedup\-by\-email
|
|||
.P
|
||||
Exclude merge commits\.
|
||||
.P
|
||||
\-\-full\-path
|
||||
.P
|
||||
Show the full path of the repository instead of its directory name\.
|
||||
.P
|
||||
\-\-line
|
||||
.P
|
||||
Summarize with lines other than commits\. When \fB\-\-line\fR is specified, the last argument is treated as <path>\.
|
||||
|
|
|
|||
|
|
@ -114,6 +114,10 @@ $ git summary --dedup-by-email
|
|||
|
||||
<p>Exclude merge commits.</p>
|
||||
|
||||
<p>--full-path</p>
|
||||
|
||||
<p>Show the full path of the repository instead of its directory name.</p>
|
||||
|
||||
<p>--line</p>
|
||||
|
||||
<p>Summarize with lines other than commits.
|
||||
|
|
@ -221,7 +225,7 @@ git-extras / age: 13 years / last active: 7 hours ago / active on 807 days / com
|
|||
|
||||
<ol class='man-decor man-foot man foot'>
|
||||
<li class='tl'></li>
|
||||
<li class='tc'>June 2023</li>
|
||||
<li class='tc'>February 2025</li>
|
||||
<li class='tr'>git-summary(1)</li>
|
||||
</ol>
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ Shows a summary of the repository or a path within it.
|
|||
|
||||
Exclude merge commits.
|
||||
|
||||
--full-path
|
||||
|
||||
Show the full path of the repository instead of its directory name.
|
||||
|
||||
--line
|
||||
|
||||
Summarize with lines other than commits.
|
||||
|
|
|
|||
Loading…
Reference in a new issue