Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
010a92da
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
010a92da
编写于
7月 05, 2016
作者:
W
William Raiford
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Load commit.template working.
上级
13ff0573
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
8 deletion
+23
-8
src/vs/workbench/parts/git/common/git.ts
src/vs/workbench/parts/git/common/git.ts
+11
-2
src/vs/workbench/parts/git/node/git.lib.ts
src/vs/workbench/parts/git/node/git.lib.ts
+4
-1
src/vs/workbench/parts/git/node/rawGitService.ts
src/vs/workbench/parts/git/node/rawGitService.ts
+8
-5
未找到文件。
src/vs/workbench/parts/git/common/git.ts
浏览文件 @
010a92da
...
...
@@ -270,12 +270,21 @@ export interface IPushOptions {
setUpstream
?:
boolean
;
}
/** These are `git log` options. */
/**
* These are `git log` options.
* The use case driving this is getting the previous commit message, message only.
* @example prevCount: 1, format: '%B' executes `git log -1 --format=%B`
* */
export
interface
ILogOptions
{
/**
* @example `git log -1
` to get the last commit log
* @example `git log -1
--format=%B` to get the last commit log, message only
*/
prevCount
?:
number
;
/**
* @example format: "%B" translates to `git log --format=%B` to get the message only
*/
format
?:
string
;
}
export
interface
IRawGitService
{
...
...
src/vs/workbench/parts/git/node/git.lib.ts
浏览文件 @
010a92da
...
...
@@ -562,7 +562,10 @@ export class Repository {
console
.
log
(
'
repository.getLog
'
);
const
args
=
[
'
log
'
];
if
(
options
&&
options
.
prevCount
)
{
args
.
push
(
`-
${
options
.
prevCount
}
`
);
}
if
(
options
)
{
if
(
options
.
prevCount
)
{
args
.
push
(
`-
${
options
.
prevCount
}
`
);
}
if
(
options
.
format
)
{
args
.
push
(
`--format=
${
options
.
format
}
`
);
}
}
return
this
.
run
(
args
,
{
log
:
false
}).
then
(
result
=>
{
console
.
log
(
`Repository.getLog=>result:
${
result
.
stdout
.
trim
()}
`
);
...
...
src/vs/workbench/parts/git/node/rawGitService.ts
浏览文件 @
010a92da
...
...
@@ -204,13 +204,13 @@ export class RawGitService implements IRawGitService {
console
.
log
(
`getCommitInfo.config err=>
${
err
.
message
}
`
);
return
""
;
}),
this
.
repo
.
getLog
({
prevCount
:
1
}).
then
(
log
=>
log
,
err
=>
""
),
this
.
repo
.
getLog
({
prevCount
:
1
,
format
:
'
%B
'
}).
then
(
log
=>
log
,
err
=>
""
),
this
.
status
()
]).
then
(
r
=>
{
console
.
log
(
'
RawGitService.getCommitInfo=>Promise.join
'
);
let
status
=
<
IRawStatus
>
r
[
2
];
status
.
commitInfo
=
{
template
:
r
[
0
]
?
this
.
tryReadFile
(
r
[
0
].
stdout
)
:
""
,
template
:
r
[
0
]
?
this
.
tryReadFile
(
r
[
0
].
stdout
.
trim
()
)
:
""
,
// template: r[0] ? r[0].stdout : "",
prevCommitMsg
:
r
[
1
]
};
...
...
@@ -224,11 +224,14 @@ export class RawGitService implements IRawGitService {
*/
private
tryReadFile
(
file
:
string
):
string
{
try
{
if
(
!
fs
.
existsSync
(
file
))
{
console
.
log
(
`file doesnt exist. file:
${
file
}
`
)
}
// Check the file itself
// if (!fs.existsSync(file)) {
// console.log(`file doesnt exist. file: ${file}`)
// }
return
fs
.
existsSync
(
file
)
?
fs
.
readFileSync
(
file
,
'
utf8
'
)
:
""
;
}
catch
(
error
)
{
console
.
error
(
`Error reading file. file:
${
file
}
, error:
${
error
.
message
}
)`
);
return
""
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录