Repository navigation
Ask that pass - #360
Merged
Merged
Ask that pass#360
Conversation
This means both the main process and renderer can access our creds.
Contributor
Author
|
This is ready for review 🙏 Tested cloning and pulling private repos on both macOS and Windows. See the body for a lil context. |
Contributor
|
I also tested on Windows by pulling and pushing to a private repository. Nice work! ✨ |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Dependent on desktop/dugite#18.Dependent on #361.Fixes #184
Authenticate our remote operations by setting ourselves as
GIT_ASKPASS.This is ending up a bit gnarlier than I'd hoped. In my ideal version, we would have pass our main process executable as
GIT_ASKPASS. It'd find the user/password, write it out, and quit. Pretty straightforward. But that didn't work, for a few different reasons depending on the platform:macOS
macOS won't launch another instance of an already-running app. We can force it to with
open -n -a $PATH_TO_APP, but git will throw a fit ifGIT_ASKPASSincludes arguments. So we need to write a no-arguments executable that we can giveGIT_ASKPASSthat will launch the second instance of the app.So we'll use a little trampoline script to do the
open -n -adance. But it turns out that if we useopen -n -ato launch another instance of the app, users will be able to see that new instance launch and quit in the Dock. Gross.Instead, the trampoline will use Electron's ability to run as
nodeto execute a little script which will do all the work 💥Windows
Unlike macOS, Windows is happy to launch another instance of the already-running app. But. On Windows, Electron doesn't attach
stdoutby default. And even launching the second instance of the app telling it to attach, I still couldn't get our main process to log anything tostdoutfor git to consume.So we'll do the same dance we do on macOS. We'll use a little trampoline script to launch Electron in
nodemode, which will do the real work for us.tl;dr: Rub some indirection on it.