Fossil SCM
patchcmd.md: added a description of how to enable, if needed, a custom PATH via the remote bashrc.
Commit
9a931a16aca2a7150198c61dd3e00fe09e62e0affde2389b73cf51c7367d34fd
Parent
f3acbe429aa460c…
1 file changed
+34
+34
| --- www/patchcmd.md | ||
| +++ www/patchcmd.md | ||
| @@ -43,10 +43,44 @@ | ||
| 43 | 43 | set to go. If you get "fossil not found", or if the version shown is too |
| 44 | 44 | old, put a newer fossil executable on the default PATH. The default PATH |
| 45 | 45 | can be shown using: |
| 46 | 46 | |
| 47 | 47 | > `ssh -T remote 'echo $PATH'` |
| 48 | + | |
| 49 | +### Custom PATH Caveat | |
| 50 | + | |
| 51 | +On Unix-like systems, the init script for the user's login shell | |
| 52 | +(e.g. `~/.profile` or `~/.bash_profile`) may be configured to *not do | |
| 53 | +anything* when running under a non-interactive shell. Thus a fossil | |
| 54 | +binary installed to a custom directory might not be found. To allow | |
| 55 | +the patch command to use a fossil binary installed in a directory | |
| 56 | +which is normally added to the PATH via the interactive shell's init | |
| 57 | +script, it may be useful to disable that check. For example, | |
| 58 | +Ubuntu-derived systems sometimes start their default `.bashrc` with | |
| 59 | +something like: | |
| 60 | + | |
| 61 | +``` | |
| 62 | +# If not running interactively, don't do anything: | |
| 63 | +[ -z "$PS1" ] && return | |
| 64 | +# Or: | |
| 65 | +case $- in | |
| 66 | + *i*) ;; | |
| 67 | + *) return;; | |
| 68 | +esac | |
| 69 | +``` | |
| 70 | + | |
| 71 | +Commenting out that check will allow the patch command to run, for | |
| 72 | +example, `~/bin/fossil` if `~/bin` is added to the PATH via the init | |
| 73 | +script. To disable that check *only* when the shell is *not* running | |
| 74 | +over an SSH connection, something like the following should suffice: | |
| 75 | + | |
| 76 | +``` | |
| 77 | +if [ -z "$SSH_CONNECTION" ]; then | |
| 78 | + # ... the is-interactive check goes here ... | |
| 79 | +fi | |
| 80 | +``` | |
| 81 | + | |
| 48 | 82 | |
| 49 | 83 | ## Implementation Details |
| 50 | 84 | |
| 51 | 85 | The "fossil patch create" command records all of the local, uncommitted |
| 52 | 86 | changes in an SQLite database file. If the argument to "fossil patch create" |
| 53 | 87 |
| --- www/patchcmd.md | |
| +++ www/patchcmd.md | |
| @@ -43,10 +43,44 @@ | |
| 43 | set to go. If you get "fossil not found", or if the version shown is too |
| 44 | old, put a newer fossil executable on the default PATH. The default PATH |
| 45 | can be shown using: |
| 46 | |
| 47 | > `ssh -T remote 'echo $PATH'` |
| 48 | |
| 49 | ## Implementation Details |
| 50 | |
| 51 | The "fossil patch create" command records all of the local, uncommitted |
| 52 | changes in an SQLite database file. If the argument to "fossil patch create" |
| 53 |
| --- www/patchcmd.md | |
| +++ www/patchcmd.md | |
| @@ -43,10 +43,44 @@ | |
| 43 | set to go. If you get "fossil not found", or if the version shown is too |
| 44 | old, put a newer fossil executable on the default PATH. The default PATH |
| 45 | can be shown using: |
| 46 | |
| 47 | > `ssh -T remote 'echo $PATH'` |
| 48 | |
| 49 | ### Custom PATH Caveat |
| 50 | |
| 51 | On Unix-like systems, the init script for the user's login shell |
| 52 | (e.g. `~/.profile` or `~/.bash_profile`) may be configured to *not do |
| 53 | anything* when running under a non-interactive shell. Thus a fossil |
| 54 | binary installed to a custom directory might not be found. To allow |
| 55 | the patch command to use a fossil binary installed in a directory |
| 56 | which is normally added to the PATH via the interactive shell's init |
| 57 | script, it may be useful to disable that check. For example, |
| 58 | Ubuntu-derived systems sometimes start their default `.bashrc` with |
| 59 | something like: |
| 60 | |
| 61 | ``` |
| 62 | # If not running interactively, don't do anything: |
| 63 | [ -z "$PS1" ] && return |
| 64 | # Or: |
| 65 | case $- in |
| 66 | *i*) ;; |
| 67 | *) return;; |
| 68 | esac |
| 69 | ``` |
| 70 | |
| 71 | Commenting out that check will allow the patch command to run, for |
| 72 | example, `~/bin/fossil` if `~/bin` is added to the PATH via the init |
| 73 | script. To disable that check *only* when the shell is *not* running |
| 74 | over an SSH connection, something like the following should suffice: |
| 75 | |
| 76 | ``` |
| 77 | if [ -z "$SSH_CONNECTION" ]; then |
| 78 | # ... the is-interactive check goes here ... |
| 79 | fi |
| 80 | ``` |
| 81 | |
| 82 | |
| 83 | ## Implementation Details |
| 84 | |
| 85 | The "fossil patch create" command records all of the local, uncommitted |
| 86 | changes in an SQLite database file. If the argument to "fossil patch create" |
| 87 |