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

Support force-pushed repos with git-fetch-with-cli. #6800

Merged
merged 1 commit into from
Apr 1, 2019

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Mar 31, 2019

If a git repo had a force push, then the git-fetch-with-cli feature would fail to fetch an update. This adds the --force flag to force the fetch. There's a bit of a lengthy discussion in the git docs about why this is needed when a refspec is supplied.

I also changed it to remove the --quiet flag and to capture the output, which is only displayed on error. I'm not sure what the reasoning for the --quiet flag was, but I don't see any harm since the output was previously unused. This can maybe help people debug problems, however in this situation
all you would see is ! [rejected] master -> master (non-fast-forward) which isn't terribly informative.

Fixes #6795.

@rust-highfive
Copy link

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2019
@sfackler
Copy link
Member

Thanks!

I think even the ! [rejected] ... output is valuable here, since you'd at least know it wasn't a network error or something like that.

@alexcrichton
Copy link
Member

@bors: r+

Thanks for fixing this @ehuss!

FWIW I explicitly didn't want to suppress the output of git and make sure that all errors were printed, but it looks like --quiet was a little too aggressive about being quiet. In any case I think this is a better approach all around :)

@bors
Copy link
Collaborator

bors commented Apr 1, 2019

📌 Commit 1667b75 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 1, 2019
@bors
Copy link
Collaborator

bors commented Apr 1, 2019

⌛ Testing commit 1667b75 with merge 7ea3505ebd94822bed52aefc6f254282956de0d6...

@bors
Copy link
Collaborator

bors commented Apr 1, 2019

💔 Test failed - checks-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 1, 2019
@alexcrichton
Copy link
Member

@bors: retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 1, 2019
@bors
Copy link
Collaborator

bors commented Apr 1, 2019

⌛ Testing commit 1667b75 with merge d04d75b...

bors added a commit that referenced this pull request Apr 1, 2019
Support force-pushed repos with git-fetch-with-cli.

If a git repo had a force push, then the `git-fetch-with-cli` feature would fail to fetch an update.  This adds the `--force` flag to force the fetch.  There's a bit of a lengthy discussion in the [git docs](https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt-ltrefspecgt) about why this is needed when a refspec is supplied.

I also changed it to remove the `--quiet` flag and to capture the output, which is only displayed on error.  I'm not sure what the reasoning for the `--quiet` flag was, but I don't see any harm since the output was previously unused.  This can maybe help people debug problems, however in this situation
all you would see is ` ! [rejected]        master     -> master  (non-fast-forward)` which isn't terribly informative.

Fixes #6795.
@bors
Copy link
Collaborator

bors commented Apr 1, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: alexcrichton
Pushing d04d75b to master...

@bors bors merged commit 1667b75 into rust-lang:master Apr 1, 2019
Centril added a commit to Centril/rust that referenced this pull request Apr 5, 2019
Update cargo

20 commits in
63231f438a2b5b84ccf319a5de22343ee0316323..6f3e9c367abb497c64f360c3839dab5e74928d5c
2019-03-27 12:26:45 +0000 to 2019-04-04 14:11:33 +0000
- Fix Init for Fossil SCM project (rust-lang/cargo#6792)
- Fix member_manifest_version_error accessing the network (rust-lang/cargo#6799)
- Don't include email if it is empty (rust-lang/cargo#6802)
- Fix unused import warning (rust-lang/cargo#6807)
- Add some help and documentation for unstable flags (rust-lang/cargo#6791)
- Allow `cargo doc --open` with multiple packages (rust-lang/cargo#6803)
- Allow `cargo install --path P` to load config from P (rust-lang/cargo#6804)
- Add more suggestions on how to deal with excluding a package from a workspace (rust-lang/cargo#6805)
- Warn on version req with metadata (rust-lang/cargo#6806)
- cargo install: Be more restrictive about cli flags (rust-lang/cargo#6801)
- Support force-pushed repos with git-fetch-with-cli (rust-lang/cargo#6800)
- Cargo clippy (rust-lang/cargo#6759)
- Don't include metadata in wasm binary examples (rust-lang/cargo#6812)
- Update glossary for `feature` (rust-lang/cargo#6809)
- Include proc-macros in `build-override` (rust-lang/cargo#6811)
- Resolver: A dep is equivalent to one of the things it can resolve to (rust-lang/cargo#6776)
- Add some docs for `Downloads` (rust-lang/cargo#6815)
- Resolve: Be less strict while offline (rust-lang/cargo#6814)
- Accept trailing comma in test of impl Debug for PackageId (rust-lang/cargo#6818)
- Fix doc link (rust-lang/cargo#6820)

<br>

I specifically care about "Accept trailing comma in test of impl Debug for PackageId (rust-lang/cargo#6818)" to unblock rust-lang#59076.

Mentioning @ehuss.
bors added a commit to rust-lang/rust that referenced this pull request Apr 5, 2019
Update cargo

20 commits in
63231f438a2b5b84ccf319a5de22343ee0316323..6f3e9c367abb497c64f360c3839dab5e74928d5c
2019-03-27 12:26:45 +0000 to 2019-04-04 14:11:33 +0000
- Fix Init for Fossil SCM project (rust-lang/cargo#6792)
- Fix member_manifest_version_error accessing the network (rust-lang/cargo#6799)
- Don't include email if it is empty (rust-lang/cargo#6802)
- Fix unused import warning (rust-lang/cargo#6807)
- Add some help and documentation for unstable flags (rust-lang/cargo#6791)
- Allow `cargo doc --open` with multiple packages (rust-lang/cargo#6803)
- Allow `cargo install --path P` to load config from P (rust-lang/cargo#6804)
- Add more suggestions on how to deal with excluding a package from a workspace (rust-lang/cargo#6805)
- Warn on version req with metadata (rust-lang/cargo#6806)
- cargo install: Be more restrictive about cli flags (rust-lang/cargo#6801)
- Support force-pushed repos with git-fetch-with-cli (rust-lang/cargo#6800)
- Cargo clippy (rust-lang/cargo#6759)
- Don't include metadata in wasm binary examples (rust-lang/cargo#6812)
- Update glossary for `feature` (rust-lang/cargo#6809)
- Include proc-macros in `build-override` (rust-lang/cargo#6811)
- Resolver: A dep is equivalent to one of the things it can resolve to (rust-lang/cargo#6776)
- Add some docs for `Downloads` (rust-lang/cargo#6815)
- Resolve: Be less strict while offline (rust-lang/cargo#6814)
- Accept trailing comma in test of impl Debug for PackageId (rust-lang/cargo#6818)
- Fix doc link (rust-lang/cargo#6820)

<br>

I specifically care about "Accept trailing comma in test of impl Debug for PackageId (rust-lang/cargo#6818)" to unblock #59076.

Mentioning @ehuss.
@ehuss ehuss added this to the 1.35.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cargo fails to update force-pushed git repositories when git-fetch-with-cli is enabled
6 participants