Feat: allow git-summary showing full path of repository (#1193)
Some checks failed
ci / lint (push) Has been cancelled
ci / typo (push) Has been cancelled
ci / test (push) Has been cancelled
ci / build (macos-latest) (push) Has been cancelled
ci / build (ubuntu-latest) (push) Has been cancelled

* 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:
Pierre Ayoub 2025-02-27 07:25:55 +01:00 committed by GitHub
parent 8eed5f49ad
commit a841845d9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 25 additions and 3 deletions

View file

@ -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>

View file

@ -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]'

View file

@ -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>\.

View file

@ -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>

View file

@ -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.