Dissolve gerrit-server top-level directory

Change-Id: I538512dfe0f1bea774c01fdd45fa410a45634011
This commit is contained in:
David Ostrovsky
2017-09-21 08:37:42 +02:00
committed by Dave Borowitz
parent 472396c797
commit 376a7bbb64
1549 changed files with 342 additions and 335 deletions

View File

@@ -0,0 +1,8 @@
filegroup(
name = "server",
srcs = glob(
["**/*"],
exclude = ["BUILD"],
),
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,13 @@
# Changes to this file should also be made in
# gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeMessages.properties
revertChangeDefaultMessage = Revert \"{0}\"\n\nThis reverts commit {1}.
reviewerCantSeeChange = {0} does not have permission to see this change
reviewerInactive = {0} identifies an inactive account
reviewerInvalid = {0} is not a valid user identifier
reviewerNotFoundUser = {0} does not identify a registered user
reviewerNotFoundUserOrGroup = {0} does not identify a registered user or group
groupIsNotAllowed = The group {0} cannot be added as reviewer.
groupHasTooManyMembers = The group {0} has too many members to add them all as reviewers.
groupManyMembersConfirmation = The group {0} has {1} members. Do you want to add them all as reviewers?

View File

@@ -0,0 +1,21 @@
accessDatabase = Access Database
administrateServer = Administrate Server
batchChangesLimit = Batch Changes Limit
createAccount = Create Account
createGroup = Create Group
createProject = Create Project
emailReviewers = Email Reviewers
flushCaches = Flush Caches
killTask = Kill Task
maintainServer = Maintain Server
modifyAccount = Modify Account
priority = Priority
queryLimit = Query Limit
runAs = Run As
runGC = Run Garbage Collection
streamEvents = Stream Events
viewAllAccounts = View All Accounts
viewCaches = View Caches
viewConnections = View Connections
viewPlugins = View Plugins
viewQueue = View Queue

View File

@@ -0,0 +1,39 @@
body {
margin: 1em;
}
h1, h2, h3, h4, h5, h6 {
color: #527bbd;
font-family: sans-serif;
}
h1, h2, h3 {
border-bottom: 2px solid silver;
}
pre {
border: 2px solid silver;
background: #ebebeb;
margin-left: 2em;
width: 100em;
color: darkgreen;
padding: 2px;
}
dl dt {
margin-top: 1em;
}
table.plugin_info {
border-collapse: separate;
border-spacing: 0;
text-align: left;
margin-left: 2em;
}
table.plugin_info th {
padding-right: 0.5em;
border-right: 2px solid silver;
}
table.plugin_info td {
padding-left: 0.5em;
}

View File

@@ -0,0 +1,39 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* .Abandoned template will determine the contents of the email related to a
* change being abandoned.
* @param change
* @param coverLetter
* @param email
* @param fromName
*/
{template .Abandoned kind="text"}
{$fromName} has abandoned this change.
{if $email.changeUrl} ( {$email.changeUrl} ){/if}{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{if $coverLetter}
{\n}
{\n}
{$coverLetter}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,38 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param coverLetter
* @param email
* @param fromName
*/
{template .AbandonedHtml}
<p>
{$fromName} <strong>abandoned</strong> this change.
</p>
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
{if $coverLetter}
<div style="white-space:pre-wrap">{$coverLetter}</div>
{/if}
{/template}

View File

@@ -0,0 +1,71 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .AddKey template will determine the contents of the email related to
* adding a new SSH or GPG key to an account.
* @param email
*/
{template .AddKey kind="text"}
One or more new {$email.keyType} keys have been added to Gerrit Code Review at
{sp}{$email.gerritHost}:
{\n}
{\n}
{if $email.sshKey}
{$email.sshKey}
{elseif $email.gpgKeys}
{$email.gpgKeys}
{/if}
{\n}
{\n}
If this is not expected, please contact your Gerrit Administrators
immediately.
{\n}
{\n}
You can also manage your {$email.keyType} keys by visiting
{\n}
{if $email.sshKey}
{$email.gerritUrl}#/settings/ssh-keys
{elseif $email.gpgKeys}
{$email.gerritUrl}#/settings/gpg-keys
{/if}
{\n}
{if $email.userNameEmail}
(while signed in as {$email.userNameEmail})
{else}
(while signed in as {$email.email})
{/if}
{\n}
{\n}
If clicking the link above does not work, copy and paste the URL in a new
browser window instead.
{\n}
{\n}
This is a send-only email address. Replies to this message will not be read
or answered.
{/template}

View File

@@ -0,0 +1,66 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param email
*/
{template .AddKeyHtml}
<p>
One or more new {$email.keyType} keys have been added to Gerrit Code Review
at {$email.gerritHost}:
</p>
{let $keyStyle kind="css"}
background: #f0f0f0;
border: 1px solid #ccc;
color: #555;
padding: 12px;
width: 400px;
{/let}
{if $email.sshKey}
<pre style="{$keyStyle}">{$email.sshKey}</pre>
{elseif $email.gpgKeys}
<pre style="{$keyStyle}">{$email.gpgKeys}</pre>
{/if}
<p>
If this is not expected, please contact your Gerrit Administrators
immediately.
</p>
<p>
You can also manage your {$email.keyType} keys by following{sp}
{if $email.sshKey}
<a href="{$email.gerritUrl}#/settings/ssh-keys">this link</a>
{elseif $email.gpgKeys}
<a href="{$email.gerritUrl}#/settings/gpg-keys">this link</a>
{/if}
{sp}
{if $email.userNameEmail}
(while signed in as {$email.userNameEmail})
{else}
(while signed in as {$email.email})
{/if}.
</p>
<p>
This is a send-only email address. Replies to this message will not be read
or answered.
</p>
{/template}

View File

@@ -0,0 +1,40 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .ChangeFooter template will determine the contents of the footer text
* that will be appended to ALL emails related to changes.
* @param email
*/
{template .ChangeFooter kind="text"}
--{sp}
{\n}
{if $email.changeUrl}
To view, visit {$email.changeUrl}{\n}
{/if}
{if $email.settingsUrl}
To unsubscribe, or for help writing mail filters,{sp}
visit {$email.settingsUrl}{\n}
{/if}
{if $email.changeUrl or $email.settingsUrl}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,46 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param change
* @param email
*/
{template .ChangeFooterHtml}
{if $email.changeUrl or $email.settingsUrl}
<p>
{if $email.changeUrl}
To view, visit{sp}
<a href="{$email.changeUrl}">change {$change.changeNumber}</a>.
{/if}
{if $email.changeUrl and $email.settingsUrl}{sp}{/if}
{if $email.settingsUrl}
To unsubscribe, or for help writing mail filters,{sp}
visit <a href="{$email.settingsUrl}">settings</a>.
{/if}
</p>
{/if}
{if $email.changeUrl}
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemscope itemprop="action" itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="{$email.changeUrl}"/>
<meta itemprop="name" content="View Change"/>
</div>
</div>
{/if}
{/template}

View File

@@ -0,0 +1,28 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .ChangeSubject template will determine the contents of the email subject
* line for ALL emails related to changes.
* @param branch
* @param change
* @param shortProjectName
*/
{template .ChangeSubject kind="text"}
Change in {$shortProjectName}[{$branch.shortName}]: {$change.shortSubject}
{/template}

View File

@@ -0,0 +1,76 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .Comment template will determine the contents of the email related to a
* user submitting comments on changes.
* @param change
* @param coverLetter
* @param email
* @param fromName
* @param commentFiles
*/
{template .Comment kind="text"}
{$fromName} has posted comments on this change.
{if $email.changeUrl} ( {$email.changeUrl} ){/if}{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{if $coverLetter}
{\n}
{\n}
{$coverLetter}{\n}
{\n}
{/if}
{foreach $group in $commentFiles}
{$group.link}{\n}
{$group.title}:{\n}
{\n}
{foreach $comment in $group.comments}
{if $comment.isRobotComment}
Robot Comment from {$comment.robotId} (run ID {$comment.robotRunId}):
{\n}
{/if}
{foreach $line in $comment.lines}
{if isFirst($line)}
{if $comment.startLine != 0}
{$comment.link}
{/if}{\n}
{$comment.linePrefix}
{else}
{$comment.linePrefixEmpty}
{/if}
{$line}{\n}
{/foreach}
{if length($comment.lines) == 0}
{$comment.linePrefix}{\n}
{/if}
{if $comment.parentMessage}
>{sp}{$comment.parentMessage}{\n}
{/if}
{$comment.message}{\n}
{\n}
{\n}
{/foreach}
{/foreach}
{\n}
{/template}

View File

@@ -0,0 +1,25 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .CommentFooter template will determine the contents of the footer text
* that will be appended to emails related to a user submitting comments on
* changes.
*/
{template .CommentFooter kind="text"}
{/template}

View File

@@ -0,0 +1,20 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
{template .CommentFooterHtml}
{/template}

View File

@@ -0,0 +1,175 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param commentFiles
* @param commentCount
* @param email
* @param labels
* @param patchSet
* @param patchSetCommentBlocks
*/
{template .CommentHtml}
{let $commentHeaderStyle kind="css"}
margin-bottom: 4px;
{/let}
{let $blockquoteStyle kind="css"}
border-left: 1px solid #aaa;
margin: 10px 0;
padding: 0 10px;
{/let}
{let $ulStyle kind="css"}
list-style: none;
padding: 0;
{/let}
{let $fileLiStyle kind="css"}
margin: 0;
padding: 0;
{/let}
{let $commentLiStyle kind="css"}
margin: 0;
padding: 0 0 0 16px;
{/let}
{let $voteStyle kind="css"}
border-radius: 3px;
display: inline-block;
margin: 0 2px;
padding: 4px;
{/let}
{let $positiveVoteStyle kind="css"}
{$voteStyle}
background-color: #d4ffd4;
{/let}
{let $negativeVoteStyle kind="css"}
{$voteStyle}
background-color: #ffd4d4;
{/let}
{let $neutralVoteStyle kind="css"}
{$voteStyle}
background-color: #ddd;
{/let}
{if $patchSetCommentBlocks}
{call .WikiFormat}{param content: $patchSetCommentBlocks /}{/call}
{/if}
{if length($labels) > 0}
<p>
Patch set {$patchSet.patchSetId}:
{foreach $label in $labels}
{if $label.value > 0}
<span style="{$positiveVoteStyle}">
{$label.label}{sp}+{$label.value}
</span>
{elseif $label.value < 0}
<span style="{$negativeVoteStyle}">
{$label.label}{sp}{$label.value}
</span>
{else}
<span style="{$neutralVoteStyle}">
-{$label.label}
</span>
{/if}
{/foreach}
</p>
{/if}
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
{if $commentCount == 1}
<p>1 comment:</p>
{elseif $commentCount > 1}
<p>{$commentCount} comments:</p>
{/if}
<ul style="{$ulStyle}">
{foreach $group in $commentFiles}
<li style="{$fileLiStyle}">
<p>
<a href="{$group.link}">{$group.title}:</a>
</p>
<ul style="{$ulStyle}">
{foreach $comment in $group.comments}
<li style="{$commentLiStyle}">
{if $comment.isRobotComment}
<p style="{$commentHeaderStyle}">
Robot Comment from{sp}
{if $comment.robotUrl}<a href="{$comment.robotUrl}">{/if}
{$comment.robotId}
{if $comment.robotUrl}</a>{/if}{sp}
(run ID {$comment.robotRunId}):
</p>
{/if}
<p style="{$commentHeaderStyle}">
<a href="{$comment.link}">
{if $comment.startLine == 0}
Patch Set #{$group.patchSetId}:
{else}
Patch Set #{$group.patchSetId},{sp}
Line {$comment.startLine}:
{/if}
</a>{sp}
{if length($comment.lines) == 1}
<code style="font-family:monospace,monospace">
{$comment.lines[0]}
</code>
{/if}
</p>
{if length($comment.lines) > 1}
<p>
<blockquote style="{$blockquoteStyle}">
{call .Pre}{param content kind="html"}
{foreach $line in $comment.lines}
{$line}{\n}
{/foreach}
{/param}{/call}
</blockquote>
</p>
{/if}
{if $comment.parentMessage}
<p>
<blockquote style="{$blockquoteStyle}">
{$comment.parentMessage}
</blockquote>
</p>
{/if}
{call .WikiFormat}{param content: $comment.messageBlocks /}{/call}
</li>
{/foreach}
</ul>
</li>
{/foreach}
</ul>
{/template}

View File

@@ -0,0 +1,44 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .DeleteReviewer template will determine the contents of the email related
* to removal of a reviewer (and the reviewer's votes) from reviews.
* @param change
* @param coverLetter
* @param email
* @param fromName
*/
{template .DeleteReviewer kind="text"}
{$fromName} has removed{sp}
{foreach $reviewerName in $email.reviewerNames}
{if not isFirst($reviewerName)},{sp}{/if}
{$reviewerName}
{/foreach}{sp}
from this change.{sp}
{if $email.changeUrl} ( {$email.changeUrl} ){/if}{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{if $coverLetter}
{\n}
{\n}
{$coverLetter}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,43 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param email
* @param fromName
*/
{template .DeleteReviewerHtml}
<p>
{$fromName}{sp}
<strong>
removed{sp}
{foreach $reviewerName in $email.reviewerNames}
{if not isFirst($reviewerName)}
{if isLast($reviewerName)}{sp}and{else},{/if}{sp}
{/if}
{$reviewerName}
{/foreach}
</strong>{sp}
from this change.
</p>
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
{/template}

View File

@@ -0,0 +1,37 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .DeleteVote template will determine the contents of the email related
* to removing votes on changes.
* @param change
* @param coverLetter
* @param fromName
*/
{template .DeleteVote kind="text"}
{$fromName} has removed a vote on this change.{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{if $coverLetter}
{\n}
{\n}
{$coverLetter}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,38 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param coverLetter
* @param email
* @param fromName
*/
{template .DeleteVoteHtml}
<p>
{$fromName} <strong>removed a vote</strong> from this change.
</p>
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
{if $coverLetter}
<div style="white-space:pre-wrap">{$coverLetter}</div>
{/if}
{/template}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .Footer template will determine the contents of the footer text
* appended to the end of all outgoing emails after the ChangeFooter and
* CommentFooter.
* @param footers
*/
{template .Footer kind="text"}
{foreach $footer in $footers}
{$footer}{\n}
{/foreach}
{/template}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param footers
*/
{template .FooterHtml}
{\n}
{\n}
{foreach $footer in $footers}
<div style="display:none">{sp}{$footer}{sp}</div>{\n}
{/foreach}
{\n}
{/template}

View File

@@ -0,0 +1,20 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
{template .HeaderHtml}
{/template}

View File

@@ -0,0 +1,42 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .Merged template will determine the contents of the email related to
* a change successfully merged to the head.
* @param change
* @param email
* @param fromName
*/
{template .Merged kind="text"}
{$fromName} has submitted this change and it was merged.
{if $email.changeUrl} ( {$email.changeUrl} ){/if}{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{\n}
{$email.changeDetail}
{$email.approvals}
{if $email.includeDiff}
{\n}
{\n}
{$email.unifiedDiff}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,42 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param diffLines
* @param email
* @param fromName
*/
{template .MergedHtml}
<p>
{$fromName} <strong>merged</strong> this change.
</p>
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
<div style="white-space:pre-wrap">{$email.approvals}</div>
{call .Pre}{param content: $email.changeDetail /}{/call}
{if $email.includeDiff}
{call .UnifiedDiff}{param diffLines: $diffLines /}{/call}
{/if}
{/template}

View File

@@ -0,0 +1,81 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .NewChange template will determine the contents of the email related to a
* user submitting a new change for review.
* @param change
* @param email
* @param ownerName
* @param patchSet
* @param projectName
*/
{template .NewChange kind="text"}
{if $email.reviewerNames}
Hello{sp}
{foreach $reviewerName in $email.reviewerNames}
{if not isFirst($reviewerName)},{sp}{/if}
{$reviewerName}
{/foreach},
{\n}
{\n}
I'd like you to do a code review.
{if $email.changeUrl}
{sp}Please visit
{\n}
{\n}
{sp}{sp}{sp}{sp}{$email.changeUrl}
{\n}
{\n}
to review the following change.
{/if}
{else}
{$ownerName} has uploaded this change for review.
{if $email.changeUrl} ( {$email.changeUrl}{/if}
{/if}{\n}
{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{\n}
{$email.changeDetail}{\n}
{if $email.sshHost}
{\n}
{sp}{sp}git pull ssh:{print '//'}{$email.sshHost}/{$projectName}
{sp}{$patchSet.refName}
{\n}
{/if}
{if $email.includeDiff}
{\n}
{$email.unifiedDiff}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,61 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param diffLines
* @param email
* @param fromName
* @param ownerName
* @param patchSet
* @param projectName
*/
{template .NewChangeHtml}
<p>
{if $email.reviewerNames}
{$fromName} would like{sp}
{foreach $reviewerName in $email.reviewerNames}
{if not isFirst($reviewerName)}
{if isLast($reviewerName)}{sp}and{else},{/if}{sp}
{/if}
{$reviewerName}
{/foreach}{sp}
to <strong>review</strong> this change.
{else}
{$ownerName} has uploaded this change for <strong>review</strong>.
{/if}
</p>
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
{call .Pre}{param content: $email.changeDetail /}{/call}
{if $email.sshHost}
{call .Pre}{param content kind="html"}
git pull ssh:{print '//'}{$email.sshHost}/{$projectName}
{sp}{$patchSet.refName}
{/param}{/call}
{/if}
{if $email.includeDiff}
{call .UnifiedDiff}{param diffLines: $diffLines /}{/call}
{/if}
{/template}

View File

@@ -0,0 +1,121 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/*
* Private templates that cannot be overridden.
*/
/**
* Private template to generate "View Change" buttons.
* @param email
*/
{template .ViewChangeButton}
<a href="{$email.changeUrl}">View Change</a>
{/template}
/**
* Private template to render PRE block with consistent font-sizing.
* @param content
*/
{template .Pre}
{let $preStyle kind="css"}
font-family: monospace,monospace; // Use this to avoid browsers scaling down
// monospace text.
white-space: pre-wrap;
{/let}
<pre style="{$preStyle}">{$content|changeNewlineToBr}</pre>
{/template}
/**
* Take a list of unescaped comment blocks and emit safely escaped HTML to
* render it nicely with wiki-like format.
*
* Each block is a map with a type key. When the type is 'paragraph', or 'pre',
* it also has a 'text' key that maps to the unescaped text content for the
* block. If the type is 'list', the map will have a 'items' key which maps to
* list of unescaped list item strings. If the type is quote, the map will have
* a 'quotedBlocks' key which maps to the blocks contained within the quote.
*
* This mechanism encodes as little structure as possible in order to depend on
* the Soy autoescape mechanism for all of the content.
*
* @param content
*/
{template .WikiFormat}
{let $blockquoteStyle kind="css"}
border-left: 1px solid #aaa;
margin: 10px 0;
padding: 0 10px;
{/let}
{let $pStyle kind="css"}
white-space: pre-wrap;
word-wrap: break-word;
{/let}
{foreach $block in $content}
{if $block.type == 'paragraph'}
<p style="{$pStyle}">{$block.text|changeNewlineToBr}</p>
{elseif $block.type == 'quote'}
<blockquote style="{$blockquoteStyle}">
{call .WikiFormat}{param content: $block.quotedBlocks /}{/call}
</blockquote>
{elseif $block.type == 'pre'}
{call .Pre}{param content: $block.text /}{/call}
{elseif $block.type == 'list'}
<ul>
{foreach $item in $block.items}
<li>{$item}</li>
{/foreach}
</ul>
{/if}
{/foreach}
{/template}
/**
* @param diffLines
*/
{template .UnifiedDiff}
{let $addStyle kind="css"}
color: hsl(120, 100%, 40%);
{/let}
{let $removeStyle kind="css"}
color: hsl(0, 100%, 40%);
{/let}
{let $preStyle kind="css"}
font-family: monospace,monospace; // Use this to avoid browsers scaling down
// monospace text.
white-space: pre-wrap;
{/let}
<pre style="{$preStyle}">
{foreach $line in $diffLines}
{if $line.type == 'add'}
<span style="{$addStyle}">
{elseif $line.type == 'remove'}
<span style="{$removeStyle}">
{else}
<span>
{/if}
{$line.text}
</span><br>
{/foreach}
</pre>
{/template}

View File

@@ -0,0 +1,54 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .RegisterNewEmail template will determine the contents of the email
* related to registering new email accounts.
* @param email
*/
{template .RegisterNewEmail kind="text"}
Welcome to Gerrit Code Review at {$email.gerritHost}.{\n}
{\n}
To add a verified email address to your user account, please{\n}
click on the following link
{if $email.userNameEmail}
{sp}while signed in as {$email.userNameEmail}
{/if}:{\n}
{\n}
{$email.gerritUrl}#/VE/{$email.emailRegistrationToken}{\n}
{\n}
If you have received this mail in error, you do not need to take any{\n}
action to cancel the account. The address will not be activated, and{\n}
you will not receive any further emails.{\n}
{\n}
If clicking the link above does not work, copy and paste the URL in a{\n}
new browser window instead.{\n}
{\n}
This is a send-only email address. Replies to this message will not{\n}
be read or answered.{\n}
{/template}

View File

@@ -0,0 +1,63 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .ReplacePatchSet template will determine the contents of the email
* related to a user submitting a new patchset for a change.
* @param change
* @param email
* @param fromEmail
* @param fromName
* @param patchSet
* @param projectName
*/
{template .ReplacePatchSet kind="text"}
{if $email.reviewerNames and $fromEmail == $change.ownerEmail}
Hello{sp}
{foreach $reviewerName in $email.reviewerNames}
{$reviewerName},{sp}
{/foreach}{\n}
{\n}
I'd like you to reexamine a change.
{if $email.changeUrl}
{sp}Please visit
{\n}
{\n}
{sp}{sp}{sp}{sp}{$email.changeUrl}
{\n}
{\n}
to look at the new patch set (#{$patchSet.patchSetId}).
{/if}
{else}
{$fromName} has uploaded a new patch set (#{$patchSet.patchSetId})
{if $fromEmail != $change.ownerEmail}
{sp}to the change originally created by {$change.ownerName}
{/if}.
{if $email.changeUrl} ( {$email.changeUrl} ){/if}
{/if}{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{\n}
{$email.changeDetail}{\n}
{if $email.sshHost}
{sp}{sp}git pull ssh:{print '//'}{$email.sshHost}/{$projectName}{sp}
{$patchSet.refName}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,52 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param change
* @param email
* @param fromName
* @param fromEmail
* @param patchSet
* @param projectName
*/
{template .ReplacePatchSetHtml}
<p>
{$fromName} <strong>uploaded patch set #{$patchSet.patchSetId}</strong>{sp}
to{sp}
{if $fromEmail == $change.ownerEmail}
this change.
{else}
the change originally created by {$change.ownerName}.
{/if}
</p>
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
{call .Pre}{param content: $email.changeDetail /}{/call}
{if $email.sshHost}
{call .Pre}{param content kind="html"}
git pull ssh:{print '//'}{$email.sshHost}/{$projectName}{sp}
{$patchSet.refName}
{/param}{/call}
{/if}
{/template}

View File

@@ -0,0 +1,39 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .Restored template will determine the contents of the email related to a
* change being restored.
* @param change
* @param coverLetter
* @param email
* @param fromName
*/
{template .Restored kind="text"}
{$fromName} has restored this change.
{if $email.changeUrl} ( {$email.changeUrl} ){/if}{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{if $coverLetter}
{\n}
{\n}
{$coverLetter}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,33 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param email
* @param fromName
*/
{template .RestoredHtml}
<p>
{$fromName} <strong>restored</strong> this change.
</p>
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
{/template}

View File

@@ -0,0 +1,39 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .Reverted template will determine the contents of the email related
* to a change being reverted.
* @param change
* @param coverLetter
* @param email
* @param fromName
*/
{template .Reverted kind="text"}
{$fromName} has reverted this change.
{if $email.changeUrl} ( {$email.changeUrl} ){/if}{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{if $coverLetter}
{\n}
{\n}
{$coverLetter}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,33 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param email
* @param fromName
*/
{template .RevertedHtml}
<p>
{$fromName} <strong>reverted</strong> this change.
</p>
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
{/template}

View File

@@ -0,0 +1,71 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* The .SetAssignee template will determine the contents of the email related
* to a user being assigned to a change.
* @param change
* @param email
* @param fromName
* @param patchSet
* @param projectName
*/
{template .SetAssignee kind="text"}
Hello{sp}
{$email.assigneeName},
{\n}
{\n}
{$fromName} has assigned a change to you.
{sp}Please visit
{\n}
{\n}
{sp}{sp}{sp}{sp}{$email.changeUrl}
{\n}
{\n}
to view the change.
{\n}
{\n}
Change subject: {$change.subject}{\n}
......................................................................{\n}
{\n}
{$email.changeDetail}{\n}
{if $email.sshHost}
{\n}
{sp}{sp}git pull ssh:{print '//'}{$email.sshHost}/{$projectName}
{sp}{$patchSet.refName}
{\n}
{/if}
{if $email.includeDiff}
{\n}
{$email.unifiedDiff}
{\n}
{/if}
{/template}

View File

@@ -0,0 +1,50 @@
/**
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace com.google.gerrit.server.mail.template}
/**
* @param diffLines
* @param email
* @param fromName
* @param patchSet
* @param projectName
*/
{template .SetAssigneeHtml}
<p>
{$fromName} has <strong>assigned</strong> a change to{sp}
{$email.assigneeName}.{sp}
</p>
{if $email.changeUrl}
<p>
{call .ViewChangeButton data="all" /}
</p>
{/if}
{call .Pre}{param content: $email.changeDetail /}{/call}
{if $email.sshHost}
{call .Pre}{param content kind="html"}
git pull ssh:{print '//'}{$email.sshHost}/{$projectName}
{sp}{$patchSet.refName}
{/param}{/call}
{/if}
{if $email.includeDiff}
{call .UnifiedDiff}{param diffLines: $diffLines /}{/call}
{/if}
{/template}

View File

@@ -0,0 +1,255 @@
apl = text/apl
as = text/x-gas
asn = text/x-ttcn-asn
asn1 = text/x-ttcn-asn
asp = application/x-aspx
aspx = application/x-aspx
asterisk = text/x-asterisk
b = text/x-brainfuck
bash = text/x-sh
bf = text/x-brainfuck
bnf = text/x-ebnf
bucklet = text/x-python
bzl = text/x-python
BUCK = text/x-python
BUILD = text/x-python
c = text/x-csrc
cfg = text/x-ttcn-cfg
cl = text/x-common-lisp
clj = text/x-clojure
cljs = text/x-clojurescript
cmake = text/x-cmake
cmake.in = text/x-cmake
contributing.md = text/x-gfm
CMakeLists.txt = text/x-cmake
CONTRIBUTING.md = text/x-gfm
cob = text/x-cobol
coffee = text/x-coffeescript
conf = text/plain
config = text/x-ini
cpy = text/x-cobol
cr = text/x-crystal
cs = text/x-csharp
csharp = text/x-csharp
css = text/css
cpp = text/x-c++src
cql = text/x-cassandra
cxx = text/x-c++src
cyp = application/x-cypher-query
cypher = application/x-cypher-query
c++ = text/x-c++src
d = text/x-d
dart = application/dart
def = text/plain
defs = text/x-python
diff = text/x-diff
django = text/x-django
dtd = application/xml-dtd
dyalog = text/apl
dyl = text/x-dylan
dylan = text/x-dylan
Dockerfile = text/x-dockerfile
dtd = application/xml-dtd
e = text/x-eiffel
ebnf = text/x-ebnf
ecl = text/x-ecl
el = text/x-common-lisp
elm = text/x-elm
ejs = application/x-ejs
erb = application/x-erb
erl = text/x-erlang
es6 = text/jsx
excel = text/x-spreadsheet
extensions.conf = text/x-asterisk
f = text/x-fortran
factor = text/x-factor
feathre = text/x-feature
fcl = text/x-fcl
for = text/x-fortran
formula = text/x-spreadsheet
forth = text/x-forth
fth = text/x-forth
frag = x-shader/x-fragment
fs = text/x-fsharp
fsharp = text/x-fsharp
f77 = text/x-fortran
f90 = text/x-fortran
gitmodules = text/x-ini
glsl = x-shader/x-vertex
go = text/x-go
gradle = text/x-groovy
gradlew = text/x-sh
groovy = text/x-groovy
gss = text/x-gss
h = text/x-csrc
haml = text/x-haml
hh = text/x-c++src
history.md = text/x-gfm
hpp = text/x-c++src
hs = text/x-haskell
htm = text/html
html = text/html
http = message/http
hx = text/x-haxe
hxml = text/x-hxml
hxx = text/x-c++src
h++ = text/x-c++src
HISTORY.md = text/x-gfm
in = text/x-properties
ini = text/x-properties
intr = text/x-dylan
jade = text/x-pug
java = text/x-java
jl = text/x-julia
jruby = text/x-ruby
js = text/javascript
json = application/json
jsonld = application/ld+json
jsx = text/jsx
jsp = application/x-jsp
kt = text/x-kotlin
less = text/x-less
lhs = text/x-literate-haskell
lisp = text/x-common-lisp
list = text/plain
log = text/plain
ls = text/x-livescript
lsp = text/x-common-lisp
lua = text/x-lua
m = text/x-objectivec
macruby = text/x-ruby
map = application/json
markdown = text/x-markdown
mbox = application/mbox
md = text/x-markdown
mirc = text/mirc
mkd = text/x-markdown
ml = text/x-ocaml
mli = text/x-ocaml
mll = text/x-ocaml
mly = text/x-ocaml
mm = text/x-objectivec
mo = text/x-modelica
mps = text/x-mumps
msc = text/x-mscgen
mscgen = text/x-mscgen
mscin = text/x-mscgen
msgenny = text/x-msgenny
nb = text/x-mathematica
nginx.conf = text/x-nginx-conf
nsh = text/x-nsis
nsi = text/x-nsis
nt = text/n-triples
nut = text/x-squirrel
oz = text/x-oz
p = text/x-pascal
pas = text/x-pascal
patch = text/x-diff
pgp = application/pgp
php = text/x-php
php3 = text/x-php
php4 = text/x-php
php5 = text/x-php
phtml = text/x-php
pig = text/x-pig
pl = text/x-perl
pls = text/x-plsql
pm = text/x-perl
pp = text/x-puppet
pro = text/x-idl
properties = text/x-ini
proto = text/x-protobuf
protobuf = text/x-protobuf
ps1 = application/x-powershell
psd1 = application/x-powershell
psm1 = application/x-powershell
pug = text/x-pug
py = text/x-python
pyw = text/x-python
pyx = text/x-cython
pxd = text/x-cython
pxi = text/x-cython
PKGBUILD = text/x-sh
q = text/x-q
r = text/r-src
rake = text/x-ruby
rb = text/x-ruby
rbx = text/x-ruby
readme.md = text/x-gfm
rng = application/xml
rpm = text/x-rpm-changes
rq = application/sparql-query
rs = text/x-rustsrc
rss = application/xml
rst = text/x-rst
README.md = text/x-gfm
s = text/x-gas
sas = text/x-sas
sass = text/x-sass
scala = text/x-scala
scm = text/x-scheme
scss = text/x-scss
sh = text/x-sh
sieve = application/sieve
siv = application/sieve
slim = text/x-slim
solr = text/x-solr
soy = text/x-soy
sparql = application/sparql-query
sparul = applicatoin/sparql-query
spec = text/x-rpm-spec
spreadsheet = text/x-spreadsheet
sql = text/x-sql
ss = text/x-scheme
st = text/x-stsrc
stex = text/x-stex
swift = text/x-swift
tcl = text/x-tcl
tex = text/x-latex
text = text/plain
textile = text/x-textile
tiddly = text/x-tiddlywiki
tiddlywiki = text/x-tiddlywiki
tiki = text/tiki
toml = text/x-toml
tpl = text/x-smarty
ts = application/typescript
ttcn = text/x-ttcn
ttcnpp = text/x-ttcn
ttcn3 = text/x-ttcn
ttl = text/turtle
txt = text/plain
twig = text/x-twig
v = text/x-verilog
vb = text/x-vb
vbs = text/vbscript
vert = x-shader/x-vertex
vh = text/x-verilog
vhd = text/x-vhdl
vhdl = text/x-vhdl
vm = text/velocity
vtl = text/velocity
webidl = text/x-webidl
wsdl = application/xml
xhtml = text/html
xml = application/xml
xsd = application/xml
xsl = application/xml
xquery = application/xquery
xu = text/x-xu
xy = application/xquery
yaml = text/x-yaml
yml = text/x-yaml
ys = text/x-yacas
zsh = text/x-sh
z80 = text/x-z80
1 = text/troff
2 = text/troff
3 = text/troff
4 = text/troff
4th = text/x-forth
5 = text/troff
6 = text/troff
7 = text/troff
8 = text/troff
9 = text/troff

View File

@@ -0,0 +1,8 @@
# Format of this file is:
# mode <SPACE> fullpath
#
755 bin/gerrit-cherry-pick
755 hooks/commit-msg
755 scripts/reposize.sh

View File

@@ -0,0 +1,208 @@
#!/bin/sh
#
# Part of Gerrit Code Review (https://www.gerritcodereview.com/)
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
usage() {
echo >&2 "usage: $0 remote changeid..."
echo >&2 "usage: $0 --continue"
echo >&2 "usage: $0 --skip"
echo >&2 "usage: $0 --abort"
echo >&2 "usage: $0 [--close|--replace] remote"
exit 1
}
die() {
echo >&2 "fatal: $1"
exit 1
}
GIT_DIR=$(git rev-parse --git-dir) || exit
CL="$GIT_DIR/GERRIT_CHANGES"
STATE="$GIT_DIR/rebase-gerrit"
TODO="$STATE/todo"
RESOLVEMSG="
When you have resolved this problem run \"$0 --continue\".
If you would prefer to skip this patch, run \"$0 --skip\".
"
pop_action() {
sed -e 1d <"$TODO" >>"$TODO".new
mv -f "$TODO".new "$TODO"
}
mark_done() {
read commit changeid <"$TODO"
changeid=$(get_changeid "$changeid")
head_after=$(git rev-parse HEAD^0)
head_before=$(cat "$STATE/head_before")
if ! test $head_after = $head_before
then
echo $head_after >"$CL/$changeid"
fi
pop_action
}
do_next() {
while test -s "$TODO"
do
read commit changeid <"$TODO"
git rev-parse HEAD^0 >"$STATE/head_before"
git format-patch \
-k --stdout --full-index --ignore-if-in-upstream \
$commit^..$commit |
git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" || exit
mark_done
done
echo >&2 "Done."
rm -rf "$STATE"
}
git_am_opt=
if test -f "$STATE/git_am_opt"
then
git_am_opt=$(cat "$STATE/git_am_opt")
fi
while test $# != 0
do
case "$1" in
--continue)
test -f "$TODO" || die "No cherry-pick in progress?"
git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" --resolved || exit
mark_done
do_next
exit
;;
--skip)
test -f "$TODO" || die "No cherry-pick in progress?"
git reset --hard HEAD || exit
git am --skip || exit
pop_action
do_next
exit
;;
--abort)
test -f "$TODO" || die "No cherry-pick in progress?"
git reset --hard HEAD
git am --skip
rm -rf "$STATE"
;;
--close|--replace)
shift
test -d "$CL" || die "No changes to close"
test $# = 1 || usage
remote=$1
printf %s "git push $remote" >&2
rs=$(cd "$CL" && for change_id in *; do
test "$change_id" = '*' && die "No changes to close"
c=$(cat "$change_id");
echo "$c:refs/changes/$change_id";
echo ' \' >&2;
printf %s " $c:refs/changes/$change_id" >&2
done)
echo >&2
echo >&2
git push $remote $rs
rc=$?
test $rc = 0 && rm -rf "$CL"
exit $rc
;;
--whitespace=*)
git_am_opt="$git_am_opt $1"
;;
--committer-date-is-author-date|--ignore-date)
git_am_opt="$git_am_opt $1"
;;
-C*)
git_am_opt="$git_am_opt $1"
;;
-s|--signoff)
git_am_opt="$git_am_opt $1"
;;
-*)
usage
;;
*)
break
;;
esac
shift
done
get_changeid() {
case $1 in
*/*) echo ${1%%/*} ;;
*) echo $1 ;;
esac
}
to_ref() {
case $1 in
*/*)
change_id=${1%%/*}
patchset_id=${1##*/}
;;
*)
change_id=$1
patchset_id=1
;;
esac
hash=$(($change_id % 100))
case $hash in
[0-9]) hash="0$hash" ;;
esac
echo "refs/changes/$hash/$change_id/$patchset_id"
}
get_revid() {
grep $(to_ref $1) <"$GIT_DIR/FETCH_HEAD" | cut -f1
}
# Initialize state
#
test $# -lt 2 && usage
remote="$1"
shift
mkdir "$STATE" || die "cherry-pick already in progress"
echo $git_am_opt >"$STATE/git_am_opt"
if ! git fetch $remote $(for id; do to_ref $id; done)
then
rm -rf $STATE
exit 1
fi
(for id
do
if revid=$(get_revid $id)
then
echo "$revid $id"
else
echo >&2 "fatal: $id not found"
exit 1
fi
done) >"$TODO"
mkdir -p "$CL"
echo >&2
do_next

View File

@@ -0,0 +1,190 @@
#!/bin/sh
#
# Part of Gerrit Code Review (https://www.gerritcodereview.com/)
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
unset GREP_OPTIONS
CHANGE_ID_AFTER="Bug|Depends-On|Issue|Test|Feature|Fixes|Fixed"
MSG="$1"
# Check for, and add if missing, a unique Change-Id
#
add_ChangeId() {
clean_message=`sed -e '
/^diff --git .*/{
s///
q
}
/^Signed-off-by:/d
/^#/d
' "$MSG" | git stripspace`
if test -z "$clean_message"
then
return
fi
# Do not add Change-Id to temp commits
if echo "$clean_message" | head -1 | grep -q '^\(fixup\|squash\)!'
then
return
fi
if test "false" = "`git config --bool --get gerrit.createChangeId`"
then
return
fi
# Does Change-Id: already exist? if so, exit (no change).
if grep -i '^Change-Id:' "$MSG" >/dev/null
then
return
fi
id=`_gen_ChangeId`
T="$MSG.tmp.$$"
AWK=awk
if [ -x /usr/xpg4/bin/awk ]; then
# Solaris AWK is just too broken
AWK=/usr/xpg4/bin/awk
fi
# Get core.commentChar from git config or use default symbol
commentChar=`git config --get core.commentChar`
commentChar=${commentChar:-#}
# How this works:
# - parse the commit message as (textLine+ blankLine*)*
# - assume textLine+ to be a footer until proven otherwise
# - exception: the first block is not footer (as it is the title)
# - read textLine+ into a variable
# - then count blankLines
# - once the next textLine appears, print textLine+ blankLine* as these
# aren't footer
# - in END, the last textLine+ block is available for footer parsing
$AWK '
BEGIN {
# while we start with the assumption that textLine+
# is a footer, the first block is not.
isFooter = 0
footerComment = 0
blankLines = 0
}
# Skip lines starting with commentChar without any spaces before it.
/^'"$commentChar"'/ { next }
# Skip the line starting with the diff command and everything after it,
# up to the end of the file, assuming it is only patch data.
# If more than one line before the diff was empty, strip all but one.
/^diff --git / {
blankLines = 0
while (getline) { }
next
}
# Count blank lines outside footer comments
/^$/ && (footerComment == 0) {
blankLines++
next
}
# Catch footer comment
/^\[[a-zA-Z0-9-]+:/ && (isFooter == 1) {
footerComment = 1
}
/]$/ && (footerComment == 1) {
footerComment = 2
}
# We have a non-blank line after blank lines. Handle this.
(blankLines > 0) {
print lines
for (i = 0; i < blankLines; i++) {
print ""
}
lines = ""
blankLines = 0
isFooter = 1
footerComment = 0
}
# Detect that the current block is not the footer
(footerComment == 0) && (!/^\[?[a-zA-Z0-9-]+:/ || /^[a-zA-Z0-9-]+:\/\//) {
isFooter = 0
}
{
# We need this information about the current last comment line
if (footerComment == 2) {
footerComment = 0
}
if (lines != "") {
lines = lines "\n";
}
lines = lines $0
}
# Footer handling:
# If the last block is considered a footer, splice in the Change-Id at the
# right place.
# Look for the right place to inject Change-Id by considering
# CHANGE_ID_AFTER. Keys listed in it (case insensitive) come first,
# then Change-Id, then everything else (eg. Signed-off-by:).
#
# Otherwise just print the last block, a new line and the Change-Id as a
# block of its own.
END {
unprinted = 1
if (isFooter == 0) {
print lines "\n"
lines = ""
}
changeIdAfter = "^(" tolower("'"$CHANGE_ID_AFTER"'") "):"
numlines = split(lines, footer, "\n")
for (line = 1; line <= numlines; line++) {
if (unprinted && match(tolower(footer[line]), changeIdAfter) != 1) {
unprinted = 0
print "Change-Id: I'"$id"'"
}
print footer[line]
}
if (unprinted) {
print "Change-Id: I'"$id"'"
}
}' "$MSG" > "$T" && mv "$T" "$MSG" || rm -f "$T"
}
_gen_ChangeIdInput() {
echo "tree `git write-tree`"
if parent=`git rev-parse "HEAD^0" 2>/dev/null`
then
echo "parent $parent"
fi
echo "author `git var GIT_AUTHOR_IDENT`"
echo "committer `git var GIT_COMMITTER_IDENT`"
echo
printf '%s' "$clean_message"
}
_gen_ChangeId() {
_gen_ChangeIdInput |
git hash-object -t commit --stdin
}
add_ChangeId

View File

@@ -0,0 +1,88 @@
#!/usr/bin/env bash
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# A sceleton script to demonstrate how to use the preview_submit REST API call.
#
#
if test -z $server
then
echo "The variable 'server' needs to point to your Gerrit instance"
exit 1
fi
if test -z $changeId
then
echo "The variable 'changeId' must contain a valid change Id"
exit 1
fi
if test -z $gerrituser
then
echo "The variable 'gerrituser' must contain a user/password"
exit 1
fi
curl -u $gerrituser -w '%{http_code}' -o preview \
$server/a/changes/$changeId/revisions/current/preview_submit?format=tgz >http_code
if ! grep 200 http_code >/dev/null
then
# error out:
echo "Error previewing submit $changeId due to:"
cat preview
echo
else
# valid tgz file, extract and obtain a bundle for each project
mkdir tmp-bundles
(cd tmp-bundles && tar -zxf ../preview)
for project in $(cd tmp-bundles && find -type f)
do
# Projects may contain slashes, so create the required
# directory structure
mkdir -p $(dirname $project)
# $project is in the format of "./path/name/project.git"
# remove the leading ./
proj=${project:-./}
git clone $server/$proj $proj
# First some nice output:
echo "Verify that the bundle is good:"
GIT_WORK_TREE=$proj GIT_DIR=$proj/.git \
git bundle verify tmp-bundles/$proj
echo "Checking that the bundle only contains one branch..."
if test \
"$(GIT_WORK_TREE=$proj GIT_DIR=$proj/.git \
git bundle list-heads tmp-bundles/$proj |wc -l)" != 1
then
echo "Submitting $changeId would affect the project"
echo "$proj"
echo "on multiple branches:"
git bundle list-heads
echo "This script does not demonstrate this use case."
exit 1
fi
# find the target branch:
branch=$(GIT_WORK_TREE=$proj GIT_DIR=$proj/.git \
git bundle list-heads tmp-bundles/$proj | awk '{print $2}')
echo "found branch $branch"
echo "fetch the bundle into the repository"
GIT_WORK_TREE=$proj GIT_DIR=$proj/.git \
git fetch tmp-bundles/$proj $branch
echo "and checkout the state"
git -C $proj checkout FETCH_HEAD
done
echo "Now run a test for all of: $(cd tmp-bundles && find -type f)"
fi

View File

@@ -0,0 +1,73 @@
#!/usr/bin/env bash
#
# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Show n largest objects in a git repo's pack files.
#
# usage:
# $ reposize.sh 100 # find and list biggest 100 objects
#
# derived from
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
if [ ! $# == 1 ]; then
echo "
Usage: $0 <number of biggest objects to show>
if there are loose objects the script will run 'git gc' to move all data to packs
"
exit
fi
# find git repository directory
gitdir=$(git rev-parse --git-dir 2>.error.log)
if [ $? -ne 0 ]; then
echo $(cat .error.log)
rm .error.log
exit
fi
rm .error.log
object_count=$(git count-objects -v | grep count: | cut -f 2 -d ' ')
if [ $object_count -gt 1 ]; then
echo "-------------------------------------------------------"
echo "$object_count loose objects found in repository $gitdir"
echo "-> running git gc to move all data to packs"
git gc
echo "-------------------------------------------------------"
fi
# set the internal field separator to line break, so that we can iterate easily over the verify-pack output
IFS=$'\n';
# list all objects including their size, sort by size, take top $1 biggest blobs
objects=$(git verify-pack -v $gitdir/objects/pack/pack-*.idx | grep -v chain | sort -k3nr | head -n $1)
echo "All sizes are in kiB's. The pack column is the size of the object, compressed, inside the pack file."
output="size,pack,SHA,location"
for y in $objects
do
# extract the size in bytes
size=$(($(echo $y | cut -f 5 -d ' ') / 1024))
# extract the compressed size in bytes
compressedSize=$(($(echo $y | cut -f 6 -d ' ') / 1024))
# extract the SHA
sha=$(echo $y | cut -f 1 -d ' ')
# find the objects location in the repository tree
other=$(git rev-list --all --objects | grep $sha)
output="${output}\n${size},${compressedSize},${other}"
done
echo -e $output | column -t -s ', '