Skip to content

Commit a067cc3

Browse files
committed
Update docs
1 parent 87e2f1a commit a067cc3

File tree

2 files changed

+44
-27
lines changed

2 files changed

+44
-27
lines changed

git-sizer.go

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,43 @@ const Usage = `usage: git-sizer [OPTS]
4545
4646
Reference selection:
4747
48-
By default, git-sizer processes all Git objects that are reachable from any
49-
reference. The following options can be used to limit which references to
50-
include. The last rule matching a reference determines whether that reference
51-
is processed:
48+
By default, git-sizer processes all Git objects that are reachable
49+
from any reference. The following options can be used to limit which
50+
references to process. The last rule matching a reference determines
51+
whether that reference is processed.
5252
5353
--[no-]branches process [don't process] branches
5454
--[no-]tags process [don't process] tags
55-
--[no-]remotes process [don't process] remote-tracking references
55+
--[no-]remotes process [don't process] remote-tracking
56+
references
5657
--[no-]notes process [don't process] git-notes references
5758
--[no-]stash process [don't process] refs/stash
58-
--include PREFIX process references with the specified PREFIX
59-
(e.g., '--include=refs/remotes/origin')
60-
--include-regexp REGEXP process references matching the specified
61-
regular expression (e.g.,
62-
'--include-regexp=refs/tags/release-.*')
63-
--exclude PREFIX don't process references with the specified
64-
PREFIX (e.g., '--exclude=refs/changes')
65-
--exclude-regexp REGEXP don't process references matching the specified
66-
regular expression
67-
--refgroup=NAME process reference in group defined by gitconfig:
68-
'refgroup.NAME.include',
69-
'refgroup.NAME.includeRegexp',
70-
'refgroup.NAME.exclude', and
71-
'refgroup.NAME.excludeRegexp' as above.
59+
--include PREFIX, --exclude PREFIX
60+
process [don't process] references with the
61+
specified PREFIX (e.g.,
62+
'--include=refs/remotes/origin')
63+
--include /REGEXP/, --exclude /REGEXP/
64+
process [don't process] references matching the
65+
specified regular expression (e.g.,
66+
'--include=refs/tags/release-.*')
67+
--include @REFGROUP, --exclude @REFGROUP
68+
process [don't process] references in the
69+
specified reference group (see below)
7270
--show-refs show which refs are being included/excluded
7371
74-
Prefixes must match at a boundary; for example 'refs/foo' matches
75-
'refs/foo' and 'refs/foo/bar' but not 'refs/foobar'. Regular
76-
expression patterns must match the full reference name.
72+
PREFIX must match at a boundary; for example 'refs/foo' matches
73+
'refs/foo' and 'refs/foo/bar' but not 'refs/foobar'.
74+
75+
REGEXP patterns must match the full reference name.
76+
77+
REFGROUP can be the name of a predefined reference group ('branches',
78+
'tags', 'remotes', 'notes', or 'stash'), or one defined via
79+
gitconfig settings like the following (these can be repeated):
80+
81+
* 'refgroup.REFGROUP.include=PREFIX'
82+
* 'refgroup.REFGROUP.includeRegexp=REGEXP'
83+
* 'refgroup.REFGROUP.exclude=PREFIX'
84+
* 'refgroup.REFGROUP.excludeRegexp=REGEXP'
7785
7886
`
7987

internal/refopts/ref_group_builder.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,27 @@ func (rgb *RefGroupBuilder) AddRefopts(flags *pflag.FlagSet) {
146146
&filterValue{rgb, git.Include, "", false}, "include",
147147
"include specified references",
148148
)
149-
flags.Var(
150-
&filterValue{rgb, git.Include, "", true}, "include-regexp",
149+
150+
flag := flags.VarPF(
151+
&filterValue{rgb, git.Include, "", true}, "include-regexp", "",
151152
"include references matching the specified regular expression",
152153
)
154+
flag.Hidden = true
155+
flag.Deprecated = "use --include=/REGEXP/"
156+
153157
flags.Var(
154158
&filterValue{rgb, git.Exclude, "", false}, "exclude",
155159
"exclude specified references",
156160
)
157-
flags.Var(
158-
&filterValue{rgb, git.Exclude, "", true}, "exclude-regexp",
161+
162+
flag = flags.VarPF(
163+
&filterValue{rgb, git.Exclude, "", true}, "exclude-regexp", "",
159164
"exclude references matching the specified regular expression",
160165
)
166+
flag.Hidden = true
167+
flag.Deprecated = "use --exclude=/REGEXP/"
161168

162-
flag := flags.VarPF(
169+
flag = flags.VarPF(
163170
&filterValue{rgb, git.Include, "refs/heads", false}, "branches", "",
164171
"process all branches",
165172
)
@@ -223,6 +230,8 @@ func (rgb *RefGroupBuilder) AddRefopts(flags *pflag.FlagSet) {
223230
&filterGroupValue{rgb}, "refgroup", "",
224231
"process references in refgroup defined by gitconfig",
225232
)
233+
flag.Hidden = true
234+
flag.Deprecated = "use --include=@REFGROUP"
226235

227236
flags.BoolVar(&rgb.ShowRefs, "show-refs", false, "list the references being processed")
228237
}

0 commit comments

Comments
 (0)