mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Git - 💄 more history provider logging (#205101)
* Git - 💄 more history provider logging
* Fix up more logging
This commit is contained in:
@@ -83,7 +83,7 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
this._HEAD?.upstream?.name !== this.repository.HEAD?.upstream?.name ||
|
||||
this._HEAD?.upstream?.remote !== this.repository.HEAD?.upstream?.remote ||
|
||||
this._HEAD?.upstream?.commit !== this.repository.HEAD?.upstream?.commit) {
|
||||
this.logger.trace('GitHistoryProvider:onDidRunGitStatus - Upstream has changed');
|
||||
this.logger.trace(`GitHistoryProvider:onDidRunGitStatus - Upstream has changed (${force})`);
|
||||
this._onDidChangeCurrentHistoryItemGroupBase.fire();
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
if (!historyItemId2) {
|
||||
const upstreamRef = await this.resolveHistoryItemGroupBase(historyItemId1);
|
||||
if (!upstreamRef) {
|
||||
this.logger.info(`GitHistoryProvider:resolveHistoryItemGroupCommonAncestor - Failed to resolve history item group base for '${historyItemId1}'`);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -184,14 +185,16 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
|
||||
const ancestor = await this.repository.getMergeBase(historyItemId1, historyItemId2);
|
||||
if (!ancestor) {
|
||||
this.logger.info(`GitHistoryProvider:resolveHistoryItemGroupCommonAncestor - Failed to resolve common ancestor for '${historyItemId1}' and '${historyItemId2}'`);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
const commitCount = await this.repository.getCommitCount(`${historyItemId1}...${historyItemId2}`);
|
||||
this.logger.trace(`GitHistoryProvider:resolveHistoryItemGroupCommonAncestor - Resolved common ancestor for '${historyItemId1}' and '${historyItemId2}': ${JSON.stringify({ id: ancestor, ahead: commitCount.ahead, behind: commitCount.behind })}`);
|
||||
return { id: ancestor, ahead: commitCount.ahead, behind: commitCount.behind };
|
||||
} catch (err) {
|
||||
this.logger.error(`Failed to get ahead/behind for '${historyItemId1}...${historyItemId2}': ${err.message}`);
|
||||
this.logger.error(`GitHistoryProvider:resolveHistoryItemGroupCommonAncestor - Failed to get ahead/behind for '${historyItemId1}...${historyItemId2}': ${err.message}`);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
@@ -212,6 +215,7 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
// Base (config -> reflog -> default)
|
||||
const remoteBranch = await this.repository.getBranchBase(historyItemId);
|
||||
if (!remoteBranch?.remote || !remoteBranch?.name || !remoteBranch?.commit || remoteBranch?.type !== RefType.RemoteHead) {
|
||||
this.logger.info(`GitHistoryProvider:resolveHistoryItemGroupBase - Failed to resolve history item group base for '${historyItemId}'`);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -222,7 +226,7 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
||||
};
|
||||
}
|
||||
catch (err) {
|
||||
this.logger.error(`Failed to get branch base for '${historyItemId}': ${err.message}`);
|
||||
this.logger.error(`GitHistoryProvider:resolveHistoryItemGroupBase - Failed to get branch base for '${historyItemId}': ${err.message}`);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user