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

Re: [PATCH] Remove perl dependency from git-submodule.sh

From
Junio C Hamano <gitster@pobox.com>
Date
May 31, 2012, 19:26 UTC
Message-ID
<7v7gvs6tkf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120531184841.GA32131@paksenarrion.iveqy.com>
Fredrik Gustafsson <iveqy@iveqy.com> writes:
Show 11 quoted lines
> On Thu, May 31, 2012 at 10:49:41AM -0700, Junio C Hamano wrote:
>> Having said that, in the longer term, I think the right direction to
>> go is the opposite.  It would be better to make "git-submodule.sh"
>> work better with paths with funny characters in them, and one
>> obvious approach is to read "ls-files -z" output with something
>> capable of parsing NUL-terminated records, e.g. a Perl scriptlet.
>> Adding a new shell loop like this patch only adds one place that
>> needs to be fixed later when that happens, so I am not sure I like
>> this patch.
>
> Is perl really a dependency that git wants?

It depends on your definition of "want"; I'd say "if alternative is to lose things like functionality, performance, etc., we would rather live with it."

It is one of the more widely available scripting languages whose scripts are more portable across platforms (sadly, we ought to be able to use sed and awk which are more available but we have seen portability issues with them); if we want to step outside of what can be done with POSIX shell scripts (e.g. handling NUL terminated stream) but are not ready to rewrite everything in C, I would say it is the least evil among others. So the short answer is yes.

> Today only a few bit (often
> non critical) are in perl. I thought the way was to get rid of those and
> replace them with c?

But your patch does not help us bring ourselves any closer to replace anything with C at all.

> I'm very critical to dependencies when they are not needed.
The key-phrase is "when they are not needed".  

If the patch were to replace it with awk, sed or shell *without* losing functionality, performance, readability, portability & maintainability, it would be giving us one less dependency without losing anything. It may not be replacing everything with C, but at least it would not be going backwards.

On the other hand, if the patch were to replace Perl scriptlet with ruby or python, that would be adding unnecessary extra dependencies, as we do not have anything written in them in the core. To such a patch, we can confidently say "It adds unnecessary dependency without value" and reject it.

Previous: Fredrik Gustafsson
Message 9 of 9 in “Remove perl dependency from git-submodule.sh”
  1. Remove perl dependency from git-submodule.shFredrik Gustafsson, May 31, 2012
  2. Ævar Arnfjörð BjarmasonMay 31, 2012
  3. Fredrik GustafssonMay 31, 2012
  4. Johannes SixtMay 31, 2012
  5. Fredrik GustafssonMay 31, 2012
  6. Johannes SixtMay 31, 2012
  7. Junio C HamanoMay 31, 2012
  8. Fredrik GustafssonMay 31, 2012
  9. Junio C HamanoMay 31, 2012

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.