From: Junio C Hamano <junkio@cox.net>
To: Dennis Stosberg <dennis@stosberg.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Make t8001-annotate and t8002-blame more portable
Date: Sun, 18 Jun 2006 13:58:09 -0700 [thread overview]
Message-ID: <7v3be218ri.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20060618203321.G2e8b0080@leonov.stosberg.net> (Dennis Stosberg's message of "Sun, 18 Jun 2006 22:33:21 +0200")
Dennis Stosberg <dennis@stosberg.net> writes:
> These two tests assume that "sed" will not modify the final line of a
> stream if it does not end with a newline character. The assumption is
> not true at least for FreeBSD and Solaris 9. FreeBSD's "sed" appends
> a newline character; "sed" in Solaris 9 even removes the incomplete
> final line.
Gaaah.
> - 'mv file file1 &&
> - sed -e 1d -e "5s/3A/99/" file1 >file &&
> - rm -f file1 &&
> + 'perl -pi -e "s/^1A.*\n$//; s/^3A/99/" file &&
> GIT_AUTHOR_NAME="D" git commit -a -m "edit"'
The first line in the original is removed while the perl version
seems to just makes it empty -- ah, you remove the trailing LF
as well there. I've never seen this done like this, but OK.
It would have been more obvious if it were written like this:
$_ = "" if ($. == 1);
but probably it is just me.
Thanks for the patch.
next prev parent reply other threads:[~2006-06-18 20:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-18 20:33 [PATCH] Make t8001-annotate and t8002-blame more portable Dennis Stosberg
2006-06-18 20:58 ` Junio C Hamano [this message]
2006-06-18 22:06 ` Dennis Stosberg
2006-06-18 22:21 ` Junio C Hamano
2006-06-19 16:35 ` Alex Riesen
2006-06-19 19:40 ` [PATCH] Fix t8001-annotate and t8002-blame for ActiveState Perl Dennis Stosberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v3be218ri.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=dennis@stosberg.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.