summaryrefslogtreecommitdiffstats
path: root/ssh.py
Commit message (Collapse)AuthorAgeFilesLines
* ssh: Set git protocol version 2 on SSH ControlMasterErik Elmeke2024-05-161-1/+57
| | | | | | | | | | | | | | | | | | | | | | | | | According to https://git-scm.com/docs/protocol-v2#_ssh_and_file_transport, when using SSH, the environment variable GIT_PROTOCOL must be set when establishing the connection to the git server. Normally git does this by itself. But in repo-tool where the SSH connection is managed by the repo-tool, it must be passed in explicitly instead. Under some circumstances of environment configuration, this caused all repo sync commands over ssh to always use git protocol version 1. Even when git was configured to use version 2. Using git protocol v2 can significantly improve fetch speeds, since it uses server side filtering of refs, reducing the amount of unneccessary objects to send. Change-Id: I6d4c3b7300a6090d707480b1a638ed03622fa71a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/411362 Tested-by: Erik Elmeke <erik@haleytek.corp-partner.google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Erik Elmeke <erik@haleytek.corp-partner.google.com>
* ssh: Print details if running the command failsv2.44Sebastian Schuberth2024-03-111-2/+6
| | | | | | | | | Change-Id: I87adbdd5fe4eb2709c97ab4c21b414145acf788b Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/392915 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Tuan Vo Hung <vohungtuan@gmail.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* cleanup: Update codebase to expect Python 3.6Jason R. Coombs2023-10-311-1/+1
| | | | | | | | | | | - Bump minimum version to Python 3.6. - Use f-strings in a lot of places. Change-Id: I2aa70197230fcec2eff8e7c8eb754f20c08075bb Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389034 Tested-by: Jason R. Coombs <jaraco@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
* Parse OpenSSH versions with no SSH_EXTRAVERSIONSaagar Jha2023-05-241-1/+1
| | | | | | | | | | | If the Debian banner is not used, then there won't be a space after the version number: it'll be followed directly by a comma. Bug: https://crbug.com/gerrit/16903 Change-Id: I12b873f32afc9424f42b772399c346f96ca95a96 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/372875 Tested-by: Saagar Jha <saagarjha@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* Format codebase with black and check formatting in CQGavin Mak2023-03-221-232/+242
| | | | | | | | | | | | Apply rules set by https://gerrit-review.googlesource.com/c/git-repo/+/362954/ across the codebase and fix any lingering errors caught by flake8. Also check black formatting in run_tests (and CQ). Bug: b/267675342 Change-Id: I972d77649dac351150dcfeb1cd1ad0ea2efc1956 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/363474 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
* Set tracing to always on and save to .repo/TRACE_FILE.Joanna Wang2022-11-031-19/+20
| | | | | | | | | | | | - add `--trace_to_stderr` option so stderr will include trace outputs and any other errors that get sent to stderr - while TRACE_FILE will only include trace outputs piggy-backing on: https://gerrit-review.googlesource.com/c/git-repo/+/349154 Change-Id: I3895a84de4b2784f17fac4325521cd5e72e645e2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/350114 Reviewed-by: LaMont Jones <lamontjones@google.com> Tested-by: Joanna Wang <jojwang@google.com>
* ssh: handle FileNotFoundError errorsMike Frysinger2021-10-261-0/+3
| | | | | | | | | | If ssh isn't installed, it throws a distinct error we have to catch. Bug: https://crbug.com/gerrit/15196 Change-Id: I0660e842c304ce7575f5cb100894d05fd65f9454 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322055 Reviewed-by: Jack Neus <jackneus@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* ssh: rewrite proxy management for multiprocessing usagev2.15Mike Frysinger2021-05-101-131/+151
| | | | | | | | | | | | | | | | We changed sync to use multiprocessing for parallel work. This broke the ssh proxy code as it's all based on threads. Rewrite the logic to be multiprocessing safe. Now instead of the module acting as a stateful object, callers have to instantiate a new ProxyManager class that holds all the state, an pass that down to any users. Bug: https://crbug.com/gerrit/12389 Change-Id: I4b1af116f7306b91e825d3c56fb4274c9b033562 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305486 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Chris Mcdonald <cjmcdonald@google.com>
* ssh: move all ssh logic to a common placeMike Frysinger2021-05-061-0/+257
We had ssh logic sprinkled between two git modules, and neither was quite the right home for it. This largely moves the logic as-is to its new home. We'll leave major refactoring to followup commits. Bug: https://crbug.com/gerrit/12389 Change-Id: I300a8f7dba74f2bd132232a5eb1e856a8490e0e9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305483 Reviewed-by: Chris Mcdonald <cjmcdonald@google.com> Tested-by: Mike Frysinger <vapier@google.com>