phil294 / GitLG

A free, interactive Git UI for VSCode
MIT License
147 stars 12 forks source link

Allow user to config git executable path #90

Open tapr00t opened 6 months ago

tapr00t commented 6 months ago

As the title suggests, allow user to configure the path of the git executable.

I'm running VSCode connected to a remote Linux machine that has a very old local version of git, which doesn't support the parameters this extension wants to use. We have a network mount with binaries we use, including a newer git (2.31) which would work. But I'm having difficulty getting the extension to know about this newer version it could be using instead. I don't have many permissions on this machine.

phil294 commented 6 months ago

Right, currently git is just expected to be on your $PATH (or whatever its Windows equivalent is). I'll add a setting for this the upcoming days.

phil294 commented 6 months ago

fixed with version 0.1.15

apitofme commented 6 months ago

I appreciate the option to set a custom path for git, however should / could this respect the git.path setting in VS-Code(ium) -- if it is set? -- Falling back to global $PATH if no internal setting. Perhaps also then prompting for a custom path if it is still not found on the system path.


Edit:

I see that you implemented the following in package.json:

"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": ""
},

...and in src/git.coffee notably:

cmd = vscode.workspace.getConfiguration(EXT_ID).get('git-path') || 'git'

\ But this does not appear to be registered with VSCodium as a settings option for the extension:

\ Do we have to manually edit the package.json file, or add a custom section for git-log--graph in the User settings.json files?

phil294 commented 3 weeks ago

Right, falling back to git.path before $PATH definitely makes sense, I must have missed that setting completely.

Regarding this very extension's setting(s): No, you don't need to change any config file manually. I have no idea why the settings don't show up for you, but there are many of them, 20 in count currently. Maybe you just needed to restart VSCode?

image

apitofme commented 3 weeks ago

To be honest, I think it might be something goofy with my setup... (sorry) I'm dual-location, with a Desktop at one and a fixed Laptop setup at the other. I just tried it on my laptop (running Linux) and it works fine, including the extension's settings showing up ... but git is on the system Path (i.e. git was installed globally by the package manager).

My desktop set-up on the other hand is a little more esoteric: It's running Win10, but I'm using a portable Dev environment where git is only installed in a folder and is not registered on the system path. I was able to point VSCodium to the 'local' git, with a custom path in the settings, and it works correctly with the built-in source control manager. -- So, from what you said, GitLG should use the same setting, and work, but for some reason it doesn't / didn't. Unfortunately I'm not at my desktop location at the moment, so I can't test that again right now.

Given the situation I suggest we "don't worry about it" for now ... I should be back at my desktop in the next week or so, so will try to get to the bottom of the issue at my end then. If I manage to figure it out, or find anything relevant for GitLG (rather than just my system's quirks) I'll report back here.

Thanks ...and agian. apologies for not testing my Linux set-up as well, first, before reporting here.