Skip to content

Commit

Permalink
[engine] git.worker.ts에 새로운 git format 적용
Browse files Browse the repository at this point in the history
[engine] git.worker.ts에 새로운 git format 적용
  • Loading branch information
BeA-Pro authored Oct 7, 2024
2 parents 7b7ff09 + 4488e5d commit e9ad183
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ export async function activate(context: vscode.ExtensionContext) {

const fetchBranches = async () => await getBranches(gitPath, currentWorkspacePath);

// const gitLog = await fetchGitLogInParallel(gitPath, currentWorkspacePath);
const gitLog = await getGitLog(gitPath, currentWorkspacePath);
const gitLog = await fetchGitLogInParallel(gitPath, currentWorkspacePath);

const fetchCurrentBranch = async () => {
let branchName;
Expand Down
2 changes: 2 additions & 0 deletions packages/vscode/src/utils/git.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ if (totalCnt > taskThreshold) {
currentWorkspacePath,
skipCount,
limitCount,
COMMIT_SEPARATOR,
GIT_LOG_SEPARATOR
},
});

Expand Down
23 changes: 21 additions & 2 deletions packages/vscode/src/utils/git.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,36 @@ import { parentPort, workerData } from 'worker_threads';

import { resolveSpawnOutput } from './git.util'

const { gitPath, currentWorkspacePath, skipCount, limitCount } = workerData;
const { gitPath, currentWorkspacePath, skipCount, limitCount,COMMIT_SEPARATOR,GIT_LOG_SEPARATOR } = workerData;




async function getPartialGitLog() {
const gitLogFormat =
COMMIT_SEPARATOR +
[
"%H", // commit hash (id)
"%P", // parent hashes
"%D", // ref names (branches, tags)
"%an", // author name
"%ae", // author email
"%ad", // author date
"%cn",
"%ce",
"%cd", // committer name, committer email and committer date
"%B", // commit message (subject and body)
].join(GIT_LOG_SEPARATOR) +
GIT_LOG_SEPARATOR;

const args = [
'--no-pager',
'log',
'--all',
'--parents',
'--numstat',
'--date-order',
'--pretty=fuller',
`--pretty=format:${gitLogFormat}`,
'--decorate',
'-c',
`--skip=${skipCount}`,
Expand Down

0 comments on commit e9ad183

Please sign in to comment.