GNU bug report logs - #19028
[PATCH] grep: fix grep -F -x -o outputs extra newlines

Previous Next

Package: grep;

Reported by: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

Date: Wed, 12 Nov 2014 13:56:02 UTC

Severity: normal

Tags: patch

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19028 in the body.
You can then email your comments to 19028 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#19028; Package grep. (Wed, 12 Nov 2014 13:56:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Wed, 12 Nov 2014 13:56:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: bug-grep <at> gnu.org
Subject: [PATCH] grep: fix grep -F -x -o outputs extra newlines
Date: Wed, 12 Nov 2014 22:54:36 +0900
[Message part 1 (text/plain, inline)]
grep -F -x -o outputs extra newlines as following.

$ printf 'abc\nabc\n' | grep -F -x -o abc
abc

abc

$ 

(expected)
$ printf 'abc\nabc\n' | grep -F -x -o abc
abc
abc
$ 

Jim, could you take this bug fix in next release?

[0001-grep-fix-grep-F-x-o-outputs-extra-newlines.patch (text/plain, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#19028; Package grep. (Thu, 13 Nov 2014 00:40:02 GMT) Full text and rfc822 format available.

Message #8 received at 19028 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: 19028 <at> debbugs.gnu.org
Subject: Re: bug#19028: [PATCH] grep: fix grep -F -x -o outputs extra newlines
Date: Wed, 12 Nov 2014 16:38:42 -0800
Nice!
Thank you for the report and patch.
Would you please amend it to include the test you added?




Information forwarded to bug-grep <at> gnu.org:
bug#19028; Package grep. (Thu, 13 Nov 2014 00:43:01 GMT) Full text and rfc822 format available.

Message #11 received at 19028 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: 19028 <19028 <at> debbugs.gnu.org>
Subject: Re: bug#19028: [PATCH] grep: fix grep -F -x -o outputs extra newlines
Date: Wed, 12 Nov 2014 16:42:22 -0800
PS, this (omitting parts of a patch) used to happen to me, too, but
then I wrote vc-dwim (https://gnu.org/software/vc-dwim/). If you use
it to prepare/view/commit changes for which you have already written a
ChangeLog entry, then it will automatically ensure that you do not
omit changes to any file whose name appears in the corresponding
ChangeLog entry.




Information forwarded to bug-grep <at> gnu.org:
bug#19028; Package grep. (Thu, 13 Nov 2014 12:51:01 GMT) Full text and rfc822 format available.

Message #14 received at 19028 <at> debbugs.gnu.org (full text, mbox):

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: Jim Meyering <jim <at> meyering.net>
Cc: 19028 <at> debbugs.gnu.org
Subject: Re: bug#19028: [PATCH] grep: fix grep -F -x -o outputs extra newlines
Date: Thu, 13 Nov 2014 21:50:18 +0900
[Message part 1 (text/plain, inline)]
On Wed, 12 Nov 2014 16:38:42 -0800
Jim Meyering <jim <at> meyering.net> wrote:
> Would you please amend it to include the test you added?

Sorry, I amend it after `git add'.
[0001-grep-fix-grep-F-x-o-outputs-extra-newlines.patch (text/plain, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#19028; Package grep. (Fri, 14 Nov 2014 16:34:02 GMT) Full text and rfc822 format available.

Message #17 received at 19028 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: 19028 <19028 <at> debbugs.gnu.org>
Subject: Re: bug#19028: [PATCH] grep: fix grep -F -x -o outputs extra newlines
Date: Fri, 14 Nov 2014 08:32:46 -0800
[Message part 1 (text/plain, inline)]
On Thu, Nov 13, 2014 at 4:50 AM, Norihiro Tanaka <noritnk <at> kcn.ne.jp> wrote:
> On Wed, 12 Nov 2014 16:38:42 -0800
> Jim Meyering <jim <at> meyering.net> wrote:
>> Would you please amend it to include the test you added?
>
> Sorry, I amend it after `git add'.

Thanks. However, that new test would never run, because the new file's
name was not listed in tests/Makefile.am.  I added it, and changed the
test script to merge two loops (avoiding some duplication) and
improved comments (this also affects 2.19). I also tracked down the
commit that introduced the problem and listed it in the commit log,
and mentioned in NEWS that both 2.19 and 2.20 were affected. I changed
the commit log to provide more detail: this is important, especially
for a bug fix.  Simply saying "fixed the bug" does not help the reader
understand.  One must say how/why the code failed, and/or what changed
to make it work, especially when the change is nontrivial.
[0001-grep-F-x-o-PAT-would-print-an-extra-newline-for-each.patch (application/octet-stream, attachment)]

Information forwarded to bug-grep <at> gnu.org:
bug#19028; Package grep. (Fri, 14 Nov 2014 22:47:02 GMT) Full text and rfc822 format available.

Message #20 received at 19028 <at> debbugs.gnu.org (full text, mbox):

From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
To: Jim Meyering <jim <at> meyering.net>
Cc: 19028 <19028 <at> debbugs.gnu.org>
Subject: Re: bug#19028: [PATCH] grep: fix grep -F -x -o outputs extra newlines
Date: Sat, 15 Nov 2014 07:46:51 +0900
On Fri, 14 Nov 2014 08:32:46 -0800
Jim Meyering <jim <at> meyering.net> wrote:
> Thanks. However, that new test would never run, because the new file's
> name was not listed in tests/Makefile.am.  I added it, and changed the
> test script to merge two loops (avoiding some duplication) and
> improved comments (this also affects 2.19). I also tracked down the
> commit that introduced the problem and listed it in the commit log,
> and mentioned in NEWS that both 2.19 and 2.20 were affected. I changed
> the commit log to provide more detail: this is important, especially
> for a bug fix.  Simply saying "fixed the bug" does not help the reader
> understand.  One must say how/why the code failed, and/or what changed
> to make it work, especially when the change is nontrivial.

Thanks a lot for the adjustment.  I understood that you said, and I agree
that you changed.





Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Sat, 15 Nov 2014 02:18:01 GMT) Full text and rfc822 format available.

Notification sent to Norihiro Tanaka <noritnk <at> kcn.ne.jp>:
bug acknowledged by developer. (Sat, 15 Nov 2014 02:18:02 GMT) Full text and rfc822 format available.

Message #25 received at 19028-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
Cc: 19028-done <at> debbugs.gnu.org
Subject: Re: bug#19028: [PATCH] grep: fix grep -F -x -o outputs extra newlines
Date: Fri, 14 Nov 2014 18:17:10 -0800
pushed and marked as done




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 13 Dec 2014 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 194 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.