Commit Graph

779 Commits

Author SHA1 Message Date
Tim Hockin df5924f904 gofmt tools.go 2023-07-11 11:47:12 -07:00
Kubernetes Prow Robot 5a9037f8c6
Merge pull request #765 from thockin/v4_fix_relative_submodules
Make relative-path submodules work, via origin
2023-07-10 11:44:52 -07:00
Tim Hockin 08296a48b0
Make relative-path submodules work, via origin
The "origin" remote is implicitly used as the basis for relative-paths
in submodules.  It's very subtly documented, and I have no idea if there
are other places where it is used.  It seems git really expects it to
exist, so let's just do that.
2023-07-10 10:46:34 -07:00
Tim Hockin 0753bd511f Use --no-install-recommends on bash install 2023-06-26 13:28:46 -07:00
Tim Hockin e603667224 Make container builds faster by not repeating work 2023-06-26 13:28:46 -07:00
Tim Hockin c4d5e9c531 Fix TAG usage for 'make release' 2023-06-26 11:27:31 -07:00
Tim Hockin 9ea8045b95 Update release notes and add 'make release' 2023-06-23 14:48:24 -07:00
Tim Hockin c1afd4d578 Fix off-by-one in max-failures and docs 2023-06-18 10:59:29 -07:00
Kubernetes Prow Robot b60eef6b30
Merge pull request #753 from thockin/v4_smaller_image
Make the container image smaller
2023-06-12 12:45:57 -07:00
Tim Hockin f037087d13
Make the container image smaller
For each package and binary we need, this pulls in all the files and
deps (shared libs, mostly).  The build is slower but the final image is
85 MB (versus 157 MB before).  e2e passes.  Hopefully less CVE surface.

This is based on scripts used in kubernetes and KinD.
2023-06-12 12:21:51 -07:00
Tim Hockin 1894192b0f Run hooks at startup
This ensures we do not miss events.  E.g.

before:
    t0: hash changes to X
    t1: send webhook(X), waiting for response
    t2: hash changes to Y
    t3: queue next webhook(Y) but can't send because previous is not done
    t4: crash
    t5: restart
    t6: find repo at hash Y

    no webhook(Y) was sent.

after:
    t0: hash changes to X
    t1: send webhook(X), waiting for response
    t2: hash changes to Y
    t3: queue next webhook(Y) but can't send because previous is not done
    t4: crash
    t5: restart
    t6: find repo at hash Y
    t7: send webhook(Y), waiting for response
2023-05-29 14:50:24 -07:00
Tim Hockin a4afa2f438 Improve logging levels a bit 2023-05-26 09:04:55 -07:00
Tim Hockin 7797e5d0e3 Log actual flags rather than args+env 2023-05-24 10:52:39 -07:00
Tim Hockin 9318041657 Better logging around hooks
This also returns stderr distinct from stdout.
2023-05-24 10:52:21 -07:00
Tim Hockin ed170912c9 Move main.go to root of repo
This allows `go install k8s.io/git-sync` which I like.
2023-05-22 08:40:24 -07:00
Tim Hockin f3565bf410 Move flag defs into main() 2023-05-16 16:11:03 -07:00
Tim Hockin 8ee0f7ef9a Update README and other docs 2023-05-16 16:10:50 -07:00
Tim Hockin e15c7a9695 Tighten up cleanup to be called once per loop 2023-05-16 16:10:23 -07:00
Tim Hockin 451ac415ea Add a unit test for touch() 2023-05-16 16:10:07 -07:00
Tim Hockin c3a49e9d46 Get rid of "must not start with ." logic
It serves very little purpose and isn't even correct as-is.
2023-05-14 11:11:24 -07:00
Tim Hockin ff1a913bab Reorganize flag definitions 2023-05-14 11:10:17 -07:00
Kubernetes Prow Robot e1c7c63987
Merge pull request #715 from sviscaino/add-keep-worktrees-option
Add --stale-worktree-timeout option
2023-05-14 11:07:27 -07:00
Sacha Viscaino 622ced3864 Add --stale-worktree-timeout option 2023-05-14 00:28:29 +01:00
Tim Hockin 4b7b68d34c EOL the `--change-permissions` flag
This is a breaking change.  The `--change-permissions` flag was too
coarse (e.g. changed directories and files alike) and not expressive (no
way to say "g+w").

