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

Re: Can dependency on /bin/sh be removed?

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jul 15, 2024, 21:46 UTC
Message-ID
<ZpWYmZwcfZMeKpfe@tapette.crustytoothpaste.net>
In-Reply-To
<xmqq8qy21k9f.fsf@gitster.g>
On 2024-07-15 at 20:18:52, Junio C Hamano wrote:
Show 5 quoted lines
> Having said that, I do not think you can avoid /bin/sh if your goal
> is "minimal image *to run git*", as there are many things we run,
> starting from the editor and the pager and end-user hooks.  The
> credential helper is probably the least of your problems.  What's a
> minimum /bin/dash image cost these days?

Debian provides busybox-static, a statically linked, multi-call busybox binary including sh, other POSIX utilities, and quite a lot of other features, all in a 1.9 MiB binary. If you don't need, say, httpd or dpkg emulation, you can build a much more stripped down version for less disk usage. Alpine Linux is based off of busybox (dynamically linked at 808 KiB), so we can assume that that configuration works just fine.

We know that Git for Windows also ships a configuration using busybox successfully (although with a much larger size).

I am very interested to know what kind of restricted environment needs Git (especially with a credential helper) but doesn't ship with a POSIX sh. I suppose a restricted Windows environment could qualify.

-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
Previous: Junio C HamanoNext: Jeff King
Message 3 of 12 in “Can dependency on /bin/sh be removed?”
  1. Scott MoserJul 15, 2024
  2. Junio C HamanoJul 15, 2024
  3. brian m. carlsonJul 15, 2024
  4. Jeff KingJul 15, 2024
  5. Scott MoserJul 16, 2024
  6. Junio C HamanoJul 16, 2024
  7. Jeff KingJul 16, 2024
  8. Junio C HamanoJul 16, 2024
  9. Jeff KingJul 17, 2024
  10. Andreas SchwabJul 16, 2024
  11. Paul SmithJul 16, 2024
  12. Jeff KingJul 17, 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.