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
dacfc0a7
Commit
dacfc0a7
authored
Mar 22, 2010
by
Ryan Jackson
Browse files
Distinguish tags from branches when sending out emails
Also allow tags to be passed in with the -T option.
parent
8a573f01
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/git/gitmail
View file @
dacfc0a7
...
...
@@ -255,7 +255,7 @@ if ($testmode) {
#
# Provide a simple way to grab some commits - the three most recent ones
#
@reflines
=
("
$testbranch
~2
$testbranch
refs/heads/
$testbranch
");
@reflines
=
("
$testbranch
~2
$testbranch
$testbranch
");
}
else
{
#
# Get all of the references that are being pushed from stdin - we do this in
...
...
@@ -584,10 +584,18 @@ sub commit_mail($\@$@) {
# and what branch it happened on
#
my
$subject
=
"
git commit:
";
my
$ref_type
;
if
(
defined
(
$reponame
))
{
$subject
.=
"
[
$reponame
]
";
}
$subject
.=
"
branch
"
.
short_refname
(
$refname
);
if
(
$refname
=~
m#refs/tags/#
)
{
$ref_type
=
'
tag
';
}
elsif
(
$refname
=~
m#refs/heads/#
)
{
$ref_type
=
'
branch
';
}
$subject
.=
$ref_type
.
'
'
.
short_refname
(
$refname
);
if
(
$ct
eq
$CT_UPDATE
)
{
$subject
.=
"
updated
";
...
...
@@ -599,7 +607,7 @@ sub commit_mail($\@$@) {
$subject
.=
"
deleted
";
}
my
$actionstring
=
"
Branch
"
.
short_refname
(
$refname
)
.
my
$actionstring
=
ucfirst
(
$ref_type
)
.
'
'
.
short_refname
(
$refname
)
.
"
has been
${ct}
d
\n\n
";
if
(
$ct
eq
$CT_FORCED_UPDATE
)
{
...
...
@@ -670,6 +678,14 @@ sub get_commits($$$) {
return
@revs
;
}
elsif
(
$ct
eq
$CT_CREATE
)
{
#
# For tags, just return the new revision. This at least tells us
# where the tag points.
#
if
(
$refname
=~
m#^refs/tags/#
)
{
return
(
$newrev
);
}
#
# If it's a create, we have to be a bit more fancy: we look for all
# commits reachable from the new branch, but *not* reachable from any
...
...
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