Commit Graph

523 Commits

Author SHA1 Message Date
Tim Hockin 3a1212da36 Add a main struct, part 4
This commit encapsulates the branch and rev parameters.
2020-11-10 10:21:20 -08:00
Tim Hockin b44dab6817 Add a main struct, part 3
This commit encapsulates the repo parameter.
2020-11-10 10:21:20 -08:00
Tim Hockin a80afb427d Add a main struct, part 2
This commit encapsulates the root parameter.

This exposed a bug where we do not reset the root of the workspace.
2020-11-10 10:21:20 -08:00
Tim Hockin 2dd4705c1b Add a main struct, part 1
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()
2020-11-10 10:21:20 -08:00
Kubernetes Prow Robot 073b007ebd
Merge pull request #303 from thockin/4-printf-vs-logs
Clarify logging vs printf for fatal messages
2020-11-10 09:30:40 -08:00
Tim Hockin 047593b40a Clarify logging vs printf for fatal messages
Also log when HTTP serving fails.
2020-11-10 09:15:17 -08:00
Kubernetes Prow Robot 341ebd2c1a
Merge pull request #302 from thockin/3-normlize-root-path
Normalize the root path
2020-11-10 05:16:39 -08:00
Tim Hockin 24c06a5b48 Normalize the root path
This makes sure there's never any confusion about whether it is an
absolute path or has symlinks or whatever.  Add e2e cases to cover.
2020-11-09 09:20:24 -08:00
Kubernetes Prow Robot 93e74c2527
Merge pull request #305 from thockin/v4-breakings
Add a test for tabs in manual
2020-11-09 08:58:30 -08:00
Tim Hockin ea469c1ed4 Add a test for tabs in manual 2020-11-09 08:53:29 -08:00
Kubernetes Prow Robot 719a93d431
Merge pull request #300 from thockin/v4-breakings
Change some flags (breaking)
2020-11-09 08:44:26 -08:00
Tim Hockin a2fa689296 Fix SSH docs to use 2 dashes 2020-11-09 08:36:14 -08:00
Tim Hockin 0e802450ee Don't allow --dest to start with a dot
BREAKING CHANGE

