Skip to content

Commit

Permalink
Reworks git commands a bit to reduce rethrows
Browse files Browse the repository at this point in the history
Fixes #405 - stops non-repo from showing up in explorer
  • Loading branch information
eamodio committed Sep 7, 2018
1 parent fad3243 commit d552090
Show file tree
Hide file tree
Showing 12 changed files with 225 additions and 209 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### Fixed

- Fixes [#405](https://github.com/eamodio/vscode-gitlens/issues/405) - Secondary, blank repository appears repeatedly in gitExplorer view
- Fixes issues with git log caching

### Removed
Expand Down
3 changes: 1 addition & 2 deletions src/annotations/gutterBlameAnnotationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
}
}

const duration = process.hrtime(start);
Logger.log(`${duration[0] * 1000 + Math.floor(duration[1] / 1000000)} ms to compute gutter blame annotations`);
Logger.log(`${Strings.getDurationMilliseconds(start)} ms to compute gutter blame annotations`);

this.registerHoverProviders(Container.config.hovers.annotations);
void this.selection(shaOrLine, blame);
Expand Down
4 changes: 2 additions & 2 deletions src/annotations/heatmapBlameAnnotationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { FileAnnotationType } from '../configuration';
import { Container } from '../container';
import { GitBlameCommit } from '../gitService';
import { Logger } from '../logger';
import { Strings } from '../system';
import { Annotations } from './annotations';
import { BlameAnnotationProviderBase } from './blameAnnotationProvider';

Expand Down Expand Up @@ -55,8 +56,7 @@ export class HeatmapBlameAnnotationProvider extends BlameAnnotationProviderBase
this.editor.setDecorations(this.decoration!, this.decorations);
}

const duration = process.hrtime(start);
Logger.log(`${duration[0] * 1000 + Math.floor(duration[1] / 1000000)} ms to compute heatmap annotations`);
Logger.log(`${Strings.getDurationMilliseconds(start)} ms to compute heatmap annotations`);

this.registerHoverProviders(Container.config.hovers.annotations);
void this.selection(shaOrLine, blame);
Expand Down
6 changes: 2 additions & 4 deletions src/annotations/recentChangesAnnotationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { FileAnnotationType } from '../configuration';
import { Container } from '../container';
import { GitUri } from '../gitService';
import { Logger } from '../logger';
import { Strings } from '../system';
import { GitDocumentState, TrackedDocument } from '../trackers/gitDocumentTracker';
import { AnnotationProviderBase } from './annotationProvider';
import { Annotations } from './annotations';
Expand Down Expand Up @@ -82,10 +83,7 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase {

this.editor.setDecorations(this.decoration, this.decorations);

const duration = process.hrtime(start);
Logger.log(
`${duration[0] * 1000 + Math.floor(duration[1] / 1000000)} ms to compute recent changes annotations`
);
Logger.log(`${Strings.getDurationMilliseconds(start)} ms to compute recent changes annotations`);

return true;
}
Expand Down
7 changes: 3 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import {
KeyMap,
OutputLevel
} from './configuration';
import { CommandContext, extensionQualifiedId, GlobalState, setCommandContext } from './constants';
import { CommandContext, extensionQualifiedId, GlobalState, GlyphChars, setCommandContext } from './constants';
import { Container } from './container';
import { GitService } from './gitService';
import { Logger } from './logger';
import { Messages } from './messages';
import { Versions } from './system';
import { Strings, Versions } from './system';
// import { Telemetry } from './telemetry';

export async function activate(context: ExtensionContext) {
Expand Down Expand Up @@ -83,8 +83,7 @@ export async function activate(context: ExtensionContext) {
// Constantly over my data cap so stop collecting initialized event
// Telemetry.trackEvent('initialized', Objects.flatten(cfg, 'config', true));

const duration = process.hrtime(start);
Logger.log(`GitLens(v${gitlensVersion}) activated in ${duration[0] * 1000 + Math.floor(duration[1] / 1000000)} ms`);
Logger.log(`GitLens(v${gitlensVersion}) activated ${GlyphChars.Dot} ${Strings.getDurationMilliseconds(start)} ms`);
}

export function deactivate() {}
Expand Down
Loading

0 comments on commit d552090

Please sign in to comment.