Skip to content

pub get on a commit that's not on a branch #2543

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

Closed
dcharkes opened this issue Jun 29, 2020 · 6 comments
Closed

pub get on a commit that's not on a branch #2543

dcharkes opened this issue Jun 29, 2020 · 6 comments
Labels
needs-info Additional information needed from the issue author

Comments

@dcharkes
Copy link
Contributor

See flutter/flutter#60504.

pub get on a commit that's not on a branch (in this case after history was rewritten on purpose).

Should pub support commits that are not on a branch and might be GCed?

@sigurdm sigurdm added the needs-info Additional information needed from the issue author label Jul 28, 2020
@sigurdm
Copy link
Contributor

sigurdm commented Jul 28, 2020

Not sure I fully understand the issue.

Why should pub get not support a commit that is not a branch? I would imagine that makes git bisect next-to-impossible.
And how would that work if you are not using git?

...Or is this about git dependencies? Even those I would be highly annoyed if not everything supported by git as a valid ref was supported.

@dcharkes
Copy link
Contributor Author

flutter/flutter#60507.

Maybe it should be documented that pub requires to be on a valid branch, due to some internal logic that is required to do pub stuff.

@sigurdm
Copy link
Contributor

sigurdm commented Jul 28, 2020

How would pub know if a ref is on a branch?

@sigurdm
Copy link
Contributor

sigurdm commented Jul 28, 2020

due to some internal logic that is required to do pub stuff.

Still not sure I follow. Pub has (or should have) exactly the same requirements for git refs as git itself.
if you can git co it, you can have a dependency on it.

If a commit gets garbage collected that is the same issue as for all of git.

@dcharkes
Copy link
Contributor Author

Yes, so it is not supported to have a non-branch commit checked out and run pub get.

But this happens in the wild, e.g. people rewrite their histories. And then pub get retries forever. Maybe we should improve the error message in that situation instead of retrying forever: https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8876208526460077424/+/steps/flutter_update-packages/0/stdout

@sigurdm
Copy link
Contributor

sigurdm commented Jul 28, 2020

Maybe we should improve the error message in that situation instead of retrying forever:

Ah - I had not understood that it would retry forever.
Yes, that should be fixed! Probably it is a duplicate of: #2242 and the retry is actually a hack in the flutter tool, not in pub itself.

@sigurdm sigurdm closed this as completed Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Additional information needed from the issue author
Projects
None yet
Development

No branches or pull requests

2 participants