Share no ssh connection when the socket path would be too long
macOS accepts socket paths of at most 103 characters. Count the folder, the file name, the 40-character hash and the temporary end ssh adds; when the total is over 103, leave the connection-sharing options out. Find, make and check the socket folder once per run instead of for every command.
This commit is contained in:
@@ -69,7 +69,12 @@ A path on the server that is `~` or starts with `~/` is handed to the server's s
|
||||
`gites` folder in the user's cache folder, made so that only the user can open it;
|
||||
never in `/tmp`. If neither folder can be found or made, these three options are
|
||||
left out and every command opens a new connection. `%C` is a hash ssh makes from
|
||||
the host, port and user, so the path stays short.
|
||||
the host, port and user, 40 characters long. macOS accepts a socket path of at most
|
||||
103 characters (Linux 107), and while ssh sets up a shared connection it adds a
|
||||
temporary end of up to 18 characters to the file name. So gites counts the folder's
|
||||
length + 1 + 6 (`gites-`) + 40 + 18; if that is more than 103 (one limit on every
|
||||
system), these three options are left out too. The folder is found, made and checked
|
||||
once when gites first runs ssh, not for every command.
|
||||
- On Windows, ssh cannot share connections, so these three options are left out and
|
||||
every command opens a new connection.
|
||||
- Quoting: every word of the git command is put in single quotes, and a `'` inside a
|
||||
|
||||
Reference in New Issue
Block a user