git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] clone, progress: add --no-turtle-speed option to abort slow clones

From
MBMike Banon <mikebdp2@gmail.com>
Date
Mar 7, 2026, 00:29 UTC
Message-ID
<CAK7947n9gqhRoykNUR4NvPFiaCB4nuotxQTT=eftSF8O9ZO2rg@mail.gmail.com>
In-Reply-To
<aatjasMiPIeT0s27@fruit.crustytoothpaste.net>
Brian, thank you very much for your code review!

This problem has been happening to me for a couple of weeks while using GitHub: as a part of my "floppinux-amd64net" pet project (2.88 MB Linux floppy image with Ethernet/WiFi – for putting into a coreboot BIOS image), I wrote a large [1] script that clones a lot of GitHub repositories and builds everything from scratch. With some non-zero probability (floating between 5%–30% depending on day/location and other unknown factors), my git clone operation gets directed to a really slow Git server with around ~70 KiB/s download speed, which is especially painful if it tries to clone some large repo like a linux-firmware. But if I terminate that git clone and start it again, there is a good chance that my next connection will be fast (at least a few MiB/s). So with the bash code like [2] below – in case of a slow connection, it will simply restart until it gets a fast server and clones successfully.

I agree that more customization ability would be useful and support your opinion about the turtles, so your "--min-speed=128KiB" suggestion sounds great and I may try to implement it in the near future. At the moment I simply wanted to know if such a feature, initially created for my personal needs, would be welcome upstream. It is unknown how many people are affected by such problems, i.e. I've never had this annoying problem until recently.

My reason for using the environmental variable is simple: not being familiar with the git codebase, this "variable solution" is the most minimalistic diff I've been able to come up with (just 40 non-dense lines) that is still working in practice. Another way was adding some "speed_check" flag variable (either to a "progress" data structure or as some "extern"ally-exposed variable), but I ran into some problems with this approach and just did what was more reachable to me as a newbie here.

Best regards, Mike Banon Open Source Community Manager of 3mdeb - https://3mdeb.com/

[1] https://github.com/mikebdp2/floppinux-amd64net/blob/main/floppinux-amd64net.sh
[2]
# Formatting
   bold="\033[1m"
   bred="\033[1;31m"
 bgreen="\033[1;32m"
byellow="\033[1;33m"
   bend="\033[0m"
# Prints the status message in '$1: $2' format with a green color
highlighting of a '$1'.
printgr () {
    printf "${bgreen}$1${bend}: $2\n"
    return 0
}
# Git clones a '$1' repository from a '$2' URL, with a '$3' branch if specified.
git_cloner () {
    if git clone --no-turtle-speed --depth=1 ${3:+--branch $3} "$2" &&
[ -d "$1/.git/" ] ; then
        return 0
    else
        rm -rf "$1"
        printf "\n${byellow}WARNING${bend}: cannot download a
${byellow}$1${bend} repository !"
        printf "\n         Please check your Internet connection and
try again.\n"
        sleep 1
        return 1
    fi
}
# linux-firmware needed for some Ethernet/WiFi network adapters
firmware_get () {
    printgr "LINUX-FIRMWARE" "remove the old directory if it exists"
    rm -rf ./linux-firmware/
    printgr "LINUX-FIRMWARE" "git clone a repository"
    while true; do
        git_cloner "./linux-firmware"
"https://github.com/mikebdp2/linux-firmware.git" && break
    done
    return 0
}
Previous: brian m. carlsonNext: brian m. carlson
Message 3 of 5 in “clone, progress: add --no-turtle-speed option to abort slow clones”
  1. clone, progress: add --no-turtle-speed option to abort slow clonesMike Banon, Mar 6, 2026
  2. brian m. carlsonMar 6, 2026
  3. Mike BanonMar 7, 2026
  4. brian m. carlsonMar 7, 2026
  5. Richard KerryMar 9, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.