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

Re: [bug] user may be cornered into delete files #9901

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 14, 2024, 23:37 UTC
Message-ID
<ZzaJzm4kyYbcDSgm@tapette.crustytoothpaste.net>
In-Reply-To
<P_ttzPnNTtUgpAy8cg_ntLvwskJhz7cmv-fFgDw0K4Y2vOCx8v_AXxHtHEuBtpREOQu9pxpvK6JgLusc5Uyn2wDZ4HZvC3ttM4k-Ry6jBs8=@proton.me>
On 2024-11-14 at 17:53:15, A bughunter wrote:
>  [bug] user may be cornered into delete files #9901 pls see https://github.com/cli/cli/issues/9901 and look into all of the links.

What you're describing sounds like a network problem of some sort. I don't believe this is a bug in Git because Git handles this kind of thing on a regular basis without a problem.

The only thing which might potentially be a problem on the Git side is that I don't know if we try to hold the connection open without sending a sideband during pack generation, in which case if the client side doesn't send anything at all, then the connection might be closed by the server. I'll point out that GitHub sends SSH keepalives, so typically the connection should not be reset unless the connection actually drops.

However, you could try pushing over HTTPS instead, which won't try to make the connection until the pack is generated, so even if we do what I suggested might be a problem above, that wouldn't affect HTTPS.

I will mention that the repository you mentioned there contains a large number of TIFF images about 1–2 MB in size. These TIFFs appear to be using JPEG compression, so when Git tries to deltify them (during the "Compressing objects" stage), that step is just going to waste a lot of CPU and take a long time, since trying to deltify compressed objects doesn't work and is just slow. That's contributing to the slow push performance.

In general, Git is not a great way to store large numbers of compressed images. If you're going to store images in your repository, you should make them uncompressed (which you can do with TIFFs) so that Git can store them more efficiently. What would be even better, since your data appears to be effectively a book, is to store the data as text, possibly with a small set of images for illustrations, instead of storing the book as a set of images. That would be much more searchable and accessible as well. The Git FAQ[0] mentions this and makes recommendations on approach.

Overall, I would not say this is a bug in Git. Pushing over HTTPS may help you get your pushes working in a more robust way, but in general, I'd recommend storing the data in your repository differently.

[0] https://git-scm.com/docs/gitfaq#recommended-storage-settings
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
Previous: A bughunterNext: Jeff King
Message 4 of 7 in “[bug] user may be cornered into delete files #9901”
  1. A bughunterNov 14, 2024
  2. Fw: [bug] user may be cornered into delete files #9901A bughunter, Nov 14, 2024
  3. Fw: [bug] user may be cornered into delete files #9901A bughunter, Nov 14, 2024
  4. brian m. carlsonNov 14, 2024
  5. Jeff KingNov 15, 2024
  6. Fw: Re: [bug] user may be cornered into delete files #9901A bughunter, Nov 15, 2024
  7. A bughunterNov 18, 2024

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.