Skip to content

Commit 7320b89

Browse files
authored
Merge pull request #41 from SuperSandro2000/makefile
Add Makefile
2 parents e27d132 + d66cceb commit 7320b89

File tree

6 files changed

+82
-110
lines changed

6 files changed

+82
-110
lines changed

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
SHELL := /bin/sh
2+
3+
PREFIX ?= /usr/local
4+
5+
.PHONY: all
6+
all: man
7+
8+
mgitstatus.1: mgitstatus.1.md
9+
pandoc ./$< -s -t man > $@
10+
11+
.PHONY: man
12+
man: mgitstatus.1
13+
14+
.PHONY: test
15+
test:
16+
# SC1117 Backslash is literal in...
17+
# SC2059 Don't use variables in the printf format string. But we need to or colors won't work
18+
shellcheck -e SC1117,SC2059 mgitstatus
19+
20+
.PHONY: install
21+
install:
22+
install -d $(DESTDIR)$(PREFIX)/bin
23+
install -d $(DESTDIR)$(PREFIX)/man/man1
24+
install mgitstatus -m 755 $(DESTDIR)$(PREFIX)/bin/
25+
install mgitstatus.1 $(DESTDIR)$(PREFIX)/man/man1/

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ For more examples, see the [manual page](mgitstatus.1.md).
7171

7272
# Installation
7373

74-
mgitstatus requires a POSIX compliant shell. Bash will do fine.
74+
mgitstatus requires make.
7575

7676
The following steps will install mgitstatus:
7777

@@ -80,10 +80,10 @@ The following steps will install mgitstatus:
8080
$ cd multi-git-status
8181

8282
# Install globally (all users)
83-
$ sudo ./install.sh
83+
$ sudo make install
8484

8585
# Install locally (only your user)
86-
$ PREFIX=~/.local ./install.sh
86+
$ PREFIX=~/.local make install
8787

8888
# License
8989

build.sla

Lines changed: 0 additions & 21 deletions
This file was deleted.

install.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

mgitstatus.1

