diff --git a/Makefile b/Makefile index 69b01c8..4b2a255 100644 --- a/Makefile +++ b/Makefile @@ -6,20 +6,24 @@ PREFIX ?= /usr/local all: man mgitstatus.1: mgitstatus.1.md - pandoc ./$< -s -t man > $@ + pandoc ./$< -s -t man > $@ .PHONY: man man: mgitstatus.1 .PHONY: test test: - # SC1117 Backslash is literal in... - # SC2059 Don't use variables in the printf format string. But we need to or colors won't work - shellcheck -e SC1117,SC2059 mgitstatus + # SC1117 Backslash is literal in... + # SC2059 Don't use variables in the printf format string. But we need to or colors won't work + shellcheck -e SC1117,SC2059 mgitstatus .PHONY: install install: - install -d $(DESTDIR)$(PREFIX)/bin - install -d $(DESTDIR)$(PREFIX)/man/man1 - install mgitstatus -m 755 $(DESTDIR)$(PREFIX)/bin/ - install mgitstatus.1 $(DESTDIR)$(PREFIX)/man/man1/ + install -d $(DESTDIR)$(PREFIX)/bin + install -d $(DESTDIR)$(PREFIX)/man/man1 + install mgitstatus -m 755 $(DESTDIR)$(PREFIX)/bin/ + install mgitstatus.1 $(DESTDIR)$(PREFIX)/man/man1/ + +.PHONY: clean +clean: + rm -f mgitstatus.1 diff --git a/README.md b/README.md index 8217929..4a1ede5 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ For more examples, see the [manual page](mgitstatus.1.md). # Installation -mgitstatus requires make. +mgitstatus requires make and pandoc. The following steps will install mgitstatus: @@ -82,6 +82,9 @@ The following steps will install mgitstatus: $ git clone https://github.com/fboender/multi-git-status.git $ cd multi-git-status + # Build manpage + $ make + # Install globally (all users) $ sudo make install diff --git a/mgitstatus.1 b/mgitstatus.1 deleted file mode 100644 index 20bfe76..0000000 --- a/mgitstatus.1 +++ /dev/null @@ -1,192 +0,0 @@ -.\" Automatically generated by Pandoc 2.5 -.\" -.TH "MGITSTATUS" "1" "Mar 2022" "" "" -.hy -.SH NAME -.PP -mgitstatus \- Show uncommitted, untracked and unpushed changes for -multiple Git repos. -.SH SYNOPSIS -.PP -\f[B]mgitstatus\f[R] [\f[B]\-\-version\f[R]] [\f[B]\-w\f[R]] -[\f[B]\-e\f[R]] [\f[B]\-f\f[R]] [\f[B]\-\-throttle\f[R] SEC] -[\f[B]\-c\f[R]] [\f[B]\-d/\-\-depth\f[R]=2] [\f[B]\-\-flatten\f[R]] -[\f[B]\-\-no\-X\f[R]] [\f[B]DIR\f[R] [\f[B]DIR\f[R]]\&...] -.SH DESCRIPTION -.PP -\f[B]mgitstatus\f[R] shows uncommitted, untracked and unpushed changes -in multiple Git repositories. -By default, \f[B]mgitstatus\f[R] scans two directories deep. -This can be changed with the \f[C]\-d\f[R] (\f[C]\-\-depth\f[R]) option. -If \f[B]DEPTH\f[R] is 0, the scan is infinitely deep. -.PP -mgitstatus shows: -.IP \[bu] 2 -\f[B]Uncommitted changes\f[R] if there are unstaged or uncommitted -changes on the checked out branch. -.IP \[bu] 2 -\f[B]Untracked files\f[R] if there are untracked files which are not -ignored. -.IP \[bu] 2 -\f[B]Needs push (BRANCH)\f[R] if the branch is tracking a (remote) -branch which is behind. -.IP \[bu] 2 -\f[B]Needs upstream (BRANCH)\f[R] if a branch does not have a local or -remote upstream branch configured. -Changes in the branch may otherwise never be pushed or merged. -.IP \[bu] 2 -\f[B]Needs pull (BRANCH)\f[R] if the branch is tracking a (remote) -branch which is ahead. -This requires that the local git repo already knows about the remote -changes (i.e.\ you\[cq]ve done a fetch), or that you specify the \-f -option. -mgitstatus does NOT contact the remote by default. -.IP \[bu] 2 -\f[B]X stashes\f[R] if there are stashes. -.PP -Since there are a lot of different states a git repository can be in, -mgitstatus makes no guarantees that all states are taken into account. -.SH OPTIONS -.TP -.B \f[B]\-\-version\f[R] -Show version -.TP -.B \f[B]\-w\f[R] -Warn about dirs that are not Git repositories -.TP -.B \f[B]\-e\f[R] -Exclude repos that are `ok' -.TP -.B \f[B]\-f\f[R] -Do a `git fetch' on each repo (slow for many repos) -.TP -.B \f[B]\-\-throttle SEC\f[R] -Wait SEC seconds between each `git fetch' (\-f option) -.TP -.B \f[B]\-c\f[R] -Force color output (preserve colors when using pipes) -.TP -.B \f[B]\-d, \-\-depth=2\f[R] -Scan this many directories deep. -Default is 2. -If \f[B]0\f[R], the scan is infinitely deep -.TP -.B \f[B]\-\-flatten\f[R] -Flatten output by only showing one status per line. -If a repo has multiple statuses, multiple lines are shown for that repo. -This aids in grepability. -.PP -You can limit output with the following options: -.TP -.B \f[B]\-\-no\-push\f[R] -Do not show branches that need a push. -.TP -.B \f[B]\-\-no\-pull\f[R] -Do not show branches that need a pull. -.TP -.B \f[B]\-\-no\-upstream\f[R] -Do not show branches that need an upstream. -.TP -.B \f[B]\-\-no\-uncommitted\f[R] -Do not show branches that have unstaged or uncommitted changes. -.TP -.B \f[B]\-\-no\-untracked\f[R] -Do not show branches that have untracked files. -.TP -.B \f[B]\-\-no\-stashes\f[R] -Do now show stashes -.TP -.B \f[B]\-\-no\-ok\f[R] -Do now show repos that are `ok' (same as \-e) -.SH EXAMPLES -.PP -The following command scans two directories deep for Git projects and -shows their status: -.IP -.nf -\f[C] -$ mgitstatus -\&./fboender/sla: ok -\&./fboender/multi\-git\-status: Needs push (master) Untracked files -\&./other/peewee: ok -\f[R] -.fi -.PP -To scan deeper (three dirs instead of two) in the current dir: -.IP -.nf -\f[C] -$ mgitstatus \-d 3 -\f[R] -.fi -.PP -The following command scans three levels deep in \f[C]/opt/deploy/\f[R] -and hides repos that are `ok'. -It does not show stashes: -.IP -.nf -\f[C] -$ mgitstatus \-e \-\-no\-stashes \-d 3 /opt/deploy -\f[R] -.fi -.PP -To ignore a repo, set the \f[C]mgitstatus.ignore\f[R] git configuration -option for that repo to \f[C]true\f[R]. -E.g.: -.IP -.nf -\f[C] -$ cd stupidrepo -$ git config \-\-local mgitstatus.ignore true -\f[R] -.fi -.PP -Sort output by repo name while retaining colors: -.IP -.nf -\f[C] -$ mgitstatus \-c | sort -\&./ansible: ok -\&./ansible\-cmdb: Needs push (master) Uncommitted changes Untracked files -\&./davis: ok -\&./espy: Uncommitted changes Untracked files -\&./garner: Untracked files -\&./garner\-chains: ok -\&./mdpreview: ok -\f[R] -.fi -.PP -Sort output by repo status while retaining colors: -.IP -.nf -\f[C] -$ mgitstatus \-c \-\-flatten \-e | sort \-k2 -\&./fboender/ansible\-cmdb: Uncommitted changes -\&./fboender/espy: Uncommitted changes -\&./fboender/multi\-git\-status: Uncommitted changes -\&./fboender/ansible\-cmdb: Needs push (master) -\&./fboender/ansible\-cmdb: Untracked files -\&./fboender/espy: Untracked files -\&./fboender/garner: Untracked files -\&./fboender/multi\-git\-status: Untracked files -\f[R] -.fi -.PP -Force color output and flatten the output so we can grep for things: -.IP -.nf -\f[C] -$ mgitstatus \-\-flatten \-c | grep Uncommitted -\&./fboender/multi\-git\-status: Uncommitted changes -\&./fboender/ansible\-cmdb: Uncommitted changes -\&./fboender/espy: Uncommitted changes -\f[R] -.fi -.SH COPYRIGHT -.PP -Copyright 2016\-2022, Ferry Boender (et al). -.PP -Licensed under the MIT license. -For more information, see the LICENSE.txt file. -.SH AUTHORS -Ferry Boender.