File tree Expand file tree Collapse file tree 10 files changed +275
-0
lines changed
Expand file tree Collapse file tree 10 files changed +275
-0
lines changed Original file line number Diff line number Diff line change 44 - [ ` git archive-file ` ] ( #git-archive-file )
55 - [ ` git authors ` ] ( #git-authors )
66 - [ ` git browse ` ] ( #git-browse )
7+ - [ ` git browse-ci ` ] ( #git-browse-ci )
78 - [ ` git bulk ` ] ( #git-bulk )
89 - [ ` git brv ` ] ( #git-brv )
910 - [ ` git changelog ` ] ( #git-changelog )
@@ -1502,6 +1503,19 @@ Opens the current git repository website in your default web browser.
15021503
15031504```bash
15041505$ git browse
1506+
1507+ $ git browse upstream
1508+ ```
1509+
1510+ ## git browse-ci
1511+
1512+ Opens the current git repository CI website (e.g. GitHub Actions, GitLab CI,
1513+ Bitbucket Pipelines) in your default web browser.
1514+
1515+ ```bash
1516+ $ git browse-ci
1517+
1518+ $ git browse-ci upstream
15051519```
15061520
15071521## git utimes
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e -o pipefail
4+ if [[ $1 == " " ]]
5+ then
6+ branch=$( git rev-parse --abbrev-ref HEAD & > /dev/null)
7+ remote=$( git config branch." ${branch} " .remote || echo " origin" )
8+ else
9+ remote=$1
10+ fi
11+
12+ if [[ $remote == " " ]]
13+ then
14+ echo " Remote not found"
15+ exit 1
16+ fi
17+
18+ remote_url=$( git remote get-url " ${remote} " )
19+
20+ if [[ $? -ne 0 ]]
21+ then
22+ exit $?
23+ fi
24+
25+ if [[ $remote_url = git@* ]]
26+ then
27+ url=$( echo " ${remote_url} " | sed -E -e ' s/:/\//' -e ' s/\.git$//' -e ' s/.*@(.*)/http:\/\/\1/' )
28+ elif [[ $remote_url = http* ]]
29+ then
30+ url=${remote_url% .git}
31+ fi
32+
33+ if [[ $url =~ github ]]
34+ then
35+ ci_url=${url} /actions
36+ elif [[ $url =~ gitlab ]]
37+ then
38+ ci_url=${url} /-/pipelines
39+ elif [[ $url =~ bitbucket ]]
40+ then
41+ ci_url=${url} /addon/pipelines/home
42+ fi
43+ case " $OSTYPE " in
44+ darwin* )
45+ # MacOS
46+ open " ${ci_url} "
47+ ;;
48+ msys)
49+ # Git-Bash on Windows
50+ start " ${ci_url} "
51+ ;;
52+ linux* )
53+ # Handle WSL on Windows
54+ if uname -a | grep -i -q Microsoft
55+ then
56+ powershell.exe -NoProfile start " ${ci_url} "
57+ else
58+ xdg-open " ${ci_url} "
59+ fi
60+ ;;
61+ * )
62+ # fall back to xdg-open for BSDs, etc.
63+ xdg-open " ${ci_url} "
64+ ;;
65+ esac
Original file line number Diff line number Diff line change @@ -154,3 +154,7 @@ _git_info(){
154154_git_browse (){
155155 __git_complete_remote_or_refspec
156156}
157+
158+ _git_browse_ci (){
159+ __git_complete_remote_or_refspec
160+ }
Original file line number Diff line number Diff line change @@ -346,6 +346,7 @@ zstyle ':completion:*:*:git:*' user-commands $existing_user_commands \
346346 archive-file:' export the current head of the git repository to an archive' \
347347 authors:' generate authors report' \
348348 browse:' open repo website in browser' \
349+ browse-ci:' open repo CI page in browser' \
349350 bug:' create bug branch' \
350351 bulk:' run bulk commands' \
351352 brv:' list branches sorted by their last commit date' \
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ set __fish_git_extras_commands \
44 " archive-file:Export the current HEAD of the git repository to an archive" \
55 " authors:Generate authors report" \
66 " browse:View the web page for the current repository" \
7+ " browse-ci:View the CI page for the current repository" \
78 " brv:List branches sorted by their last commit date" \
89 " bulk:Run git commands on multiple repositories" \
910 " changelog:Generate a changelog report" \
Original file line number Diff line number Diff line change 1+ .\" generated with Ronn/v0.7.3
2+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3+ .
4+ .TH "GIT\- BROWSE\- CI" "1" "March 2022" "" "Git Extras"
5+ .
6+ .SH "NAME"
7+ \fB git \- browse \- ci \fR \-
8+ .
9+ .SH "SYNOPSIS"
10+ \fB git \- browse \- ci \fR [remote_name]
11+ .
12+ .SH "DESCRIPTION"
13+ Opens the current git repository CI page in your default web browser\.
14+ .
15+ .SH "OPTIONS"
16+ <remote_name>
17+ .
18+ .P
19+ The name of the remote you wish to browse to\. Defaults to the first remote if not specified\.
20+ .
21+ .SH "EXAMPLES"
22+ $ git browse\- ci
23+ .
24+ .P
25+ $ git browse\- ci upstream
26+ .
27+ .SH "AUTHOR"
28+ Written by Peter Benjamin <\fI https://github \. com/pbnj \fR >
29+ .
30+ .SH "REPORTING BUGS"
31+ <\fI https://github \. com/tj/git \- extras/issues \fR >
32+ .
33+ .SH "SEE ALSO"
34+ <\fI https://github \. com/tj/git \- extras \fR >
Original file line number Diff line number Diff line change 1+ git-browse-ci(1) -- <View the web page for the current repository >
2+ ================================
3+
4+ ## SYNOPSIS
5+
6+ ` git-browse-ci ` [ remote_name]
7+
8+ ## DESCRIPTION
9+
10+ Opens the current git repository CI page in your default web browser.
11+
12+ ## OPTIONS
13+
14+ < ; remote_name> ;
15+
16+ The name of the remote you wish to browse to. Defaults to
17+ the first remote if not specified.
18+
19+ ## EXAMPLES
20+
21+ $ git browse-ci
22+
23+ $ git browse-ci upstream
24+
25+ ## AUTHOR
26+
27+ Written by Peter Benjamin < ; < https://github.com/pbnj > > ;
28+
29+ ## REPORTING BUGS
30+
31+ < ; < https://github.com/tj/git-extras/issues > > ;
32+
33+ ## SEE ALSO
34+
35+ < ; < https://github.com/tj/git-extras > > ;
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ git-extras(1) -- Awesome GIT utilities
3131 - ** git-alias(1)** Define, search and show aliases
3232 - ** git-archive-file(1)** Export the current HEAD of the git repository to an archive
3333 - ** git-authors(1)** Generate authors report
34+ - ** git-browse-ci(1)** <View the web page for the current repository >
3435 - ** git-browse(1)** <View the web page for the current repository >
3536 - ** git-brv(1)** List branches sorted by their last commit date
3637 - ** git-bulk(1)** Run git commands on multiple repositories
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ git-abort(1) git-abort
33git-alias(1) git-alias
44git-archive-file(1) git-archive-file
55git-authors(1) git-authors
6+ git-browse-ci(1) git-browse-ci
67git-browse(1) git-browse
78git-brv(1) git-brv
89git-bulk(1) git-bulk
You can’t perform that action at this time.
0 commit comments