* Shallow clones becomes not-shallow when cloning to a different drive
@ 2023-11-15 13:12 Tobias Schlüter
0 siblings, 0 replies; only message in thread
From: Tobias Schlüter @ 2023-11-15 13:12 UTC (permalink / raw)
To: git
Hi,
I reported this on github but I was asked to take it here [*]. I had to
deal with the following scenario today (on Windows, but not OS-specific):
$ git clone --single-branch --branch feature/bla --depth 200
~/source/Repos/bla ${PATH_ON_DOFFERENT_DRIVE}/bla
Cloning into './bla'...
warning: --depth is ignored in local clones; use file:// instead.
... run out of disk space because it does a full clone ...
Doing something different than the user asked for, and in a way that can
lead to dangerous scenarios, is a bad choice. In this case I was
copying to a USB stick, but it could also be a system drive that runs
out of space.
Additionally, the suggestion to use "file://" instead turned out to be
impractical, as it is very slow. I started the operation with
"file://..." replacing the repository path on the command line before my
lunch break. When I came back it had copied a mere 100MB.
I would suggest to not imply "--local" when copying to a different
device, and I would suggest to avoid doing something different than what
the user asked for. In this case I specifically asked for a shallow
copy to save resources, the logic that a local copy using hard links
actually saves more resources simply didn't apply. Additionally, I
would suggest investigating potential performance issues in the case of
a shallow clone with file:// paths.
Please consider changing these choices and defaults.
Best regards,
- Tobi
[*] https://github.com/git-for-windows/git/issues/4693
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-15 13:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 13:12 Shallow clones becomes not-shallow when cloning to a different drive Tobias Schlüter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).