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

Re: [PATCH] generate-cmdlist: re-implement as shell script

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 20, 2015, 18:11 UTC
Message-ID
<CAPig+cROaXkRVbpRJYiAL1yiXB1HV_12To=VMO8kZVk_AFE+2w@mail.gmail.com>
In-Reply-To
<xmqqegiy9a4d.fsf@gitster.dls.corp.google.com>
On Wed, Aug 19, 2015 at 6:38 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
>> In addition to reviving 527ec39^:generate-cmdlist.sh and extending it, I
>> also re-indented it with tabs instead of spaces, so it's helpful to
>> ignore whitespace changes when comparing the old and new versions of the
>> shell script.
>
> Hmph.  Perhaps we can view it as part of reverting 527ec39 and then
> redoing it in shell.

I'm having trouble understanding. Are you asking that this be presented as a series of patches which first revert 527ec39, then do the whitespace cleanup, and then augment the script for the extended functionality? If so, it's a bit problematic because the original script still expects the 'common' tag to be present, but that tag was removed by the subsequent patch 2f5b495 (command-list.txt: drop the "common" tag, 2015-05-21). So, reverting 527ec39 would also require reverting 2f5b495.

Show 5 quoted lines
> The way the shell script accumulates matchgrp
> variable (i.e. the literal LF in ${var:+string}) makes me feel some
> possible portability scare, which might be solved in a more stupid
> (i.e. not giving various reimplementations of Bourne shells a chance
> to screw it up) way by using another temporary file[...]

In addition to the literal newline and the temporary file, other options I considered included assigning the newline to a variable and then interpolating that variable (${var:+$LF}), or expanding the list of patterns into a set of '-e' arguments for grep. But, I think I'll just go with the temporary file.

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “generate-cmdlist: re-implement as shell script”
  1. generate-cmdlist: re-implement as shell scriptEric Sunshine, Aug 19, 2015
  2. Junio C HamanoAug 19, 2015
  3. Eric SunshineAug 20, 2015
  4. Junio C HamanoAug 20, 2015
  5. Eric SunshineAug 20, 2015

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.