From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Hadrien Loge <hadrien.loge@gmail.com>
Cc: gitster@pobox.com, git@vger.kernel.org, gitgitgadget@gmail.com,
hadean-eon-dev@proton.me, m@lfurio.us
Subject: Re: [PATCH] clone: accept DEPTH env var as fallback for --depth
Date: Sun, 14 Jun 2026 01:08:24 +0000 [thread overview]
Message-ID: <ai3_CEstWqtw51MF@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <CADeHOfw6kNstNFucG7an6+Mbm2+=-PnOH8xtZkO9RK8=eWsx=w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2231 bytes --]
On 2026-06-13 at 17:43:23, Hadrien Loge wrote:
> Well mainly I'm asking this for packaging (Arch/Alpine/Etc)
> These all follow similar conventions (PKGBUILD/APKBUILD).
Debian builds packages without network access because they want to make
sure that every piece of the source is in the source package, that every
package is reproducibly built, and that users can rebuild source
packages if they like without worrying about needing network access or
having their location exposed to the author.
Wouldn't that be the right decision for reproducibility and privacy
reasons? If so, then the download of the source would happen before
building and could be tailored to meet your needs with the existing
command-line option.
> But in nested flows the ENV var seems like the proper solution.
>
> Mainly I gave this example on github:
>
> git clone --depth 1 url dest
> cd dest
> bash run.sh
> here run.sh has its own clone deps (perhaps even multiple)
> --depth 1 is now lost
>
> And only ENV vars that I can think of properly propagate for CI
> flows/clean chroot envirs.
> Thank you for considering the solution. It would be very useful
> for speeding up packaging.
> Even on 5k commits history it's 900kb vs 17mb.
>
> I have also reworked the commit to include tests/docs.
> and rename to GIT_CLONE_DEPTH
So say someone has this set in their environment and then they run a
script that clones a repository and runs `git describe`. That no longer
works and the script fails because it assumed that it had history.
It's also a problem if you then do a fetch into the shallow repository
because shallow fetches are _extremely_ expensive to serve (more
expensive than full clones), so having automation that now runs
thousands of these shallow fetches means that your requests will be
throttled by the server operator whereas they wouldn't with a regular
fetch.
There's no one right solution here and while I am sympathetic to your
situation, it will also result in hard-to-reproduce breakage for other
tooling. People rely on `git clone` and similar commands only honouring
command line arguments.
--
brian m. carlson (they/them)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]
next prev parent reply other threads:[~2026-06-14 1:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-13 17:43 [PATCH] clone: accept DEPTH env var as fallback for --depth Hadrien Loge
2026-06-14 1:08 ` brian m. carlson [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-06-13 1:39 h8d13 via GitGitGadget
2026-06-13 4:08 ` Matt Hunter
2026-06-13 15:20 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ai3_CEstWqtw51MF@fruit.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=hadean-eon-dev@proton.me \
--cc=hadrien.loge@gmail.com \
--cc=m@lfurio.us \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox