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.

drh 2024-02-06 15:03 trunk
Commit f80041ebc5253989a1e5f8316247611c4c71a92fa3dc0b990107401ce5db6dfb
2 files changed +6 -4 +1 -1
+6 -4
--- src/http.c
+++ src/http.c
@@ -506,14 +506,16 @@
506506
&& (g.url.flags & URL_SSH_EXE)==0 /* Does not have ?fossil=.... */
507507
&& (g.url.flags & URL_SSH_RETRY)==0 /* Not retried already */
508508
){
509509
/* Retry after flipping the SSH_PATH setting */
510510
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
+ );
515517
g.url.flags ^= URL_SSH_PATH|URL_SSH_RETRY;
516518
rc = http_exchange(pSend,pReply,mHttpFlags,0,zAltMimetype);
517519
if( rc==0 ){
518520
char *z = mprintf("use-path-for-ssh:%s", g.url.hostname);
519521
if( (g.url.flags & URL_SSH_PATH) ){
520522
--- 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 @@
696696
blob_append_escaped_arg(&cmd, zRemote, 0);
697697
blob_init(&remote, 0, 0);
698698
if( zFossilCmd==0 ){
699699
blob_append_escaped_arg(&cmd,
700700
/* 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 */
702702
"PATH=$HOME/bin:/usr/local/bin:/opt/homebrew/bin:$PATH", 0);
703703
zFossilCmd = "fossil";
704704
}
705705
blob_appendf(&remote, "%$ patch %s%s --dir64 %z -",
706706
zFossilCmd, zRemoteCmd, zForce, encode64(zDir, -1));
707707
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button