浏览代码

Fixes #257 - commits w/o summaries cause issues

main
Eric Amodio 6 年前
父节点
当前提交
10c345d1f1
共有 4 个文件被更改,包括 48 次插入4 次删除
  1. +4
    -0
      CHANGELOG.md
  2. +32
    -2
      src/git/git.ts
  3. +6
    -1
      src/git/parsers/logParser.ts
  4. +6
    -1
      src/git/parsers/stashParser.ts

+ 4
- 0
CHANGELOG.md 查看文件

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Fixed
- Fixes [#257](https://github.com/eamodio/vscode-gitlens/issues/257) - Some branches fail to show history
## [7.5.6] - 2018-01-22
### Changed
- Changes `chorded` keymap on Windows to use `Ctrl+Shift+G` rather than `Ctrl+Alt+G` to avoid [issues](https://blogs.msdn.microsoft.com/oldnewthing/20040329-00/?p=40003)

+ 32
- 2
src/git/git.ts 查看文件

@ -23,9 +23,39 @@ export * from './remotes/provider';
let git: IGit;
const defaultBlameParams = ['blame', '--root', '--incremental'];
// Using %x00 codes because some shells seem to try to expand things if not
const defaultLogParams = ['log', '--name-status', '--full-history', '-M', '--format=%x3c%x2ff%x3e%n%x3cr%x3e %H%n%x3ca%x3e %an%n%x3ce%x3e %ae%n%x3cd%x3e %at%n%x3cp%x3e %P%n%x3cs%x3e%n%B%x3c%x2fs%x3e%n%x3cf%x3e'];
const defaultStashParams = ['stash', 'list', '--name-status', '--full-history', '-M', '--format=%x3c%x2ff%x3e%n%x3cr%x3e %H%n%x3cd%x3e %at%n%x3cl%x3e %gd%n%x3cs%x3e%n%B%x3c%x2fs%x3e%n%x3cf%x3e'];
const lb = '%x3c'; // `%x${'<'.charCodeAt(0).toString(16)}`;
const rb = '%x3e'; // `%x${'>'.charCodeAt(0).toString(16)}`;
const sl = '%x2f'; // `%x${'/'.charCodeAt(0).toString(16)}`;
const logFormat = [
`${lb}${sl}f${rb}`,
`${lb}r${rb} %H`, // ref
`${lb}a${rb} %an`, // author
`${lb}e${rb} %ae`, // email
`${lb}d${rb} %at`, // date
`${lb}p${rb} %P`, // parents
`${lb}s${rb}`,
`%B`, // summary
`${lb}${sl}s${rb}`,
`${lb}f${rb}`
].join('%n');
const defaultLogParams = ['log', '--name-status', '--full-history', '-M', `--format=${logFormat}`];
const stashFormat = [
`${lb}${sl}f${rb}`,
`${lb}r${rb} %H`, // ref
`${lb}d${rb} %at`, // date
`${lb}l${rb} %gd`, // reflog-selector
`${lb}s${rb}`,
`%B`, // summary
`${lb}${sl}s${rb}`,
`${lb}f${rb}`
].join('%n');
const defaultStashParams = ['stash', 'list', '--name-status', '--full-history', '-M', `--format=${stashFormat}`];
const GitWarnings = [
/Not a git repository/,

+ 6
- 1
src/git/parsers/logParser.ts 查看文件

@ -106,6 +106,11 @@ export class GitLogParser {
entry.summary += `\n${line}`;
}
}
if (entry.summary !== undefined) {
// Remove the trailing newline
entry.summary = entry.summary.slice(0, -1);
}
break;
case 102: // 'f': // files
@ -223,7 +228,7 @@ export class GitLogParser {
entry.author!,
entry.email,
new Date(entry.date! as any * 1000),
entry.summary!,
entry.summary === undefined ? '' : entry.summary,
relativeFileName,
entry.fileStatuses || [],
entry.status,

+ 6
- 1
src/git/parsers/stashParser.ts 查看文件

@ -72,6 +72,11 @@ export class GitStashParser {
entry.summary += `\n${line}`;
}
}
if (entry.summary !== undefined) {
// Remove the trailing newline
entry.summary = entry.summary.slice(0, -1);
}
break;
case 102: // 'f': // files
@ -127,7 +132,7 @@ export class GitStashParser {
repoPath,
entry.ref!,
new Date(entry.date! as any * 1000),
entry.summary!,
entry.summary === undefined ? '' : entry.summary,
entry.fileNames!,
entry.fileStatuses || []
);

正在加载...
取消
保存