Merged
Conversation
Collaborator
|
r? @epage (rustbot has picked a reviewer for you, use r? to override) |
epage
reviewed
May 30, 2023
epage
reviewed
May 30, 2023
e2c61e9 to
f3653c8
Compare
Member
Author
|
@bors try |
Contributor
Contributor
|
💥 Test timed out |
Member
Author
|
All checks have passed but bors timed out. I have no idea. @bors try |
Contributor
Contributor
|
💥 Test timed out |
For being consistent with `GitDatabase`.
`orig_url` was unclear. Whose origin? `remote_url` is way more self-explanatory under a `git fetch` context.
The explanation is moved to be public from an inline comment.
Although this is only a few lines of code, I think it is still worth keeping it clean if it's not used by Cargo internally. Not to mention this apparently has an alternative solution at this moment, for example: ```diff - let oid = git_remote.rev_for(db_path, git_ref)?; + let oid = git_remote.db_at(db_path)?.resolve(git_ref)?; ``` From a naive research on GitHub, there is only one usage[^1] and it seems to be active but still experimental. Pardon my abrupt change breaking your project :( Only when we start considering what we want to expose can Cargo has a clearer boundaries between its subcrates. [^1]: https://github.com/trustification/source-distributed/blob/124ef26081a41330a553483441fca544bedbb473/src/git.rs#L34
It doesn't seem that they need to derive `Serialize`. Is there any other usage I am not aware of?
It was confusing and may lead to inconsistency that people need to pass both `path` and `repo` and ensure they are in sync.
This should be less controversial as the current logic share the same `GitRemote`. You can see the callsite of `GitDatabase::copy_to` use `self.url()`, which then calls into `self.remote.url(). When a `GitDatabase` is created, Cargo also uses `self.remote` as the remote of that `GitDatabase`.
f3653c8 to
88845b9
Compare
Member
Author
|
@epage. I believe this is ready. Do you have any concern with it? |
Contributor
|
Sorry, missed that this was now ready @bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
Contributor
|
☀️ Test successful - checks-actions |
Contributor
|
👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request. |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jun 10, 2023
Update cargo 12 commits in b0fa79679e717cd077b7fc0fa4166f47107f1ba9..49b6d9e179a91cf7645142541c9563443f64bf2b 2023-06-03 14:19:48 +0000 to 2023-06-09 17:21:19 +0000 - docs: doc comments for all registry kinds (rust-lang/cargo#12247) - chore: Migrate print-ban from test to clippy (rust-lang/cargo#12246) - fix: fetch nested git submodules (rust-lang/cargo#12244) - refactor: registry source cleanup (rust-lang/cargo#12240) - test: loose overly matches for git cli output (rust-lang/cargo#12241) - fix: disable multiplexing on macOS for some versions of curl (rust-lang/cargo#12234) - docs: doc comments for registry source and index (rust-lang/cargo#12239) - doc: point to nightly cargo doc (rust-lang/cargo#12237) - Upgrade to `gix` v0.45 for multi-round pack negotiations. (rust-lang/cargo#12236) - refactor: git source cleanup (rust-lang/cargo#12197) - Add message on reusing previous temporary path on failed cargo installs (rust-lang/cargo#12231) - doc: the first line should be a simple sentence instead of a heading (rust-lang/cargo#12228) r? `@ghost`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
I found some places can do minor refactors during documenting those items last week.
How should we test and review this PR?
Commit by commit. Each has its own explanation.
I believe the first four is not controversial. However, the last three do need to scrutinize
Serialize. Did I miss some important contexts?repoandpathshould always be in sync so there is no need to have two arguments. However,git2::Repository::path()force UTF8 path on Windows. Will it cause any problem? I guess it may not since we already userepo.path()somewhere in the codebase.Additional information