Closed guw closed 7 months ago
Don't know how we could help without knowing your extension.
Do you see an OS level call-out to invoke the extension as possible generic solution?
Not enough information. I'm confused by the error message; it seems to imply that a call-out to external git did already happen?
What's the extension, and how is it plugged into the push or pull process? Is "git foo" being called in some hook script?
@tomaswolf That's a good hint. It's indeed a wired into hook. Maybe the PATH
is not correct then JGit is executing the hooks? Is JGit executing the hooks?
JGit is executing hooks. What platform? If Mac, I suspect you get the $PATH from Eclipse, which is typically much shorter than $PATH in a bash
terminal if Eclipse was started via the UI. Dump $PATH from your hook script. (Or try starting Eclipse directly from a terminal to inherit the bash $PATH.)
However, the error message also implies that git
itself was found and executed. But it could not find your custom command git-foo
. Where is that git-foo
located? Check the value of $GIT_EXEC_PATH in the hook. (Dump it, too.) Also dump the result of running git --exec-path
.
And check that the git
executable that gets run is the one you expect in case you have multiple installations. Check the order of directories inside $PATH.
@tomaswolf Yes. It's Mac and very likely the path does not have /opt/homebrew
in it.
Do you think it's worth having something like this in JGit? It's a utility I wrote to wrap execution into shell on MacOS so it has proper environment. I can contribute it to JGit if there is interest.
There is already FS.runInShell()
. I'm not at my development machine, so I cannot easily tell whether that is used to run hooks, but I would guess so. It already uses "sh -c". Perhaps it simply needs to be made to use "sh -l -c" on MacOS.
I've pushed Gerrit change 1177212 for this.
Thanks @tomaswolf. Looks like I cannot vote in the Gerrit instance. :( But +1
Gerrit change 1177212 was merged as 328008aa2937a5d0f539709fcf98a43c29ac6e95
Description
We have a Git repository using a special plug-in/extension for push & pull. Pulling and pushing from EGit is broken with this repository because of the following error:
Motivation
Allow to push & pull from Eclipse.
Alternatives considered
No response
Additional context
No response