Skip to content

fix(dotgit): set publicheads correctly for transparent git mode#969

Open
vegerot wants to merge 1 commit into
facebook:mainfrom
vegerot:pr969
Open

fix(dotgit): set publicheads correctly for transparent git mode#969
vegerot wants to merge 1 commit into
facebook:mainfrom
vegerot:pr969

Conversation

@vegerot

@vegerot vegerot commented Oct 22, 2024

Copy link
Copy Markdown
Contributor

Summary:
0ce7010 taught Sapling to use the correct public head based on the upstream
default branch. However, this doesn't work when using the transparent git mode
through git clone.

This diff will correctly set the publicheads config when initializing sapling

Test Plan: see test-git-clone-sets-publicheads.t

Summary:
0ce7010 taught Sapling to use the correct public head based on the upstream
default branch.  However, this doesn't work when using the transparent git mode
through `git clone`.

This diff will correctly set the publicheads config when initializing sapling

Test Plan: see test-git-clone-sets-publicheads.t
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

let config = String::from_utf8(out.stdout)?;
let remotes_out = self
.git_cmd(
"ls-remote", &["--symref", ".", "HEAD"])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This performs a network call, which might be unexpected or undesirable.

How about parsing the output of git rev-parse --symbolic refs/remotes/origin/HEAD instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea! If it's as robust as ls-remote then this will save a network call.

@quark-zju quark-zju Oct 22, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can use lookup_reference to resolve the reference without the spawning process overhead.

facebook-github-bot pushed a commit that referenced this pull request Jul 10, 2025
Summary:
@public
1.0.2 comes with a vulnerable idna.

v2.5.4 Latest
Revert "Normalize URL paths: convert /.//p, /..//p, and //p to p (#943)" by valenting in #999
Updates the MSRV to 1.63 required though the libc v0.2.164 dependency

v2.5.3
fix: enable wasip2 feature for wasm32-wasip2 target by brooksmtownsend in #960
Fix idna tests with no_std by cjwatson in #963
Fix debugger_visualizer test failures. by valenting in #967
Add AsciiSet::EMPTY and boolean operators by joshka in #969
mention why we pin unicode-width by Manishearth in #972
refactor and add tests for percent encoding by joshka in #977
Add a test for and fix issue #974 by hansl in #975
no_std support for the url crate by domenukk in #831
Normalize URL paths: convert /.//p, /..//p, and //p to p by theskim in #943
support Hermit by m-mueller678 in #985
fix: support wasm32-wasip2 on the stable channel by brooksmtownsend in #983
Improve serde error output by konstin in #982
OSS-Fuzz: Add more fuzzer by arthurscchan in #988
Merge idna-v1x to main by hsivonen in #990

What's Changed
fix: enable wasip2 feature for wasm32-wasip2 target by brooksmtownsend in #960
Fix idna tests with no_std by cjwatson in #963
Fix debugger_visualizer test failures. by valenting in #967
Add AsciiSet::EMPTY and boolean operators by joshka in #969
mention why we pin unicode-width by Manishearth in #972
refactor and add tests for percent encoding by joshka in #977
Add a test for and fix issue #974 by hansl in #975
no_std support for the url crate by domenukk in #831
Normalize URL paths: convert /.//p, /..//p, and //p to p by theskim in #943
support Hermit by m-mueller678 in #985
fix: support wasm32-wasip2 on the stable channel by brooksmtownsend in #983
Improve serde error output by konstin in #982
OSS-Fuzz: Add more fuzzer by arthurscchan in #988
Merge idna-v1x to main by hsivonen in #990

Reviewed By: dtolnay

Differential Revision: D78043174

fbshipit-source-id: 93ca32d2a17f6cf3662055050ef77b1906edcdae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants