Skip to content

Add Git log, globalConfig, and tree diff API#64826

Merged
joaomoreno merged 2 commits intomicrosoft:masterfrom
IlyaBiryukov:dev/ilbiryuk/gitLogApi
Jan 28, 2019
Merged

Add Git log, globalConfig, and tree diff API#64826
joaomoreno merged 2 commits intomicrosoft:masterfrom
IlyaBiryukov:dev/ilbiryuk/gitLogApi

Conversation

@IlyaBiryukov
Copy link

Fix for #62609,
cc @joaomoreno

@joaomoreno joaomoreno added this to the December 2018 milestone Dec 12, 2018
@IlyaBiryukov
Copy link
Author

The test failures doesn't look to have anything to do with my changes.

});
}

async getLog(options?: GitLogOptions): Promise<Commit[]> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call this log instead.

I would prefer if there's a default maxEntries option instead of leaving it unbounded.

return [];
}

const entries = gitResult.stdout.split('\x00\x00');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will get expensive. We should instead do a while regex exec loop and keep matching commits until we reach the end of gitResult.stdout.

}

async diffWithHEAD(path: string): Promise<string> {
async diffWithHEAD(path?: string): Promise<string | Change[]> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move those cool overloads also here?

 	diffWithHEAD(): Promise<Change[]>;
 	diffWithHEAD(path: string): Promise<string>;
 	diffWithHEAD(path?: string | undefined): Promise<string | Change[]> {

@joaomoreno
Copy link
Member

ping @IlyaBiryukov

@joaomoreno joaomoreno merged commit 04c3dde into microsoft:master Jan 28, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants