blob: e0861b2e9967214c3782ead4286fd085017afff3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
.TH GIT\-PRECHECK 1 git\-sonar
.SH NAME
git\-precheck \- detect "unready" state of a git repository
.SH SYNOPSIS
.B git\-precheck
.RB [ \-\-quiet ]
.RB [ \-\-ignore\-dirty ]
.RB [ \-\-ignore\-untracked ]
.SH DESCRIPTION
If
.B git\-precheck
is run inside a git repository, it examines the repo for any in\-progress git
operations or unclean state and returns an exit code indicating the status.
Otherwise,
.B git\-precheck
reports that it is not in any git worktree.
.P
If
.B \-\-quiet
is not given, a line of text is printed describing each condition found.
.SH OPTIONS
.TP
.B \-\-quiet
Don't actually print anything.
.TP
.B \-\-ignore\-dirty
Don't consider the presence of uncommitted changes to tracked files as an
unclean state.
.TP
.B \-\-ignore\-untracked
Don't consider the presence of untracked files as an unclean state.
.SH EXIT STATUS
.TP
.B 0
If inside a repository and all checks return normal
.TP
.B 1
If untracked files are detected
.TP
.B 2
If dirty/modified files are detected
.TP
.B 3
If any ongoing git operation is in progress
.TP
.B 4
If not inside a git repository
.P
.B git\-precheck
will exit with any other value if an error occurs.
.SH SEE ALSO
.BR git\-sonar (1),
.BR git\-status (1)
.SH LICENSE
.B git\-precheck
is part of the
.B git\-sonar
project, made available under the terms of the
.B MIT
license.
|