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

Re: [PATCH] Work around sed portability issue in t8006-blame-textconv

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2012, 22:53 UTC
Message-ID
<7vehvcigsy.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vd3b0vc6h.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 28 quoted lines
> Ben Walton <bwalton@artsci.utoronto.ca> writes:
>
>> In test 'blame --textconv with local changes' of t8006-blame-textconv,
>> using /usr/xpg4/bin/sed on Solaris as set by SANE_TOOL_PATH, an
>> additional newline was added to the output from the 'helper' script
>> driven by git attributes.
>>
>> This was noted by sed with a message such as:
>> sed: Missing newline at end of file zero.bin.
>>
>> In turn, this was triggering a fatal error from git blame:
>> fatal: unable to read files to diff
>
> Interesting. A file with incomplete line technically is not a text file
> and sed is supposed to work on text files, so it is allowed to be picky.
>
>> Use perl -p -e instead of sed -e to work around this portability issue
>> as it will not insert the newline.
>
> I am not sure if additional newline is the problem, or the exit status
> from sed is, from your description. Your first paragraph says you will get
> output from sed but with an extra newline, and then later you said blame
> noticed an error in its attempt to read the contents. I am suspecting that
> it checked the exit status from the textconv subprocess and noticed the
> error and that is the cause of the issue, but could you clarify?  IOW, I
> am suspecting that replacing "as it will not insert the newline" with "as
> it does not error out on an incomplete line" is necessary in this
> sentence.
Ping?
Previous: Junio C HamanoNext: Ben Walton
Message 3 of 7 in “Work around sed portability issue in t8006-blame-textconv”
  1. Work around sed portability issue in t8006-blame-textconvBen Walton, Dec 31, 2011
  2. Junio C HamanoJan 3, 2012
  3. Junio C HamanoJan 6, 2012
  4. Ben WaltonJan 9, 2012
  5. 0/1 Re-roll of the test fix for sed on solarisBen Walton, Jan 10, 2012
  6. Use perl instead of sed for t8006-blame-textconv testBen Walton, Jan 10, 2012
  7. Junio C HamanoJan 10, 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.