I doubt if anyone was using it, and if they were, the new
`--group-write` is almost certainly what they want.
2023-05-11 09:42:20 -07:00
Tim Hockin 58cab771fc e2e: Fix weirdly quoted strings
I have been meaning to do this forever.
2023-05-11 09:42:05 -07:00
Tim Hockin ca36eb5733 Sort deprecated flag vars 2023-05-08 15:51:36 -07:00
Tim Hockin a16175f4e3 Rename deprecated flag vars 2023-05-08 15:51:36 -07:00
Tim Hockin 12c1ece35f Support in-place updates from v3
A few small accomodations and we can clean up properly.
2023-05-08 15:51:23 -07:00
Tim Hockin 7eaba7605a Rename metric variables 2023-05-08 15:51:16 -07:00
Tim Hockin d197740d85 Exercise the git "dubious ownership" path
To do this, we run the e2e test as a different user.  To do that, we
need git-sync to make sure that everything is group accessible.  To
clean up after the test, we need everything to be group writable.  To do
that, we add a new flag: `--group-write`.
2023-05-07 10:29:39 -07:00
Tim Hockin 45c7b89674 V4: prevent git's 'dubious ownership' error 2023-05-07 10:29:39 -07:00
Tim Hockin f287d63171 Fetch just once per run and when hash changes 2023-05-07 10:29:31 -07:00
Kubernetes Prow Robot edcf77bde2
Merge pull request #730 from thockin/v4_go_1_20
Update to go 1.20
2023-05-05 14:51:16 -07:00
Tim Hockin e033732c3c Use absPath type for link and touchfile 2023-05-05 13:30:11 -07:00
Tim Hockin 6cd8b5a1cf Add an absPath type and use it for git.root 2023-05-05 13:30:11 -07:00
Tim Hockin fd0ec2131b
Update to go 1.20 2023-05-05 13:27:36 -07:00
Tim Hockin 64ed3bb5a7 Capture and simplify a git.Run() method 2023-05-04 17:42:08 -07:00
Tim Hockin 0bd5f19ac0 Make flag defs easier to read 2023-05-04 17:39:31 -07:00
Tim Hockin 7e6b429362 Make all env var names GITSYNC_FOO
Still support GIT_SYNC_FOO for compat.
2023-05-04 08:45:25 -07:00
Tim Hockin 5cc7160985 Clean up all old worktrees 2023-05-04 08:45:13 -07:00
Tim Hockin 10af97f51d Move worktrees to .worktrees/*
This will make it easier to enumerate old worktrees and do better
cleanup.
2023-04-29 10:51:13 -07:00
Tim Hockin 988bfb7a01 e2e: handle log capture automatically
Same as test_git.sh
2023-04-29 10:44:07 -07:00
Tim Hockin 7370e9dc6f Back-compat for --v usage 2023-04-29 10:42:52 -07:00
Tim Hockin 707d527e03 Add a doc about changing from v3 to v4 2023-04-29 10:42:26 -07:00
Tim Hockin e84a4cb4fd Make --webhook-success-status=0 the same as -1 2023-04-29 10:40:53 -07:00
Tim Hockin 20ed7df894 Makefile: set GOOS,GOARCH defaults to kill warning 2023-04-29 10:39:07 -07:00
Tim Hockin cbedbc0ca5 Add test for repo size and change default GC
--git-gc=always seems to be the right tradeoff.
2023-04-28 14:07:54 -07:00
Tim Hockin dc56d5d6bf Tidy up log levels - logs read better now 2023-04-28 14:07:42 -07:00
Tim Hockin f6678b98e8 Change the default depth to 1
For most users this is functionally equivalent and more efficient.  For
users who really need the full history, set this to 0.
2023-04-28 14:07:35 -07:00
Tim Hockin 76e91a2304 Fine tune git command verbosity flags 2023-04-28 14:07:18 -07:00