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

Re: git rebase regression: cannot pass a shell expression directly to --exec

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 16, 2017, 10:46 UTC
Message-ID
<alpine.DEB.2.21.1.1705161227060.3610@virtualbox>
In-Reply-To
<xmqqr2zp31vg.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Tue, 16 May 2017, Junio C Hamano wrote:
> The point of rewriting things in C and using run_command() interface was
> to avoid shell overhead.
That statement is missing the point.

It is true that converting shell scripts to proper builtins avoids the shell overhead.

It is even more true that that results in a nice speed-up that can even be felt on Linux (I feel I have to stress this, as you seem to be mostly focused on Linux usage, and I do not want you to get the impression that you are only doing "the Windows folks" a favor when you gracefully accept the patches to convert scripts to proper builtins).

But the real truth is: shell scripting is not portable.

Shell scripting is never only shell scripting, of course. A quite undocumented set of utilities is expected to be present for our scripts to run, too: sed, awk, tr, cat, expr, just to name a few.

It does not end there. For example, sed is not equal to sed. BSD sed has different semantics than GNU sed, and we jump through hoops to try to ensure that our shell scripts run with both versions. Which must make many a contributor feel a lot less positive about their contributions e.g. when a reviewer points out that their \t in their sed statement would break Git on MacOSX. Sad!

We place a burden on maintainers targeting platforms that are not Linux. If I remember correctly, we need to override the default shell on one Unix, even, because we simply failed to make our shell scripts run with it.

And then, of course, there are all the problems inflicted on users on that most prevalent Operating System of them all: Windows. Yes, I know, you "non-Windows folk" would like to happily ignore that little tiny problem, but that's really doing Git a disservice. So stop doing it.

What hurts me most about this is that Subversion, a software that us "Git folk" pride ourselves in making obsolete, never had those problems. It was designed with an eye toward portability from the start.

It is a good thing to support users who want to automate their workflows using scripts, of course. Oh, and please, do not forget to remember that there are tons of scripting languages out there, e.g. AppleScript, Javascript, Tcl, Python, Ruby; just because you prefer Bash does not mean the majority of developers do.

So let's continue to broaden our scripting support. And at the same time, let's also change our mindset so that we can reduce the portability problems of Git.

Ciao, Dscho

Previous: Eric RannaudNext: Johannes Schindelin
Message 21 of 29 in “git rebase regression: cannot pass a shell expression directly to --exec”
  1. Eric RannaudMay 15, 2017
  2. Jeff KingMay 16, 2017
  3. Jeff KingMay 16, 2017
  4. Jonathan NiederMay 16, 2017
  5. Jeff KingMay 16, 2017
  6. Eric RannaudMay 16, 2017
  7. Brandon WilliamsMay 16, 2017
  8. Jeff KingMay 16, 2017
  9. Brandon WilliamsMay 16, 2017
  10. Linus TorvaldsMay 16, 2017
  11. [TANGENT] run-command: use vfork instead of forkEric Wong, May 16, 2017
  12. Linus TorvaldsMay 16, 2017
  13. Brandon WilliamsMay 16, 2017
  14. Johannes SchindelinMay 16, 2017
  15. Linus TorvaldsMay 16, 2017
  16. Jonathan NiederMay 16, 2017
  17. Junio C HamanoMay 16, 2017
  18. Jeff KingMay 16, 2017
  19. Jeff KingMay 16, 2017
  20. Eric RannaudMay 16, 2017
  21. Johannes SchindelinMay 16, 2017
  22. Johannes SchindelinMay 16, 2017
  23. Jeff KingMay 16, 2017
  24. Eric RannaudMay 16, 2017
  25. Kevin DaudtMay 16, 2017
  26. Eric RannaudMay 16, 2017
  27. Jeff KingMay 16, 2017
  28. Eric RannaudMay 16, 2017
  29. Jeff KingMay 16, 2017

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.