Skip to content

Support shallow sync when the rev is not in-range#615

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
thockin:fetch_if_depth_and_rev_not_found
Aug 30, 2022
Merged

Support shallow sync when the rev is not in-range#615
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
thockin:fetch_if_depth_and_rev_not_found

Conversation

@thockin
Copy link
Copy Markdown
Member

@thockin thockin commented Aug 20, 2022

If I ask for --depth 1 and a branch, it's fine.

If I ask for --depth 1 and a tag, and that tag is not within 1 commit
of the branch that was cloned, it will give an error. Oddly, if the
initial clone was OK, and subsequent syncs drift, it is OK, because of
how we fetch. But if it is too far away at the beginning, kaboom.

This betrays that the current model of --branch and --rev is really
broken, and should be revamped. For now, I did something simple - if
the rev can't be found, try a fetch. A "real" fix is more involved.

Also add tests.

Fixes #601

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 20, 2022
@k8s-ci-robot k8s-ci-robot requested review from nan-yu and stp-ip August 20, 2022 21:53
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 20, 2022
If I ask for `--depth 1` and a branch, it's fine.

If I ask for `--depth 1` and a tag, and that tag is not within 1 commit
of the branch that was cloned, it will give an error.  Oddly, if the
initial `clone` was OK, and subsequent syncs drift, it is OK, because of
how we `fetch`.  But if it is too far away at the beginning, kaboom.

This betrays that the current model of `--branch` and `--rev` is really
broken, and should be revamped.  For now, I did something simple - if
the rev can't be found, try a fetch.  A "real" fix is more involved.

Also add tests.
@thockin thockin force-pushed the fetch_if_depth_and_rev_not_found branch from cd4d4e3 to ff0a73f Compare August 20, 2022 22:41
Copy link
Copy Markdown
Member

@stp-ip stp-ip left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 30, 2022
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: stp-ip, thockin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 6e03c52 into kubernetes:master Aug 30, 2022
@thockin thockin deleted the fetch_if_depth_and_rev_not_found branch February 25, 2023 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download / Pull a specific tag with git-sync

3 participants