A look at desktop/desktop-trampoline: 29 stars on GitHub, written primarily in C, tracked under the Backend category. A cross-platform no-dependency TCP-based trampoline for GitHub Desktop, written in C
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
A cross-platform no-dependency C executable trampoline which lets GitHub Desktop
intercede in order to provide Git with any additional info it needs (like
credentials through GIT_ASKPASS or SSH_ASKPASS).
The intention is to support the same platforms that
Electron supports.
Building
This project is written as a Node project with the C-portions being compiled by
node-gyp. Installing dependencies and building requires Node.js, and yarn. With
those prerequisites the initial setup should be as easy as running yarn and
subsequent builds can be done using yarn build. There are some tests available
by running yarn test.
Purpose
When doing any Git operation that requires authentication in Desktop, the
application needs a way to provide those credentials to Git. There are several
options available:
rely on the user's credential.helper config setting
implement our own
credential storage
that supports the full credential surface
implement a program that handles the Git AskPass protocol
The first option is unsatisfactory because it can be challenging to setup
correctly, or may be changed under us.
The second option is excessive - the account details are already managed in
GitHub Desktop, and we only need to provide the credentials to Git when
required.
The third option is what we have currently settled on. An added benefit of this
is it can be configured to ignore any fallback options when authenticating -
reducing the potential for problems integrating with an existing Git setup.
What's a Trampoline?
There are many different descriptions for "trampoline" in computing but in this
situation the trampoline is a component to pass inputs and outputs between
programs that are otherwise challenging to integrate.
On one side, we have Git, which has a number of ways it can authenticate the
user against a HTTPS remote.
On the other side, we have GitHub Desktop - an Electron app that is primarily
running as a GUI. Electron also supports
environment variables
that allow us to run it like a command-line program.
To set an AskPass program for Git, we set the GIT_ASKPASS environment variable
to our executable on disk. This is done by Desktop whenever it needs to spawn a
Git operation that might require authentication.
The equivalent Bash shell code looks like this:
# environment variable
GIT_ASKPASS="C:/some/path/to/desktop-askpass-trampoline.exe" \
# ensure Git doesn't block the process waiting for the user to provide input
GIT_TERMINAL_PROMPT=0 \
git \
# unset the credential.helper defined in config
-c credential.helper= \
clone https://github.com/shiftkey/my-private-repo.git
Desktop also sets these environment variables when spawning Git, as it's the
only way to pass information down to the authentication process:
DESKTOP_USERNAME - the account associated with the current repository
DESKTOP_ENDPOINT - the endpoint associated with the account
With this trampoline, all this info can be passed from GitHub Desktop to Git,
and then back to GitHub Desktop via a TCP socket when Git requires us the user
credentials, so Desktop can act based on that username and endpoint.
Why Need An Executable?
This was originally written as a batch file, which looked like this:
@echo off
setlocal
set ELECTRON_RUN_AS_NODE=1
set ELECTRON_NO_ATTACH_CONSOLE=1
"%DESKTOP_PATH%" "%DESKTOP_ASKPASS_SCRIPT%" %*
endlocal
While this is much more succinct than this C version, it has some technical
limitations that we cannot work around:
batch files on Windows are launched using cmd /c {path} and there are a
number of known limitations with Unicode characters in file paths
the Golang runtime - which Git LFS is built upon - also has problems launching
batch files with spaces -
golang/go#17149
Because some of our Desktop users don't have control over the account name on
their machine - think students on a machine managed by their university IT
staff, for example. We need to support these users in Desktop.
There are also some things missing from this script that are not easy to
implement in batch files, such as adding logging to help diagnose environmental
issues.
Thankfully if you set an executable for your GIT_ASKPASS environment variable,
it avoids all these problems as Windows can just execute the program.
Why Need A TCP Server?
The main reason for using a TCP server is that it provides a generic and very
powerful mechanism for GitHub Desktop to interoperate with Git and handle any
other protocol Git would require in order to supply any kind of info.
Thanks to this, with only one generic trampoline that forwards everything via
that TCP socket, the implementation for every possible protocol like
GIT_ASKPASS can live within the GitHub Desktop codebase instead of having
multiple trampoline executables.
SSH Wrapper
Along with the trampoline, an SSH wrapper is provided for macOS. The reason for
this is macOS before Monterey include an "old" version of OpenSSH that will
ignore the SSH_ASKPASS variable unless it's unable to write to a tty.
This SSH wrapper achieves exactly that: just runs whatever ssh exists in the
path in a way that will use SSH_ASKPASS when necessary.
More recent versions of OpenSSH (starting with 8.3) don't require this wrapper,
since they added support for a new SSH_ASKPASS_REQUIRE environment variable.
Does desktop/desktop-trampoline have a project website?
No homepage URL was recorded for desktop/desktop-trampoline in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How active is development on desktop/desktop-trampoline?
The most recent commit recorded on desktop/desktop-trampoline was 1.4 years ago, based on the GitHub push timestamp. The repository has 13 forks — one of the better signals of community interest.
How many stars does desktop/desktop-trampoline have?
desktop/desktop-trampoline has 29 GitHub stars — refresh the page for the live number, or check github.com/desktop/desktop-trampoline. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is desktop/desktop-trampoline written in?
desktop/desktop-trampoline is written primarily in C. GitHub's language field is based on the largest share of bytes in the default branch.
What license does desktop/desktop-trampoline use?
desktop/desktop-trampoline is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
What topics is desktop/desktop-trampoline associated with?
GitHub's repository topics for desktop/desktop-trampoline: "askpass", "c", "git", "github", "github-desktop". TopGit's editorial category is Backend.
Where do I read more about desktop/desktop-trampoline?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/desktop/desktop-trampoline is the definitive source.
Read full README in the tab above.
Curious whether desktop-trampoline is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about desktop-trampoline.