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

4.0.0: git_repository patch_cmds can no longer inspect git references #12953

Closed
dmivankov opened this issue Feb 3, 2021 · 3 comments
Closed
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: support / not a bug (process)

Comments

@dmivankov
Copy link
Contributor

Description of the problem / feature request:

Using commands like patch_cmds = ["git ... origin/smth .. HEAD^"] worked in 3.3.1 but broke in 4.0.0

Error in fail: Error applying patch command git merge-base --is-ancestor HEAD^ HEAD:
fatal: Not a valid object name HEAD^

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

WORKSPACE

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
    name = "skylib_git",
    commit = "f80bc733d4b9f83d427ce3442be2e07427b2cc8d",
    patch_cmds = [
        "git merge-base --is-ancestor origin/buildifier HEAD || true",  # more complex case that also used to work
        "git merge-base --is-ancestor HEAD^ HEAD"  # simpler case
    ],
    remote = "https://github.com/bazelbuild/bazel-skylib.git",
)

This was useful to make assertions on commits, like commit is successor (or ancestor) of certain branches. This isn't super important case (going away from git_repository to http_archive is said to be faster/more cacheable) but still a breaking change going from 3.3.1 to 4.0.0

What operating system are you running Bazel on?

NixOS

What's the output of bazel info release?

4.0.0

Any other information, logs, or outputs that you want to share?

#12455

@dmivankov
Copy link
Contributor Author

Likely caused by #10137
and related to #8969
I'm not sure it qualifies as a non-breaking change

@oquenchil oquenchil added team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged type: support / not a bug (process) labels Feb 4, 2021
@philwo philwo added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Feb 8, 2021
@github-actions
Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 2+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Apr 28, 2023
@github-actions
Copy link

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team (@bazelbuild/triage). Thanks!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: support / not a bug (process)
Projects
None yet
Development

No branches or pull requests

3 participants