Skip to content

Commit

Permalink
Make git path configurable
Browse files Browse the repository at this point in the history
closes #90
  • Loading branch information
phil294 committed Apr 15, 2024
1 parent 1b74535 commit 96d3208
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,13 @@ Please consider opening an issue or PR if you think a certain action or option w
"git-log--graph.custom-css": {
"description": "An abitrary string of CSS that will be injected into the main web view. Example: * { text-transform: uppercase; }",
"type": "string",
"default": "",
"default": ""
},
"git-log--graph.git-path": {
"description": "Absolute path to the git executable. If not set, it is expected to be on your $PATH.",
"type": "string",
"default": ""
},
}
```

Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@
"type": "string",
"default": ""
},
"git-log--graph.git-path": {
"description": "Absolute path to the git executable. If not set, it is expected to be on your $PATH.",
"type": "string",
"default": ""
},
"git-log--graph.actions.global": {
"description": "Please check the extension's README for documentation. BE CAREFUL EDITING THESE OPTIONS.",
"type": "array",
Expand Down
3 changes: 2 additions & 1 deletion src/git.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ module.exports.get_git = (EXT_ID, log, { on_repo_external_state_change, on_repo_
run: (###* @type string ### args, ###* @type {number|undefined} ### repo_index) =>
repo_index ?= selected_repo_index
cwd = vscode.workspace.getConfiguration(EXT_ID).get('folder')
cmd = vscode.workspace.getConfiguration(EXT_ID).get('git-path') || 'git'
if not cwd
repo = api.repositories[repo_index]
if not repo and repo_index > 0
Expand All @@ -91,7 +92,7 @@ module.exports.get_git = (EXT_ID, log, { on_repo_external_state_change, on_repo_
throw "No repository selected"
cwd = repo.rootUri.fsPath
try
{ stdout, stderr: _ } = await exec 'git ' + args,
{ stdout, stderr: _ } = await exec cmd + ' ' + args,
cwd: cwd
# 35 MB. For scale, Linux kernel git graph (1 mio commits) in extension format
# is 538 MB or 7.4 MB for the first 15k commits
Expand Down

0 comments on commit 96d3208

Please sign in to comment.