-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-3736: Use the system Git in electron. #3747
Conversation
7c32b73
to
b8ce225
Compare
The Windows build fails with
Although I do not have the failing |
@svenefftinge, @AlexTugarev can one of you look into this? Thanks! |
// tslint:disable-next-line:no-any | ||
protected async handleExternalNotFound(err?: any): Promise<void> { | ||
if (err) { | ||
this.logger.error(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we notify users in such cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Oh sure. I did not want to log the stack trace; the user cannot do much with that, but I wanted to "log" Could not find Git on the PATH. Falling back to the embedded Git. via the messageService
.
If Git does not exisit on the `PATH`, fall back to the embedded Git. Closes #3736. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
@AlexTugarev, please retake a look. This time, the PR is without the message service notifications. We can handle it in a follow-up if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Testing the Electron app now.
if (!!execPath && !!path && !!version) { | ||
// https://github.com/desktop/dugite/issues/111#issuecomment-323222834 | ||
// Instead of the executable path, we need the root directory of Git. | ||
const dir = dirname(dirname(path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if path
is e.g. /usr/local/bin/git
, dir
is supposed to be /usr/local
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ Yes, there is the comment above the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! ;-)
Works fine! Just verified, that the git from
Then, after managing to "disable" Apple's default git, I could test the fallback to embedded git as well.
Also, put a breakpoint into dugite code, just to make sure it shows the proper git location.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine!
Wow, thanks for the review @AlexTugarev! The Windows build is the good old
I am going to merge this. |
If Git does not exist on the
PATH
,fall back to the embedded Git.
Closes #3736.
Closes #3571.