Skip to content

Commit

Permalink
Disable shallow clone by default except for opam repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Aug 8, 2024
1 parent 6effccc commit 0ad26df
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ users)
* Make fetching an archive from cache add missing symlinks [#6068 @kit-ty-kate - fix #6064]
* [BUG] Fix `opam install --deps-only` set direct dependencies as root packages [#6125 @rjbou]
* [BUG] Fix `opam install --check pkg` when pkg depends on a non-existing package [#6121 @kit-ty-kate]
* Disable shallow clone by default except for opam repositories [#6146 @kit-ty-kate - fix #6145]

## Build (package)
* ◈ Add `--verbose-on` option to enable verbose mode on specified package names [#5682 @desumn @rjbou]
Expand Down Expand Up @@ -179,6 +180,7 @@ users)

## opam-repository
* `OpamRepository.fetch_from_cache`: when an archive is found, add a symlink (or copy) for the ones found in opam file but not in cache [#6068 @kit-ty-kate]
* `?full_fetch` is now `true` by default instead of `false` [#6146 @kit-ty-kate - fix #6145]

## opam-state
* `OpamStateConfig.opamroot_with_provenance`: restore previous behaviour to `OpamStateConfig.opamroot` for compatibility with third party code [#6047 @dra27]
Expand Down
2 changes: 1 addition & 1 deletion src/repository/opamGit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module VCS : OpamVCS.VCS = struct
| Some h -> "refs/remotes/opam-ref-"^h
| None -> "refs/remotes/opam-ref"

let fetch ?(full_fetch = false) ?cache_dir ?subpath repo_root repo_url =
let fetch ?(full_fetch = true) ?cache_dir ?subpath repo_root repo_url =
(match subpath with
| Some sp ->
git repo_root [ "config"; "--local"; "core.sparseCheckout"; "true" ]
Expand Down
4 changes: 2 additions & 2 deletions src/repository/opamRepository.mli
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ val pull_shared_tree:
url list -> string download OpamProcess.job

(* Same as [pull_shared_tree], but for a unique label/dirname.
If [full_fetch] is true, VCS repository is retrieved with full history (by
default, no history). *)
If [full_fetch] is set to false, VCS repository is retrieved with shallow
history (by default, full history). *)
val pull_tree:
string -> ?full_fetch:bool -> ?cache_dir:dirname -> ?cache_urls:url list ->
?working_dir:bool -> ?subpath:subpath ->
Expand Down
4 changes: 2 additions & 2 deletions src/repository/opamRepositoryBackend.mli
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ module type S = sig
[checksum] can be used for retrieval but is NOT checked by this
function.
If [full_fetch] is set to true, VCS repository is retrieved with full
history (by default, no history).
If [full_fetch] is set to false, VCS repository is retrieved with shallow
history (by default, full history).
If [cache_dir] is given, the directory is used by VCS tool as a its cache
directory.
If [subpath] is given, only that [subpath] of the url is retrieved. *)
Expand Down
4 changes: 2 additions & 2 deletions src/repository/opamVCS.mli
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ module type VCS = sig
Be aware that the remote URL might have been changed, so make sure
to update accordingly.
If [full_fetch] is set to true, VCS repository is retrieved with full
history (by default, no history).
If [full_fetch] is set to false, VCS repository is retrieved with shallow
history (by default, full history).
If [cache_dir] is given, the directory is used by VCS tool as a its cache
directory.
If [subpath] is given, only that [subpath] of the url is retrieved. *)
Expand Down

0 comments on commit 0ad26df

Please sign in to comment.