public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH cygport] git.cygclass: Suppress the depth option
@ 2023-11-19  2:11 Daisuke Fujimura
  2023-11-20 14:23 ` Jon Turney
  0 siblings, 1 reply; 11+ messages in thread
From: Daisuke Fujimura @ 2023-11-19  2:11 UTC (permalink / raw)
  To: cygwin-apps

Some git providers do not support smart transport, so specifying the
depth option will result in an error.

```
Cloning into 'xxxx'...
fatal: dumb http transport does not support shallow capabilities
```

Therefore, I suggest adding a variable to suppress the depth option.
(Variable names should be changed to something appropriate according
to the naming convention.)

diff --git a/cygclass/git.cygclass b/cygclass/git.cygclass
index e53a7985..0aa97a09 100644
--- a/cygclass/git.cygclass
+++ b/cygclass/git.cygclass
@@ -75,7 +75,12 @@ git_fetch() {
# shallow fetch a ref (master, branch or tag) with --depth=1
# (not allowed for a hash, unless remote is configured to permit
# it with allow*SHA1InWant).
- _depth="--depth 1"
+ _depth=""
+ # git provider does not support smart transport
+ if ! defined GIT_PROVIDER_NOT_SUPPORT_SMART_TRANSPORT
+ then
+ _depth="--depth 1"
+ fi
if defined GIT_TAG
then
_depth+=" --branch ${GIT_TAG}"

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-02-18 15:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-19  2:11 [PATCH cygport] git.cygclass: Suppress the depth option Daisuke Fujimura
2023-11-20 14:23 ` Jon Turney
2023-11-20 16:42   ` ASSI
2023-11-30 12:17   ` Daisuke Fujimura
2023-12-03 20:34     ` Jon Turney
2023-12-03 21:53       ` Brian Inglis
2023-12-16 15:38         ` Daisuke Fujimura
2024-01-13 14:49           ` Jon Turney
2024-02-11 17:09         ` Jon Turney
2024-02-16 11:59           ` Daisuke Fujimura
2024-02-18 15:10             ` Jon Turney

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 read-only IMAP folder(s) and NNTP newsgroup(s).