Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
d26eab09
Commit
d26eab09
authored
Dec 23, 2009
by
Robert Ricci
Browse files
Add a -T option that lets you test on a branch other than master
Fix a problem with the -h flag - I was forgetting to exit()
parent
1c8d87dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/git/gitmail
View file @
d26eab09
...
...
@@ -54,15 +54,19 @@ my $testmode = undef;
# we want to be able to turn on debugging early
#
my
%opt
;
if
(
!
GetOptions
(
\
%opt
,
'
d
',
'
h
',
'
t
')
||
@ARGV
||
$opt
{
h
})
{
if
(
!
GetOptions
(
\
%opt
,
'
d
',
'
h
',
'
t
'
,
'
T=s
'
)
||
@ARGV
||
$opt
{
h
})
{
print
STDERR
"
Usage: gitmail [-h|-d]
\n
";
print
STDERR
"
-h this message
\n
";
print
STDERR
"
-d enable debugging output and don't send mail
\n
";
print
STDERR
"
-t test mode - operate on last 3 commits to master
\n
";
print
STDERR
"
-T br Like '-t', but use branch 'br' instead of master
\n
";
exit
1
;
}
my
$testbranch
=
"
master
";
if
(
$opt
{
d
})
{
$debug
=
1
;
}
if
(
$opt
{
t
})
{
$testmode
=
1
;
}
if
(
$opt
{
T
})
{
$testmode
=
1
;
$testbranch
=
$opt
{
T
}
}
#
# Name of this repository - set it to a string to get it included in the
...
...
@@ -184,7 +188,7 @@ if ($testmode) {
#
# Provide a simple way to grab some commits - the three most recent ones
#
@reflines
=
(
'
master~2 master refs/heads/master
'
);
@reflines
=
(
"
$testbranch
~2
$testbranch
refs/heads/
$testbranch
"
);
}
else
{
#
# Get all of the references that are being pushed from stdin - we do this in
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment