Skip to content
GitLab
Menu
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
7c5c1af0
Commit
7c5c1af0
authored
Oct 30, 2014
by
Leigh B Stoller
Browse files
If we cannot determine the user from the email, post the comment as a
pseudo user and prepend the From address on the email to comment
parent
3683d611
Changes
1
Show whitespace changes
Inline
Side-by-side
tools/git/email2issue
View file @
7c5c1af0
...
@@ -46,7 +46,9 @@ my $optlist = "vc:";
...
@@ -46,7 +46,9 @@ my $optlist = "vc:";
my
$verbose
=
0
;
my
$verbose
=
0
;
my
$configfile
=
undef
;
my
$configfile
=
undef
;
my
$EMAIL
=
"
trac_reply
\@
something
";
# Use this user if we cannot find a mapping for the email address
# of the user making the comment.
my
$STUBUSER
=
"
comments
";
# URL used to make gitlab API calls
# URL used to make gitlab API calls
my
$BASEURL
=
"
https://gitlab.flux.utah.edu/
";
my
$BASEURL
=
"
https://gitlab.flux.utah.edu/
";
...
@@ -185,8 +187,17 @@ fatal(-1, "No such issue: $issueiid")
...
@@ -185,8 +187,17 @@ fatal(-1, "No such issue: $issueiid")
if
(
$issueid
<
0
);
if
(
$issueid
<
0
);
my
$userid
=
GetUserID
(
$user_name
,
$user_host
);
my
$userid
=
GetUserID
(
$user_name
,
$user_host
);
fatal
(
-
1
,
"
Cannot find user for:
$user_email
")
if
(
$userid
<
0
)
{
$userid
=
GetUserID
(
$STUBUSER
,
"
localhost
");
fatal
(
-
1
,
"
Cannot find user for:
$user_email
")
if
(
$userid
<
0
);
if
(
$userid
<
0
);
#
# If we have to use the STUB user, then prepend the actual email
# to the comment.
#
$comment
=
"
*** Comment made by
"
.
$headers
->
{"
From
"}[
0
]
.
"
\n\n
"
.
$comment
;
}
fatal
(
$EX_SOFTWARE
,
"
Could not add comment to issue
$issueid
")
fatal
(
$EX_SOFTWARE
,
"
Could not add comment to issue
$issueid
")
if
(
AddComment
(
$projectid
,
$issueid
,
$userid
,
$comment
)
!=
0
);
if
(
AddComment
(
$projectid
,
$issueid
,
$userid
,
$comment
)
!=
0
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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