Make the --root flag required, no default

BREAKING CHANGE

The default of $HOME has caused problems for people playing with
git-sync, so this change makes it a required argument.
This commit is contained in:
Tim Hockin 2020-10-31 10:26:27 -07:00
parent 7636966819
commit af2ae5b533
2 changed files with 3 additions and 3 deletions

View File

@ -87,7 +87,7 @@ docker run -d \
| GIT_SYNC_REV | `--rev` | the git revision (tag or hash) to check out | "HEAD" |
| GIT_SYNC_DEPTH | `--depth` | use a shallow clone with a history truncated to the specified number of commits | 0 |
| GIT_SYNC_SUBMODULES | `--submodules` | git submodule behavior: one of 'recursive', 'shallow', or 'off' | recursive |
| GIT_SYNC_ROOT | `--root` | the root directory for git-sync operations, under which --dest will be created | "$HOME/git" |
| GIT_SYNC_ROOT | `--root` | the root directory for git-sync operations, under which --dest will be created | "" |
| GIT_SYNC_DEST | `--dest` | the name of (a symlink to) a directory in which to check-out files under --root (defaults to the leaf dir of --repo) | "" |
| GIT_SYNC_PERIOD | `--period` | how long to wait between syncs, must be >= 10ms | "10s" |
| GIT_SYNC_SYNC_TIMEOUT | `--sync-timeout` | the total time allowed for one complete sync, must be >= 10ms | "120s" |

View File

@ -62,7 +62,7 @@ var flDepth = pflag.Int("depth", envInt("GIT_SYNC_DEPTH", 0),
var flSubmodules = pflag.String("submodules", envString("GIT_SYNC_SUBMODULES", "recursive"),
"git submodule behavior: one of 'recursive', 'shallow', or 'off'")
var flRoot = pflag.String("root", envString("GIT_SYNC_ROOT", envString("HOME", "")+"/git"),
var flRoot = pflag.String("root", envString("GIT_SYNC_ROOT", ""),
"the root directory for git-sync operations, under which --dest will be created")
var flDest = pflag.String("dest", envString("GIT_SYNC_DEST", ""),
"the name of (a symlink to) a directory in which to check-out files under --root (defaults to the leaf dir of --repo)")
@ -1136,7 +1136,7 @@ OPTIONS
--root <string>, $GIT_SYNC_ROOT
The root directory for git-sync operations, under which --dest will
be created. (default: $HOME/git)
be created. This flag is required.
--ssh, $GIT_SYNC_SSH
Use SSH for git authentication and operations.