Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added submodule support #62

Closed
wants to merge 1 commit into from
Closed

added submodule support #62

wants to merge 1 commit into from

Conversation

japettyjohn
Copy link

Added option to init and update submodules. If depth is specified it uses shallow submodules.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 2, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@thockin
Copy link
Member

thockin commented Jun 3, 2017

I don't see anything wrong with this, but I don't know submodules well. Can you add a set of cases to the test_e2e.sh to demonstrate this?

@thockin
Copy link
Member

thockin commented Jun 3, 2017

also, you need to sign the CLA :)

@stp-ip
Copy link
Member

stp-ip commented Jun 7, 2017

From a submodule perspective it looks good. Waiting for some test cases and the CLA.

@abh
Copy link

abh commented Sep 22, 2017

FWIW this is working well for me -- I made a build at quay.io/abh/git-sync:v2.0.5-submodule

@japettyjohn
Copy link
Author

@abh That's great to hear. I've been running with success as well for some months, I haven't gotten around to implementing shallow checkouts though which would help a lot for large/ancient dependencies and make it consistent with the top level checkout features.

@abh abh mentioned this pull request Nov 13, 2017
@thockin
Copy link
Member

thockin commented Nov 14, 2017

Sorry for letting this languish. It looks overall ok, but it needs an e2e test, please?

@@ -54,6 +54,8 @@ var flWait = flag.Float64("wait", envFloat("GIT_SYNC_WAIT", 0),
"the number of seconds between syncs")
var flOneTime = flag.Bool("one-time", envBool("GIT_SYNC_ONE_TIME", false),
"exit after the initial checkout")
var flSubmodule = flag.Bool("submodule", envBool("GIT_SYNC_SUBMODULE", false),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the flag be "submodules" ?

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 12, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 14, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@abh
Copy link

abh commented May 7, 2018

@japettyjohn any chance of resurrecting this so it can be merged? :-)

@StephenWithPH
Copy link

@abh ... I'd like to hear more about how it's working for you.

Background: I took a stab at adding E2E tests to cover @japettyjohn 's work. The code works as expected in the repo itself, but it does not work down the symlinked-path. My tests are failing, since I'm expecting the submodule in the symlinked path.

As I understand it, the symlinked path is what is supposed to matter; from the docs:

When it re-pulls, it updates the destination directory atomically. In order to do this, it uses a git worktree in a subdirectory of the --root and flips a symlink

In the tree below, ottherrepo is submoduled inside of repo. The code runs and does pull it down (main.go:465] run("/tmp/git-sync-test.14210/root/rev-e9fc17a57997bad70aafe925b73054100ef61878"): git submodule update --init), but none of this makes it to the worktree where it counts (main.go:465] run("/tmp/git-sync-test.14210/root"): git worktree add /tmp/git-sync-test.14210/root/rev-e9fc17a57997bad70aafe925b73054100ef61878 origin/master).

git-sync-test.14210 $ tree
.
├── log.branch-sync
├── log.cross-branch-tag-sync
├── log.default-sync
├── log.head-once
├── log.head-sync
├── log.rev-once
├── log.rev-sync
├── log.submodule
├── log.tag-sync
├── otherrepo
│   └── otherfile
├── repo
│   ├── file
│   └── otherrepo
│       └── otherfile
└── root
    ├── repo -> rev-e9fc17a57997bad70aafe925b73054100ef61878
    └── rev-e9fc17a57997bad70aafe925b73054100ef61878
        └── file

https://git-scm.com/docs/git-worktree tells me that:

BUGS
Multiple checkout in general is still experimental, and the support for submodules is incomplete. It is NOT recommended to make multiple checkouts of a superproject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants