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

[6.1.0]Do not recommend shallow_since for git_repository #17465

Merged
merged 5 commits into from
Feb 16, 2023
Merged

[6.1.0]Do not recommend shallow_since for git_repository #17465

merged 5 commits into from
Feb 16, 2023

Conversation

ShreeM01
Copy link
Contributor

Git's --shallow-since feature can lead to broken checkouts and a fix isn't likely to happen: https://public-inbox.org/git/CAPSG9dZV2EPpVKkOMcjv5z+NF7rUu=V-ZkZNx47rCv122HsiKg@mail.gmail.com/T/#u

This commit removes shallow_since from the canonical reproducible form of git_repository unless the attribute is provided explicitly. In cases where Bazel's attempt at fetching with --depth=1 fail, e.g. if there is no server support for shallow fetches of arbitrary commits, the progress message is now used to inform the user about this potential for fetch time optimizations.

Fixes #10292
Fixes #12857

Closes #17356.

PiperOrigin-RevId: 508569071
Change-Id: I01e6662e38c236d1800d427f66d48a05df818800

Git's `--shallow-since` feature can lead to broken checkouts and a fix isn't likely to happen:
https://public-inbox.org/git/CAPSG9dZV2EPpVKkOMcjv5z+NF7rUu=V-ZkZNx47rCv122HsiKg@mail.gmail.com/T/#u

This commit removes `shallow_since` from the canonical reproducible form of `git_repository` unless the attribute is provided explicitly. In cases where Bazel's attempt at fetching with `--depth=1` fail, e.g. if there is no server support for shallow fetches of arbitrary commits, the progress message is now used to inform the user about this potential for fetch time optimizations.

Fixes #10292
Fixes #12857

Closes #17356.

PiperOrigin-RevId: 508569071
Change-Id: I01e6662e38c236d1800d427f66d48a05df818800
@sgowroji sgowroji added team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website awaiting-review PR is awaiting review from an assigned reviewer labels Feb 11, 2023
@keertk keertk requested a review from Wyverald February 14, 2023 22:47
@ShreeM01 ShreeM01 enabled auto-merge (squash) February 15, 2023 18:13
@ShreeM01 ShreeM01 merged commit dfd19f6 into bazelbuild:release-6.1.0 Feb 16, 2023
primiano pushed a commit to google/perfetto that referenced this pull request Apr 17, 2023
…nterproductive

Historically, shallow_since was supposed to help avoid a full repository
clone when only a single commit is necessary (apparently it's not as
simple as clone --depth=1 for commits that aren't a branch or a tag).

But the option has known edge cases and is now discouraged:
bazelbuild/bazel#17465.

Further, as far as I can tell individual-commit fetches are properly
supported under v2 git protocol. I can't figure out how to properly
trace the git commands that bazel issues, but a manual v2 fetch against
the AOSP gerrit succeeded (per GIT_TRACE_PACKET), so I hope that bazel
will end up on v2 as well.

So my plan is to submit this and see if CI fetch flakes go away. If not
or we see evidence of full-repo clone fallback kicking in, I'll
investigate further.

Change-Id: I9d6fc5f373a84fdc434b841dbc0575fe3123dd5b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants