-
Notifications
You must be signed in to change notification settings - Fork 365
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
opam source --dev
fetching git repositories without --depth 1
#5888
Conversation
bcef852
to
deca4d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for the code, apart from the few cosmetic changes pointed below.
However I feel like this type of change (especially when dealing with optional arguments) warrants some addition to the testsuite, so that regressions do not happen in the future. Would it be possible to add one? If so DM me and i can help you navigate in the testsuite.
@moyodiallo you seem to have lost all of your changes except the first commit in the rebase somehow. You can get them back from 2469168 |
Done, I was reorganizing it a bit. It's done and ready for an ultimate review. |
EDIT: Nevermind I'm seeing it now. Sorry for the noise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this first PR!
On the idea, and general implementation, it is good.
I've left some comments, most of them concern the "coding style" of this repository.
deph 1
could be avoided--depth 1
could be avoided
src/repository/opamVCS.ml
Outdated
if VCS.exists repo_root then | ||
OpamProcess.Job.catch (fun e -> Done (OpamRepositoryBackend.Update_err e)) | ||
@@ fun () -> | ||
OpamRepositoryBackend.job_text repo_name "sync" | ||
(VCS.fetch ?cache_dir repo_root repo_url) | ||
(VCS.fetch ?full_fetch ?cache_dir repo_root repo_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjbou like this?
(VCS.fetch ?full_fetch ?cache_dir repo_root repo_url) | |
(VCS.fetch ~full_fetch:false ?cache_dir repo_root repo_url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linked to this #5888 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really. My comment was linked to a discussion during the dev meeting where we wondered if ?full_fetch
should be given explicitly or if it should be omitted when applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kit-ty-kate did you want to keep full_fetch:false
for fetch_repo_update
that is used opam opam repo updates ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer personally but as you wish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for me in that case :) It is a good safeguard regarding current opam repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add it
tests/reftests/repository.test
Outdated
@@ -316,8 +316,13 @@ first -- | |||
### git -C ./OPER add repo | |||
### git -C ./OPER add packages/first | |||
### git -C ./OPER commit -qm "third" | |||
### git -C ./OPER commit --allow-empty -m "second empty commit" --quiet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is no more needed too, as everything is seen in source
test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was commented by @kit-ty-kate. It's about avoiding regression in the future. Maybe we could refactor it like source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 29bc4a5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it not needed? I'm not seeing that test in source.test
(which also isn't really the place to test for this if it was there)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I've just realized that I'm mixing everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kit-ty-kate what is the purpose of this test ? I'm guessing that it is to be sure that opam repo download is kept with --depth 1
, is it? Its code path remain untouched, but indeed it calls VCS.fetch
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah exactly. So that if in the future the behaviour changes (by mistake or on purpose) we already have a test for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok! It needs then a comment to explain why it is here. I'll add it.
--depth 1
could be avoidedopam source --dev
fetching git repositories without --depth 1
… when retrieved with `opam source --dev`, and no change for opam repository checkout Co-authored-by: Raja Boujbel <raja.boujbel@ocamlpro.com> Co-authored-by: Kate <kit-ty-kate@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks a lot! |
This PR is about to fix #5061. It turns out we doesn't need a flag for fixing the issue, It is agreed during the
opam-dev
meeting to avoid fetching with--depth 1
foropam source
because on the client side it could be confusing, an idea from @kit-ty-kate.Add an flag foropam source
client--deph 1
free when fetching source from dev_repo.test
foropam source
commandopam repository
command, to be sure the behavior remains unchanged.