Fossil SCM
Print a diagnostic message if the first attempt to connect to a remote using SSH fails and a retry with or without PATH= is about to commence. See [forum:/forumpost/9584923cf6|forum post 9584923cf6] for an explanation of why this is important.
Commit
f80041ebc5253989a1e5f8316247611c4c71a92fa3dc0b990107401ce5db6dfb
Parent
b2619342c7e71e3…
2 files changed
+6
-4
+1
-1
+6
-4
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -506,14 +506,16 @@ | ||
| 506 | 506 | && (g.url.flags & URL_SSH_EXE)==0 /* Does not have ?fossil=.... */ |
| 507 | 507 | && (g.url.flags & URL_SSH_RETRY)==0 /* Not retried already */ |
| 508 | 508 | ){ |
| 509 | 509 | /* Retry after flipping the SSH_PATH setting */ |
| 510 | 510 | transport_close(&g.url); |
| 511 | - if( g.fSshTrace ){ | |
| 512 | - printf("Retry after %s the PATH= argument to the SSH command\n", | |
| 513 | - (g.url.flags & URL_SSH_PATH)!=0 ? "removing" : "adding"); | |
| 514 | - } | |
| 511 | + fossil_print( | |
| 512 | + "First attempt to run fossil on %s using SSH failed.\n" | |
| 513 | + "Retrying %s the PATH= argument.\n", | |
| 514 | + g.url.hostname, | |
| 515 | + (g.url.flags & URL_SSH_PATH)!=0 ? "without" : "with" | |
| 516 | + ); | |
| 515 | 517 | g.url.flags ^= URL_SSH_PATH|URL_SSH_RETRY; |
| 516 | 518 | rc = http_exchange(pSend,pReply,mHttpFlags,0,zAltMimetype); |
| 517 | 519 | if( rc==0 ){ |
| 518 | 520 | char *z = mprintf("use-path-for-ssh:%s", g.url.hostname); |
| 519 | 521 | if( (g.url.flags & URL_SSH_PATH) ){ |
| 520 | 522 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -506,14 +506,16 @@ | |
| 506 | && (g.url.flags & URL_SSH_EXE)==0 /* Does not have ?fossil=.... */ |
| 507 | && (g.url.flags & URL_SSH_RETRY)==0 /* Not retried already */ |
| 508 | ){ |
| 509 | /* Retry after flipping the SSH_PATH setting */ |
| 510 | transport_close(&g.url); |
| 511 | if( g.fSshTrace ){ |
| 512 | printf("Retry after %s the PATH= argument to the SSH command\n", |
| 513 | (g.url.flags & URL_SSH_PATH)!=0 ? "removing" : "adding"); |
| 514 | } |
| 515 | g.url.flags ^= URL_SSH_PATH|URL_SSH_RETRY; |
| 516 | rc = http_exchange(pSend,pReply,mHttpFlags,0,zAltMimetype); |
| 517 | if( rc==0 ){ |
| 518 | char *z = mprintf("use-path-for-ssh:%s", g.url.hostname); |
| 519 | if( (g.url.flags & URL_SSH_PATH) ){ |
| 520 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -506,14 +506,16 @@ | |
| 506 | && (g.url.flags & URL_SSH_EXE)==0 /* Does not have ?fossil=.... */ |
| 507 | && (g.url.flags & URL_SSH_RETRY)==0 /* Not retried already */ |
| 508 | ){ |
| 509 | /* Retry after flipping the SSH_PATH setting */ |
| 510 | transport_close(&g.url); |
| 511 | fossil_print( |
| 512 | "First attempt to run fossil on %s using SSH failed.\n" |
| 513 | "Retrying %s the PATH= argument.\n", |
| 514 | g.url.hostname, |
| 515 | (g.url.flags & URL_SSH_PATH)!=0 ? "without" : "with" |
| 516 | ); |
| 517 | g.url.flags ^= URL_SSH_PATH|URL_SSH_RETRY; |
| 518 | rc = http_exchange(pSend,pReply,mHttpFlags,0,zAltMimetype); |
| 519 | if( rc==0 ){ |
| 520 | char *z = mprintf("use-path-for-ssh:%s", g.url.hostname); |
| 521 | if( (g.url.flags & URL_SSH_PATH) ){ |
| 522 |
+1
-1
| --- src/patch.c | ||
| +++ src/patch.c | ||
| @@ -696,11 +696,11 @@ | ||
| 696 | 696 | blob_append_escaped_arg(&cmd, zRemote, 0); |
| 697 | 697 | blob_init(&remote, 0, 0); |
| 698 | 698 | if( zFossilCmd==0 ){ |
| 699 | 699 | blob_append_escaped_arg(&cmd, |
| 700 | 700 | /* tag-20240206-a: |
| 701 | - /* vvvv---- Keep in sync with the PATH= in tag-20240206-b */ | |
| 701 | + ** vvvv---- Keep in sync with the PATH= in tag-20240206-b */ | |
| 702 | 702 | "PATH=$HOME/bin:/usr/local/bin:/opt/homebrew/bin:$PATH", 0); |
| 703 | 703 | zFossilCmd = "fossil"; |
| 704 | 704 | } |
| 705 | 705 | blob_appendf(&remote, "%$ patch %s%s --dir64 %z -", |
| 706 | 706 | zFossilCmd, zRemoteCmd, zForce, encode64(zDir, -1)); |
| 707 | 707 |
| --- src/patch.c | |
| +++ src/patch.c | |
| @@ -696,11 +696,11 @@ | |
| 696 | blob_append_escaped_arg(&cmd, zRemote, 0); |
| 697 | blob_init(&remote, 0, 0); |
| 698 | if( zFossilCmd==0 ){ |
| 699 | blob_append_escaped_arg(&cmd, |
| 700 | /* tag-20240206-a: |
| 701 | /* vvvv---- Keep in sync with the PATH= in tag-20240206-b */ |
| 702 | "PATH=$HOME/bin:/usr/local/bin:/opt/homebrew/bin:$PATH", 0); |
| 703 | zFossilCmd = "fossil"; |
| 704 | } |
| 705 | blob_appendf(&remote, "%$ patch %s%s --dir64 %z -", |
| 706 | zFossilCmd, zRemoteCmd, zForce, encode64(zDir, -1)); |
| 707 |
| --- src/patch.c | |
| +++ src/patch.c | |
| @@ -696,11 +696,11 @@ | |
| 696 | blob_append_escaped_arg(&cmd, zRemote, 0); |
| 697 | blob_init(&remote, 0, 0); |
| 698 | if( zFossilCmd==0 ){ |
| 699 | blob_append_escaped_arg(&cmd, |
| 700 | /* tag-20240206-a: |
| 701 | ** vvvv---- Keep in sync with the PATH= in tag-20240206-b */ |
| 702 | "PATH=$HOME/bin:/usr/local/bin:/opt/homebrew/bin:$PATH", 0); |
| 703 | zFossilCmd = "fossil"; |
| 704 | } |
| 705 | blob_appendf(&remote, "%$ patch %s%s --dir64 %z -", |
| 706 | zFossilCmd, zRemoteCmd, zForce, encode64(zDir, -1)); |
| 707 |