@@ -56,50 +56,50 @@ var flDepth = flag.Int("depth", envInt("GIT_SYNC_DEPTH", 0),
5656 "use a shallow clone with a history truncated to the specified number of commits" )
5757
5858var flRoot = flag .String ("root" , envString ("GIT_SYNC_ROOT" , envString ("HOME" , "" )+ "/git" ),
59- "the root directory for git operations" )
59+ "the root directory for git-sync operations, under which --dest will be created " )
6060var flDest = flag .String ("dest" , envString ("GIT_SYNC_DEST" , "" ),
61- "the name at which to publish the checked -out files under --root (defaults to leaf dir of --repo)" )
61+ "the name of (a symlink to) a directory in which to check -out files under --root (defaults to the leaf dir of --repo)" )
6262var flWait = flag .Float64 ("wait" , envFloat ("GIT_SYNC_WAIT" , 0 ),
6363 "the number of seconds between syncs" )
6464var flSyncTimeout = flag .Int ("timeout" , envInt ("GIT_SYNC_TIMEOUT" , 120 ),
65- "the max number of seconds for a complete sync" )
65+ "the max number of seconds allowed for a complete sync" )
6666var flOneTime = flag .Bool ("one-time" , envBool ("GIT_SYNC_ONE_TIME" , false ),
67- "exit after the initial checkout " )
67+ "exit after the first sync " )
6868var flMaxSyncFailures = flag .Int ("max-sync-failures" , envInt ("GIT_SYNC_MAX_SYNC_FAILURES" , 0 ),
69- "the number of consecutive failures allowed before aborting (the first pull must succeed, -1 disables aborting for any number of failures after the initial sync)" )
69+ "the number of consecutive failures allowed before aborting (the first sync must succeed, -1 will retry forever after the initial sync)" )
7070var flChmod = flag .Int ("change-permissions" , envInt ("GIT_SYNC_PERMISSIONS" , 0 ),
71- "the file permissions to apply to the checked-out files" )
71+ "the file permissions to apply to the checked-out files (0 will not change permissions at all) " )
7272
7373var flWebhookURL = flag .String ("webhook-url" , envString ("GIT_SYNC_WEBHOOK_URL" , "" ),
74- "the URL for the webook to send to. Default is \" \" which disables the webook. " )
74+ "the URL for a webook notification when syncs complete (default is no webook) " )
7575var flWebhookMethod = flag .String ("webhook-method" , envString ("GIT_SYNC_WEBHOOK_METHOD" , "POST" ),
76- "the method for the webook to send with " )
76+ "the HTTP method for the webook" )
7777var flWebhookStatusSuccess = flag .Int ("webhook-success-status" , envInt ("GIT_SYNC_WEBHOOK_SUCCESS_STATUS" , 200 ),
78- "the status code which indicates a successful webhook call. A value of -1 disables success checks to make webhooks fire-and-forget" )
78+ "the HTTP status code indicating a successful webhook ( -1 disables success checks to make webhooks fire-and-forget) " )
7979var flWebhookTimeout = flag .Duration ("webhook-timeout" , envDuration ("GIT_SYNC_WEBHOOK_TIMEOUT" , time .Second ),
80- "the timeout used when communicating with the webhook target " )
80+ "the timeout for the webhook" )
8181var flWebhookBackoff = flag .Duration ("webhook-backoff" , envDuration ("GIT_SYNC_WEBHOOK_BACKOFF" , time .Second * 3 ),
82- "if a webhook call fails (dependant on webhook-success-status) this defines how much time to wait before retrying the call " )
82+ "the time to wait before retrying a failed webhook " )
8383
8484var flUsername = flag .String ("username" , envString ("GIT_SYNC_USERNAME" , "" ),
85- "the username to use" )
85+ "the username to use for git auth " )
8686var flPassword = flag .String ("password" , envString ("GIT_SYNC_PASSWORD" , "" ),
87- "the password to use" )
87+ "the password to use for git auth (users should prefer env vars for passwords) " )
8888
8989var flSSH = flag .Bool ("ssh" , envBool ("GIT_SYNC_SSH" , false ),
9090 "use SSH for git operations" )
9191var flSSHKeyFile = flag .String ("ssh-key-file" , envString ("GIT_SSH_KEY_FILE" , "/etc/git-secret/ssh" ),
92- "the ssh key to use" )
92+ "the SSH key to use" )
9393var flSSHKnownHosts = flag .Bool ("ssh-known-hosts" , envBool ("GIT_KNOWN_HOSTS" , true ),
9494 "enable SSH known_hosts verification" )
9595var flSSHKnownHostsFile = flag .String ("ssh-known-hosts-file" , envString ("GIT_SSH_KNOWN_HOSTS_FILE" , "/etc/git-secret/known_hosts" ),
96- "the known hosts file to use" )
96+ "the known_hosts file to use" )
9797
9898var flCookieFile = flag .Bool ("cookie-file" , envBool ("GIT_COOKIE_FILE" , false ),
9999 "use git cookiefile" )
100100
101101var flGitCmd = flag .String ("git" , envString ("GIT_SYNC_GIT" , "git" ),
102- "the git command to run (subject to PATH search)" )
102+ "the git command to run (subject to PATH search, mostly for testing )" )
103103
104104var flHTTPBind = flag .String ("http-bind" , envString ("GIT_SYNC_HTTP_BIND" , "" ),
105105 "the bind address (including port) for git-sync's HTTP endpoint" )
@@ -212,7 +212,7 @@ func main() {
212212 }
213213
214214 if * flRepo == "" {
215- fmt .Fprintf (os .Stderr , "ERROR: --repo or $GIT_SYNC_REPO must be provided\n " )
215+ fmt .Fprintf (os .Stderr , "ERROR: --repo must be provided\n " )
216216 flag .Usage ()
217217 os .Exit (1 )
218218 }
@@ -234,7 +234,7 @@ func main() {
234234 }
235235
236236 if (* flUsername != "" || * flPassword != "" || * flCookieFile ) && * flSSH {
237- fmt .Fprintf (os .Stderr , "ERROR: GIT_SYNC_SSH set but HTTP parameters provided. These cannot be used together. " )
237+ fmt .Fprintf (os .Stderr , "ERROR: --ssh is set but --username, --password, or --cookie-file were provided \n " )
238238 os .Exit (1 )
239239 }
240240
0 commit comments