It's useful to reserve names that start with a dot.
2020-11-09 08:36:10 -08:00
Tim Hockin af2ae5b533 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.
2020-11-09 08:30:29 -08:00
Kubernetes Prow Robot 7636966819
Merge pull request #301 from thockin/2-env-tests
Add tests for other env funcs
2020-11-09 05:26:26 -08:00
Tim Hockin 7d7cbdacff Add tests for other env funcs 2020-11-08 10:47:07 -08:00
Kubernetes Prow Robot 69f3e090c2
Merge pull request #299 from thockin/time-flags
Change time-related flags to durations
2020-11-06 00:58:51 -08:00
Tim Hockin fa0e8696e2 Change time-related flags to durations
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.
2020-11-05 16:46:09 -08:00
Kubernetes Prow Robot b0eebbc7ad
Merge pull request #298 from thockin/flags
Add help and manual flags, use pflag
2020-11-05 03:00:53 -08:00
Tim Hockin 20696689f3 Add help and manual flags, use pflag
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.
2020-10-31 00:50:51 -07:00
Tim Hockin 9203d14142 Specify "master" in e2e
Some git revs now use "main" but "master" is still coded into git-sync.
When that is fixed we can undo this.
2020-10-31 00:42:46 -07:00
Kubernetes Prow Robot 5996005bea
Merge pull request #295 from daixiang0/doc
README: add buildx comment
2020-10-28 09:07:56 -07:00
Xiang Dai 7df021c9ff README: add buildx comment
Signed-off-by: Xiang Dai <long0dai@foxmail.com>
2020-10-28 16:44:00 +08:00
Kubernetes Prow Robot c72a880352
Merge pull request #294 from andres-lowrie/master
docs: add PAT option for `--password`
2020-10-11 10:48:47 -07:00
Kubernetes Prow Robot cdc62dead8
Merge pull request #293 from stp-ip/lineBreaksReadme
Fix line breaks in README
2020-10-06 13:36:43 -07:00
Andres Lowrie 3c79569bd7
docs: add PAT option for `--password`
This could help users that are not aware that github personal access tokens can be used as passwords. It's verbose could be helpful
2020-10-06 11:23:18 -05:00
Michael Grosser decb118c58 Fix line breaks in README 2020-10-06 15:04:38 +00:00
Kubernetes Prow Robot 5467f372bb
Merge pull request #292 from thockin/e2e-vflag
Move --v into e2e framework (always same value)
2020-10-04 07:23:06 -07:00
Tim Hockin 771011f0cc Move --v into e2e framework (always same) 2020-10-02 14:38:19 -07:00
Kubernetes Prow Robot 410c5950b8
Merge pull request #285 from unknowingknow/add-sync-hook-command
add an option to run the command when the repository is updated
2020-10-02 13:13:04 -07:00
unknowingknow 9661d3132e add e2e test for --sync-hook-command 2020-10-02 19:29:21 +09:00
unknowingknow 26cd942b2a change to a command name with no args 2020-10-02 19:29:03 +09:00
unknowingknow e1c4717de6 add an option to run the command when the repository is updated 2020-10-02 19:28:25 +09:00
Kubernetes Prow Robot 94f13f483f
Merge pull request #291 from thockin/logtostderr
logtostderr defaults to true: don't set it in test
2020-09-29 04:53:27 -07:00
Tim Hockin 1992a2bfab logtostderr defaults to true: don't set it in test 2020-09-28 16:31:33 -07:00
Tim Hockin 44e94a16b0 Fix webhook regression: allow -1 to ignore status 2020-09-25 11:17:56 -07:00
Kubernetes Prow Robot 66320a6b92
Merge pull request #243 from killuazhu/kyle-relax-wait
Relax wait between sync
2020-09-25 10:30:26 -07:00
Kubernetes Prow Robot 57ee2d1e70
Merge pull request #282 from thockin/staging
Use new staging GCR
2020-09-08 09:19:43 -07:00
Kubernetes Prow Robot b57238d575
Merge pull request #280 from davidkarlsen/socat
add socat to image to allow for proxying. Fixes #279
2020-09-08 09:17:43 -07:00
David Karlsen 3b52b63327
add documentation
Signed-off-by: David Karlsen <david@davidkarlsen.com>
2020-09-08 12:25:11 +02:00
Tim Hockin 7d89f343be Use new staging GCR 2020-09-07 17:28:57 -07:00
Kubernetes Prow Robot 428ffb71bb
Merge pull request #278 from thockin/10-askpass-url-as-arg
Clean up askpass function to take url as arg
2020-09-07 17:19:43 -07:00
Tim Hockin 4225d000e0 Clean up askpass function to take url as arg 2020-09-07 17:16:56 -07:00
Kubernetes Prow Robot ed57c29d83
Merge pull request #275 from thockin/7-askpass-metric
Add metric for askpass, noop sync != success
2020-09-07 17:11:42 -07:00
Kubernetes Prow Robot 2baf53e1c3
Merge pull request #268 from thockin/multiarch-via-buildx
Multiarch via buildx
2020-09-07 16:57:42 -07:00
David Karlsen 48c7b9aa02
add socat to image to allow for proxying. #279
Signed-off-by: David Karlsen <david@davidkarlsen.com>
2020-09-06 18:59:05 +02:00
Kubernetes Prow Robot c210398e92
Merge pull request #273 from thockin/5-flag-input-checking
Improve flag input checking and errors
2020-09-05 10:33:41 -07:00
Tim Hockin 9cef5f8ced Improve flag input checking and errors 2020-09-05 10:30:25 -07:00
Kubernetes Prow Robot f67c13654e
Merge pull request #277 from thockin/9-better-logs
Better logs and errors
2020-09-05 10:27:40 -07:00
Kubernetes Prow Robot 9c56b25591
Merge pull request #276 from thockin/8-use-filepath
use filepath.Join, drop dep on path
2020-09-05 10:25:41 -07:00