rust-lang / rust-lang/git2-rs

ssh controlmaster / keep connection alive

Open
#790 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.1k
Forks
450
Avg merge
11m
Merged PRs (30d)
1

Description

I've been looking through the docs, I don't see an obvious way to keep a ssh connection open to specific host, in ssh world also known as "ControlMaster".

For canonical git if one puts into ~/.ssh/config

Host *
  ControlMaster auto
  ControlPath ~/.ssh/-%r@%h:%p
  ControlPersist 600

ssh will keep connections alive for all hosts and canonical git respects that (running several git fetch's will authenticate only once with the host and keep the connection alive for 10 mins)

I made some rust application using git2-rs and while I'm aware it isn't influenced by default .ssh config options by design I guess, I really wonder how I can achieve something in that effect.

I would like to keep one ssh connection alive with one particular host I'm fetching a lot of repositories updates from while the rust application keeps running. Any ideas how this is done here?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing git2-rs SSH behavior and how it differs from canonical git's ~/.ssh/config ControlMaster settings. Determine whether the Rust application can reuse one SSH connection for repeated fetches from a specific host, and document the supported approach or the missing API; no files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, rust
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.