Lines changed: 51 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,132 @@
1-
.\" Automatically generated by Pandoc 1.19.2.4
1+
.\" Automatically generated by Pandoc 2.5
22
.\"
33
.TH "MGITSTATUS" "1" "Jul 2019" "" ""
44
.hy
55
.SH NAME
66
.PP
7-
mgitstatus \[en] Show uncommitted, untracked and unpushed changes for
7+
mgitstatus \- Show uncommitted, untracked and unpushed changes for
88
multiple Git repos.
99
.SH SYNOPSIS
1010
.PP
11-
\f[B]mgitstatus\f[] [\f[B]\-\-version\f[]] [\f[B]\-w\f[]] [\f[B]\-e\f[]]
12-
[\f[B]\-f\f[]] [\f[B]\-\-no\-X\f[]] [\f[B]\-d/\-\-depth\f[]=2]
13-
[\f[B]DIR\f[] [\f[B]DIR\f[]]...]
11+
\f[B]mgitstatus\f[R] [\f[B]\-\-version\f[R]] [\f[B]\-w\f[R]]
12+
[\f[B]\-e\f[R]] [\f[B]\-f\f[R]] [\f[B]\-\-no\-X\f[R]]
13+
[\f[B]\-d/\-\-depth\f[R]=2] [\f[B]DIR\f[R] [\f[B]DIR\f[R]]\&...]
1414
.SH DESCRIPTION
1515
.PP
16-
\f[B]mgitstatus\f[] shows uncommited, untracked and unpushed changes in
17-
multiple Git repositories.
18-
By default, \f[B]mgitstatus\f[] scans two directories deep.
19-
This can be changed with the \f[C]\-d\f[] (\f[C]\-\-depth\f[]) option.
20-
If \f[B]DEPTH\f[] is 0, the scan is infinitely deep.
16+
\f[B]mgitstatus\f[R] shows uncommitted, untracked and unpushed changes
17+
in multiple Git repositories.
18+
By default, \f[B]mgitstatus\f[R] scans two directories deep.
19+
This can be changed with the \f[C]\-d\f[R] (\f[C]\-\-depth\f[R]) option.
20+
If \f[B]DEPTH\f[R] is 0, the scan is infinitely deep.
2121
.PP
2222
mgitstatus shows:
2323
.IP \[bu] 2
24-
\f[B]Uncommitted changes\f[] if there are unstaged or uncommitted
24+
\f[B]Uncommitted changes\f[R] if there are unstaged or uncommitted
2525
changes on the checked out branch.
2626
.IP \[bu] 2
27-
\f[B]Untracked files\f[] if there are untracked files which are not
27+
\f[B]Untracked files\f[R] if there are untracked files which are not
2828
ignored.
2929
.IP \[bu] 2
30-
\f[B]Needs push (BRANCH)\f[] if the branch is tracking a (remote) branch
31-
which is behind.
30+
\f[B]Needs push (BRANCH)\f[R] if the branch is tracking a (remote)
31+
branch which is behind.
3232
.IP \[bu] 2
33-
\f[B]Needs upstream (BRANCH)\f[] if a branch does not have a local or
33+
\f[B]Needs upstream (BRANCH)\f[R] if a branch does not have a local or
3434
remote upstream branch configured.
3535
Changes in the branch may otherwise never be pushed or merged.
3636
.IP \[bu] 2
37-
\f[B]Needs pull (BRANCH)\f[] if the branch is tracking a (remote) branch
38-
which is ahead.
37+
\f[B]Needs pull (BRANCH)\f[R] if the branch is tracking a (remote)
38+
branch which is ahead.
3939
This requires that the local git repo already knows about the remote
40-
changes (i.e.
41-
you\[aq]ve done a fetch), or that you specify the \-f option.
40+
changes (i.e.\ you\[cq]ve done a fetch), or that you specify the \-f
41+
option.
4242
mgitstatus does NOT contact the remote by default.
4343
.IP \[bu] 2
44-
\f[B]X stashes\f[] if there are stashes.
44+
\f[B]X stashes\f[R] if there are stashes.
4545
.PP
4646
Since there are a lot of different states a git repository can be in,
4747
mgitstatus makes no guarantees that all states are taken into account.
4848
.SH OPTIONS
4949
.TP
50-
.B \f[B]\-\-version\f[]
50+
.B \f[B]\-\-version\f[R]
5151
Show version
52-
.RS
53-
.RE
5452
.TP
55-
.B \f[B]\-w\f[]
53+
.B \f[B]\-w\f[R]
5654
Warn about dirs that are not Git repositories
57-
.RS
58-
.RE
5955
.TP
60-
.B \f[B]\-e\f[]
61-
Exclude repos that are \[aq]ok\[aq]
62-
.RS
63-
.RE
56+
.B \f[B]\-e\f[R]
57+
Exclude repos that are `ok'
6458
.TP
65-
.B \f[B]\-f\f[]
66-
Do a \[aq]git fetch\[aq] on each repo (slow for many repos)
67-
.RS
68-
.RE
59+
.B \f[B]\-f\f[R]
60+
Do a `git fetch' on each repo (slow for many repos)
6961
.TP
70-
.B \f[B]\-c\f[]
62+
.B \f[B]\-c\f[R]
7163
Force color output (preserve colors when using pipes)
72-
.RS
73-
.RE
7464
.TP
75-
.B \f[B]\-d, \-\-depth=2\f[]
65+
.B \f[B]\-d, \-\-depth=2\f[R]
7666
Scan this many directories deep.
7767
Default is 2.
78-
If \f[B]0\f[], the scan is infinitely deep
79-
.RS
80-
.RE
68+
If \f[B]0\f[R], the scan is infinitely deep
8169
.PP
8270
You can limit output with the following options:
8371
.TP
84-
.B \f[B]\-\-no\-push\f[]
72+
.B \f[B]\-\-no\-push\f[R]
8573
Do not show branches that need a push.
86-
.RS
87-
.RE
8874
.TP
89-
.B \f[B]\-\-no\-pull\f[]
75+
.B \f[B]\-\-no\-pull\f[R]
9076
Do not show branches that need a pull.
91-
.RS
92-
.RE
9377
.TP
94-
.B \f[B]\-\-no\-upstream\f[]
78+
.B \f[B]\-\-no\-upstream\f[R]
9579
Do not show branches that need an upstream.
96-
.RS
97-
.RE
9880
.TP
99-
.B \f[B]\-\-no\-uncommited\f[]
81+
.B \f[B]\-\-no\-uncommitted\f[R]
10082
Do not show branches that have unstaged or uncommitted changes.
101-
.RS
102-
.RE
10383
.TP
104-
.B \f[B]\-\-no\-untracked\f[]
84+
.B \f[B]\-\-no\-untracked\f[R]
10585
Do not show branches that have untracked files.
106-
.RS
107-
.RE
10886
.TP
109-
.B \f[B]\-\-no\-stashes\f[]
87+
.B \f[B]\-\-no\-stashes\f[R]
11088
Do now show stashes
111-
.RS
112-
.RE
11389
.SH EXAMPLES
11490
.PP
11591
The following command scans two directories deep for Git projects and
11692
shows their status:
11793
.IP
11894
.nf
11995
\f[C]
120-
$\ mgitstatus\
121-
\&./fboender/sla:\ ok\
122-
\&./fboender/multi\-git\-status:\ Needs\ push\ (master)\ Untracked\ files
123-
\&./other/peewee:\ ok\
124-
\f[]
96+
$ mgitstatus
97+
\&./fboender/sla: ok
98+
\&./fboender/multi\-git\-status: Needs push (master) Untracked files
99+
\&./other/peewee: ok
100+
\f[R]
125101
.fi
126102
.PP
127103
To scan deeper (three dirs instead of two) in the current dir:
128104
.IP
129105
.nf
130106
\f[C]
131-
$\ mgitstatus\ \-d\ 3
132-
\f[]
107+
$ mgitstatus \-d 3
108+
\f[R]
133109
.fi
134110
.PP
135-
The following command scans three levels deep in \f[C]/opt/deploy/\f[]
136-
and hides repos that are \[aq]ok\[aq].
111+
The following command scans three levels deep in \f[C]/opt/deploy/\f[R]
112+
and hides repos that are `ok'.
137113
It does not show stashes:
138114
.IP
139115
.nf
140116
\f[C]
141-
$\ mgitstatus\ \-e\ \-\-no\-stashes\ \-d\ 3\ /opt/deploy
142-
\f[]
117+
$ mgitstatus \-e \-\-no\-stashes \-d 3 /opt/deploy
118+
\f[R]
143119
.fi
144120
.PP
145-
To ignore a repo, set the \f[C]mgitstatus.ignore\f[] git configuration
146-
option for that repo to \f[C]true\f[].
121+
To ignore a repo, set the \f[C]mgitstatus.ignore\f[R] git configuration
122+
option for that repo to \f[C]true\f[R].
147123
E.g.:
148124
.IP
149125
.nf
150126
\f[C]
151-
$\ cd\ stupidrepo
152-
$\ git\ config\ \-\-local\ mgitstatus.ignore\ true
153-
\f[]
127+
$ cd stupidrepo
128+
$ git config \-\-local mgitstatus.ignore true
129+
\f[R]
154130
.fi
155131
.SH COPYRIGHT
156132
.PP

mgitstatus.1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ You can limit output with the following options:
8787
The following command scans two directories deep for Git projects and shows
8888
their status:
8989

90-
$ mgitstatus
91-
./fboender/sla: ok
90+
$ mgitstatus
91+
./fboender/sla: ok
9292
./fboender/multi-git-status: Needs push (master) Untracked files
93-
./other/peewee: ok
93+
./other/peewee: ok
9494

9595
To scan deeper (three dirs instead of two) in the current dir:
9696

0 commit comments

Comments
 (0)