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

Re: [PATCH 2/2] rebase -i: Preserve whitespace at beginning of commit header in $GIT_EDITOR

From
Nazri Ramliy <ayiehere@gmail.com>
Date
Jul 10, 2010, 12:22 UTC
Message-ID
<AANLkTim2cOWWYbco3XYb_dfOCkUp4rfXIvE-8jZWK4a8@mail.gmail.com>
In-Reply-To
<7vpqywl1sb.fsf@alter.siamese.dyndns.org>
On Sat, Jul 10, 2010 at 6:30 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Nazri Ramliy <ayiehere@gmail.com> writes:
>
>> +                     sed -i "s/^\([a-z]\+\) [0-9a-f]\+ /\1 $REPLACE_COMMIT_ID /" \
>
> This is not portable. Escaping an ERE element with a backslash does not
> make it suitable for use in BRE that sed uses.
>
> Do we use in-place replacement anywhere else with sed?  I don't think it
> is portable, either.
>
And later ...
On Sat, Jul 10, 2010 at 6:37 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
>> +                     cat "$TODO.tmp" | sed "s/^/pick /" > "$TODO"
>
> Do not cat a single file into a pipeline.
>
>        sed "s/^/pick /" <"$TODO.tmp" >"$TODO"
>
>> +             else
>> +                     cat "$TODO.tmp" |
>
> Likewise.
>
[snip]
> Don't pipe output of grep into sed.
>
>        sed -ne "/^$shortsha1 /s/^/pick /p" <"$TODO.tmp" >>"$TODO"

I'll send out a v2 of this series that addresses the above issues in better ways (i think).

nazri
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 5 in “lib-rebase.sh: fake-editor.sh: Allow checking of non-comment lines in $GIT_EDITOR”
  1. 1/2 lib-rebase.sh: fake-editor.sh: Allow checking of non-comment lines in $GIT_EDITORNazri Ramliy, Jul 9, 2010
  2. 2/2 rebase -i: Preserve whitespace at beginning of commit header in $GIT_EDITORNazri Ramliy, Jul 9, 2010
  3. Junio C HamanoJul 9, 2010
  4. Nazri RamliyJul 10, 2010
  5. Junio C HamanoJul 9, 2010

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.