开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 0

hwj/cloudstack

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (177)
标签 (157)
master
4.13
usage-post-install-make-up-your-mind
smoke-tests-master
4.13.0.0-RC20190828T1958
4.12
4.11
DaanHoogland-patch-2
4.11.3.0-RC20190610T1559
andrijapanicsb-patch-1
andrijapanicsb-patch-2
reimplement3303on4.12
remove_dump_snapshot
41120-memory
4.11.2.0
4.11.2.0-RC20181113T0924
4.11.2.0-RC20181112T1340
4.11.2.0-RC20181030T1040
4.11.2.0-RC20181017T1751
4.11.2.0-RC20180926T2141
4.13.0.0
4.11.3.0
4.12.0.0
4.11.2.0
4.11.1
4.11.1.0
4.9.3.1
4.11.0.0
4.9.3.0
4.10.0.0
4.9.2.0
4.9.1.0
4.8.2.0
4.5.2.2
4.9.0.1
4.8.1.1
4.8.1
4.9.0
4.8.0.1
4.7.1.1
master
分支 (177)
标签 (157)
master
4.13
usage-post-install-make-up-your-mind
smoke-tests-master
4.13.0.0-RC20190828T1958
4.12
4.11
DaanHoogland-patch-2
4.11.3.0-RC20190610T1559
andrijapanicsb-patch-1
andrijapanicsb-patch-2
reimplement3303on4.12
remove_dump_snapshot
41120-memory
4.11.2.0
4.11.2.0-RC20181113T0924
4.11.2.0-RC20181112T1340
4.11.2.0-RC20181030T1040
4.11.2.0-RC20181017T1751
4.11.2.0-RC20180926T2141
4.13.0.0
4.11.3.0
4.12.0.0
4.11.2.0
4.11.1
4.11.1.0
4.9.3.1
4.11.0.0
4.9.3.0
4.10.0.0
4.9.2.0
4.9.1.0
4.8.2.0
4.5.2.2
4.9.0.1
4.8.1.1
4.8.1
4.9.0
4.8.0.1
4.7.1.1
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (177)
标签 (157)
master
4.13
usage-post-install-make-up-your-mind
smoke-tests-master
4.13.0.0-RC20190828T1958
4.12
4.11
DaanHoogland-patch-2
4.11.3.0-RC20190610T1559
andrijapanicsb-patch-1
andrijapanicsb-patch-2
reimplement3303on4.12
remove_dump_snapshot
41120-memory
4.11.2.0
4.11.2.0-RC20181113T0924
4.11.2.0-RC20181112T1340
4.11.2.0-RC20181030T1040
4.11.2.0-RC20181017T1751
4.11.2.0-RC20180926T2141
4.13.0.0
4.11.3.0
4.12.0.0
4.11.2.0
4.11.1
4.11.1.0
4.9.3.1
4.11.0.0
4.9.3.0
4.10.0.0
4.9.2.0
4.9.1.0
4.8.2.0
4.5.2.2
4.9.0.1
4.8.1.1
4.8.1
4.9.0
4.8.0.1
4.7.1.1
cloudstack
/
tools
/
git
/
git-pr
cloudstack
/
tools
/
git
/
git-pr
git-pr 8.64 KB
一键复制 编辑 原始数据 按行查看 历史
Remi Bergsma 提交于 2015年12月12日 18:00 +08:00 . Show actual diff in commits after merge
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
# Should we clean-up?
cleanup=1
clean_up_and_exit() {
if [ "${cleanup}" -eq 1 ]; then
echo
git branch -D pr/${prId} >/dev/null 2>&1
rm ${jsonTmp} ${tmpMessageFile} >/dev/null 2>&1
fi
exit 1ドル
}
# Arguments
argument=1ドル
prId=${argument}
force=0
if [[ "${2}" == "--force" ]]; then
force=1
fi
# Some of us got used to a git pr alias that you had to feed with the PR url
# Let's make this script backwards compatible with the previous one.
if [[ ${argument} =~ https://github.com.* ]]; then
prId=$(echo "${argument}" | awk -F/ {'print 7ドル'})
echo "INFO: Found PR id ${prId} from url"
fi
# Check the arguments
if [ -z ${prId} ]; then
echo "Usage: git pr pool-request-number [ --force ]"
echo "Works for any Apache repository mirrored on GitHub'"
echo "For instructions, see: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61311655"
clean_up_and_exit 1
fi
# Vars we need
jsonTmp="${PWD}/${prId}.json"
tmpMessageFile="${PWD}/.git-tmp-message.txt"
repoName=$(basename `git rev-parse --show-toplevel`)
# We need UTF-8 to support the GitHub '...' 3-dots-in-1-char, for example.
export LANG="en_EN.UTF-8"
if [ "${prId}" -eq "${prId}" 2>/dev/null ]; then
# Get json data from Github API
curl -s https://api.github.com/repos/apache/${repoName}/pulls/${prId} > ${jsonTmp}
else
echo "ERROR: Pull-request id must be an integer, not '${prId}'"
clean_up_and_exit 1
fi
# Get vars from the GitHub API and parse the returned json
prAuthor=$(cat ${jsonTmp} | python -c "
try:
import sys, json
print json.load(sys.stdin)['user']['login'].encode('utf-8').decode('ascii','ignore')
except:
print ''
")
prTitle=$(cat ${jsonTmp} | python -c "
try:
import sys, json
print json.load(sys.stdin)['title'].encode('utf-8').decode('ascii','ignore')
except:
print ''
")
prBody=$(cat ${jsonTmp} | python -c "
try:
import sys, json
print json.load(sys.stdin)['body'].encode('utf-8').decode('ascii','ignore')
except:
print ''
")
prOriginBranch=$(cat ${jsonTmp} | python -c "
try:
import sys, json
print json.load(sys.stdin)['head']['label'].encode('utf-8').decode('ascii','ignore')
except:
print ''
" | sed -e "s/:/\//")
prState=$(cat ${jsonTmp} | python -c "
try:
import sys, json
print json.load(sys.stdin)['state'].encode('utf-8').decode('ascii','ignore')
except:
print 'Unknown'
")
prMergeableState=$(cat ${jsonTmp} | python -c "
try:
import sys, json
print json.load(sys.stdin)['mergeable_state'].encode('utf-8').decode('ascii','ignore')
except:
print 'Unknown'
")
prDestinationBranch=$(cat ${jsonTmp} | python -c "
try:
import sys, json
print json.load(sys.stdin)['base']['ref'].encode('utf-8').decode('ascii','ignore')
except:
print 'Unknown'
")
prCommits=$(cat ${jsonTmp} | python -c "
try:
import sys, json
print json.load(sys.stdin)['commits']
except:
print 'Unknown'
")
# Do some sanity checking
if [ ${#prAuthor} -eq 0 ]; then
echo "ERROR: We couldn't grab the PR author. Something went wrong querying the GitHub API."
clean_up_and_exit 1
fi
if [ ${#prTitle} -eq 0 ]; then
echo "ERROR: We couldn't grab the PR title. Something went wrong querying the GitHub API."
clean_up_and_exit 1
fi
if [ ${#prOriginBranch} -eq 0 ]; then
echo "ERROR: We couldn't grab the PR branch name. Something went wrong querying the GitHub API."
clean_up_and_exit 1
fi
currentBranch=$(git branch | grep "^*" | sed -e "s/^[*] //")
if [ "${prDestinationBranch}" != "${currentBranch}" ] && [ ${force} -lt 1 ]; then
echo "ERROR: This PR is made against branch '${prDestinationBranch}' while your current checked out branch is '${currentBranch}'."
echo "ERROR: Please make sure you're in the right branch and run this scipt again."
clean_up_and_exit 1
elif [ "${prDestinationBranch}" != "${currentBranch}" ] && [ ${force} -eq 1 ]; then
echo "WARNING: You used --force to merge to '${currentBranch}' while this PR is for branch '${prDestinationBranch}'."
fi
if [ "${prState}" != "open" ] && [ ${force} -lt 1 ]; then
echo "ERROR: We couldn't merge the PR because the state is not 'open' but '${prState}'."
echo "ERROR: In general it's a bad idea to merge closed PRs!"
echo "ERROR: Run this script again with --force if you know what you're doing"
echo "ERROR: (continuing work on an abandoned PR in which case you'd merge to a branch in your fork"
echo "ERROR: and send that as a new PR). Ask for help on @dev if unsure."
clean_up_and_exit 1
elif [ "${prState}" != "open" ] &&[ ${force} -eq 1 ]; then
echo "WARNING: You used --force to merge a PR with state '${prState}'."
fi
if [ "${prMergeableState}" != "clean" ] && [ ${force} -lt 1 ]; then
echo "ERROR: We couldn't merge the PR because it cannot be merged 'clean' (GitHub reports '${prMergeableState}')."
echo "ERROR: This can be caused by a Travis build in progress, a failed Travis build or an unclean merge (conflicts)"
echo "ERROR: Run this script again with --force if you know what you're doing. Ask for help on @dev if unsure."
clean_up_and_exit 1
elif [ "${prMergeableState}" != "clean" ] && [ ${force} -eq 1 ]; then
echo "WARNING: You used --force to merge a PR with non-clean merge state '${prMergeableState}'."
fi
github_remote=$(git remote -v | grep -E "apache/${repoName}(.git)?" | head -n 1 | cut -f1)
apache_remote=$(git remote -v | grep -E "git-wip-us\.apache\.org" | head -n 1 | cut -f1)
if [ ${#github_remote} -eq 0 ]; then
echo "ERROR: We couldn't find a git remote pointing to 'apache/${repoName}.git' to merge the PR from."
echo "INFO: Currently, your configured remotes are:"
echo "INFO: ***********************************************************************************"
git remote -v
echo "INFO: ***********************************************************************************"
echo "INFO: To merge a PR, we need access to two remotes: "
echo "INFO: 1. Read-only access to GitHub mirror"
echo "INFO: 2. Read/write access to Apache git"
echo "INFO: Please add a remote like this: 'git remote add github https://github.com/apache/${repoName}.git'"
echo "INFO: For more help, visit: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61311655"
echo "INFO: Once done, run this script again."
clean_up_and_exit 1
fi
echo "INFO: Using remote repository '${github_remote}' to fetch PR (should point to github.com/apache/${repoName}.git)"
echo "INFO: PR #${prId} against branch '${prDestinationBranch}' from '${prAuthor}': '${prTitle}'"
echo "INFO: has state '${prState}' and mergable state '${prMergeableState}', about to be merged in branch '${currentBranch}'."
# Construct commit merge message
echo "Merge pull request #${prId} from ${prOriginBranch}" > ${tmpMessageFile}
echo "" >> ${tmpMessageFile}
echo "${prTitle}${prBody}" >> ${tmpMessageFile}
# Are you sure?
echo "ATTENTION: Merging pull request #${prId} from ${prOriginBranch} into '${currentBranch}' branch in 5 seconds. CTRL+c to abort.."
sec=5
while [ $sec -ge 0 ]; do
printf "${sec} "
sec=$((sec-1))
sleep 1
done
echo
echo "INFO: Executing the merge now.. Git output below:"
echo "INFO: ***********************************************************************************"
# Do the actual merge
git fetch ${github_remote} pull/${prId}/head:pr/${prId}
git merge --no-ff --log -m "$(cat ${tmpMessageFile})" pr/${prId}
if [ $? -eq 0 ]; then
git commit --amend -s --allow-empty-message -m ''
else
echo "ERROR: Merge failed, aborting."
git merge --abort
clean_up_and_exit 1
fi
# What's next
echo "INFO: ***********************************************************************************"
echo "INFO: Merged successfully! Please double check using 'git log -p' and 'git push' when you're sure."
echo "INFO: About commits: there should be ${prCommits} from the PR plus 1 merge commit."
echo "INFO: Actual diff in commits is: (running git log --pretty=oneline --abbrev-commit ${apache_remote}/${currentBranch}..${currentBranch})"
echo
git log --pretty=oneline --abbrev-commit ${apache_remote}/${currentBranch}..${currentBranch}
clean_up_and_exit 0
Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

Apache Cloudstack
暂无标签
Apache-2.0
使用 Apache-2.0 开源许可协议
, Apache-2.0
使用 Apache-2.0 开源许可协议
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/smallbug/cloudstack.git
git@gitee.com:smallbug/cloudstack.git
smallbug
cloudstack
cloudstack
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /