Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
2113b100
H
hub
项目概览
github
/
hub
11 个月 前同步成功
通知
3
Star
22523
Fork
2406
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2113b100
编写于
10月 20, 2014
作者:
M
Mislav Marohnić
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #645 from github/base-head-upstream
Fix git commit summary in pull request message template
上级
922fee68
0ada3c47
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
72 addition
and
7 deletion
+72
-7
commands/issue.go
commands/issue.go
+1
-1
commands/pull_request.go
commands/pull_request.go
+15
-1
commands/pull_request_tpl.go
commands/pull_request_tpl.go
+3
-3
commands/pull_request_tpl_test.go
commands/pull_request_tpl_test.go
+1
-1
commands/release.go
commands/release.go
+1
-1
features/pull_request.feature
features/pull_request.feature
+43
-0
features/steps.rb
features/steps.rb
+8
-0
未找到文件。
commands/issue.go
浏览文件 @
2113b100
...
...
@@ -95,7 +95,7 @@ func writeIssueTitleAndBody(project *github.Project) (string, string, error) {
# Creating issue for %s.
#
# Write a message for this issue. The first block
# of t
he t
ext is the title and the rest is description.
# of text is the title and the rest is description.
`
message
=
fmt
.
Sprintf
(
message
,
project
.
Name
)
...
...
commands/pull_request.go
浏览文件 @
2113b100
...
...
@@ -156,9 +156,23 @@ func pullRequest(cmd *Command, args *Args) {
}
}
baseTracking
:=
base
headTracking
:=
head
remote
:=
gitRemoteForProject
(
baseProject
)
if
remote
!=
nil
{
baseTracking
=
remote
.
Name
+
"/"
+
base
}
if
remote
==
nil
||
!
baseProject
.
SameAs
(
headProject
)
{
remote
=
gitRemoteForProject
(
headProject
)
}
if
remote
!=
nil
{
headTracking
=
remote
.
Name
+
"/"
+
head
}
var
editor
*
github
.
Editor
if
title
==
""
&&
flagPullRequestIssue
==
""
{
message
,
err
:=
pullRequestChangesMessage
(
base
,
head
,
fullBase
,
fullHead
)
message
,
err
:=
pullRequestChangesMessage
(
base
Tracking
,
headTracking
,
fullBase
,
fullHead
)
utils
.
Check
(
err
)
editor
,
err
=
github
.
NewEditor
(
"PULLREQ"
,
"pull request"
,
message
)
...
...
commands/pull_request_tpl.go
浏览文件 @
2113b100
...
...
@@ -8,12 +8,12 @@ import (
"strings"
)
const
pullRequestTmpl
=
`{{if .InitMsg}}{{.InitMsg}}
{{end}}
const
pullRequestTmpl
=
`{{if .InitMsg}}{{.InitMsg}}
{{end}}
{{.CS}} Requesting a pull to {{.Base}} from {{.Head}}
{{.CS}}
{{.CS}} Write a message for this pull request. The first block
{{.CS}} of t
he t
ext is the title and the rest is description.{{if .HasCommitLogs}}
{{.CS}} of text is the title and the rest is description.{{if .HasCommitLogs}}
{{.CS}}
{{.CS}} Changes:
{{.CS}}{{if .HasCommitLogs}}
...
...
commands/pull_request_tpl_test.go
浏览文件 @
2113b100
...
...
@@ -15,7 +15,7 @@ func TestRenderPullRequestTpl(t *testing.T) {
# Requesting a pull to base from head
#
# Write a message for this pull request. The first block
# of t
he t
ext is the title and the rest is description.
# of text is the title and the rest is description.
#
# Changes:
#
...
...
commands/release.go
浏览文件 @
2113b100
...
...
@@ -125,7 +125,7 @@ func writeReleaseTitleAndBody(project *github.Project, tag, currentBranch string
# Creating release %s for %s from %s
#
# Write a message for this release. The first block
# of t
he t
ext is the title and the rest is description.
# of text is the title and the rest is description.
`
message
=
fmt
.
Sprintf
(
message
,
tag
,
project
.
Name
,
currentBranch
)
...
...
features/pull_request.feature
浏览文件 @
2113b100
...
...
@@ -89,6 +89,49 @@ Feature: hub pull-request
When
I successfully run `hub pull-request`
Then the output should contain exactly "the
:
//url\n"
Scenario
:
Message template should include git log summary between base and head
Given the text editor adds
:
"""
Hello
"""
Given the GitHub API server
:
"""
post('/repos/mislav/coral/pulls') {
status 500
}
"""
Given
I am on the
"master"
branch
And
I make a commit with message
"One on master"
And
I make a commit with message
"Two on master"
And
the
"master"
branch is pushed to
"origin/master"
Given
I successfully run `git reset --hard HEAD~2`
And
I successfully run `git checkout --quiet -B topic origin/master`
Given
I make a commit with message
"One on topic"
And
I make a commit with message
"Two on topic"
Given
the
"topic"
branch is pushed to
"origin/topic"
And
I successfully run `git reset --hard HEAD~1`
When
I run `hub pull-request`
Given
the SHAs and timestamps are normalized in
".git/PULLREQ_EDITMSG"
Then the file ".git/PULLREQ_EDITMSG" should contain exactly
:
"""
Hello
# Requesting a pull to mislav:master from mislav:topic
#
# Write a message for this pull request. The first block
# of text is the title and the rest is description.
#
# Changes:
#
# SHA1SHA (Hub, 0 seconds ago)
# Two on topic
#
# SHA1SHA (Hub, 0 seconds ago)
# One on topic
"""
Scenario
:
Non-existing base
Given the GitHub API server
:
"""
...
...
features/steps.rb
浏览文件 @
2113b100
...
...
@@ -249,3 +249,11 @@ Given(/^the SSH config:$/) do |config_lines|
FileUtils
.
mkdir_p
(
File
.
dirname
(
ssh_config
))
File
.
open
(
ssh_config
,
'w'
)
{
|
f
|
f
<<
config_lines
}
end
Given
(
/^the SHAs and timestamps are normalized in "([^"]+)"$/
)
do
|
file
|
in_current_dir
do
contents
=
File
.
read
(
file
)
contents
.
gsub!
(
/[0-9a-f]{7} \(Hub, \d seconds? ago\)/
,
"SHA1SHA (Hub, 0 seconds ago)"
)
File
.
open
(
file
,
"w"
)
{
|
f
|
f
.
write
(
contents
)
}
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录