Start the process of encapsulating most of the flags and not using them
as global variables. This commit JUST does the git command flag, which
is now only accessed from main()
Add '--period' to replace '--wait', which is now obsolete.
Add '--sync-timeout' to replace '--timeout', which is now obsolete.
Both of these new flags take a Go-style time string, rather than a bare
number. For example "1s" for 1 second or "1m" for one minute.
The old flags have been kept and will take precedence if specified.
THIS IS A BREAKING CHANGE
Switch flags implementation to use pflag. This means that long flags
like `-username` must now use 2 dashes: `--username`.
The `-v` flag (verbose) used to accept `-v` or `--v`. Now it only
accepts `-v.
The `--help` and `-h` flags are new.
The `--man` flag is new (print a man-page like help message).
Several glog flags which used to be exposed (e.g. --logtostderr) are no
longer exposed. Logs always go to stderr.
* add option to NOT recursively clone submodules
* Add "shallow" and "off" modes to submodule clone
* update readme to reflect new flag
* wording and such feedback
1) Was calling Wait() on the child process, but also calling Wait4,
which would race, causing an occasional error or panic.
2) In testing (1), I observed occasional hangs. Tracing it down to a
SIGWINCH, which masked a SIGCHLD, causing it to hang. Both seem fixed.
Added a manual test script.
It specifies a HTTP URL which will return username&password which will
be used to authenticate access to the git repo.
This is mainly used for git repo accecpt dynamic password (for example
oauth bare token). Because the dynamic password might expire very soon,
so it's added to the main syncRepo loop.
Typical usage case is work with a sidecar called gce-node-auth on GKE,
it uses the GCE service account's oauth token as password to access
Cloud Source Repo.
Please see the repo below for how it worked.
https://github.com/cydu-cloud/gce-node-auth/blob/master/git-sync-with-gce-node-auth.yaml