From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jim Meyering Newsgroups: gmane.emacs.bugs Subject: bug#8771: [Bug-vc-dwim] vc-dwim problem parsing ChangeLog entries Date: Tue, 31 May 2011 23:43:35 +0200 Message-ID: <87vcwqeebc.fsf@rho.meyering.net> References: <4DE4861E.709@cs.ucla.edu> <4DE50024.5020901@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1306878275 22549 80.91.229.12 (31 May 2011 21:44:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 May 2011 21:44:35 +0000 (UTC) Cc: bug-vc-dwim@gnu.org, 8771@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 31 23:44:30 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QRWjl-00036p-UV for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2011 23:44:30 +0200 Original-Received: from localhost ([::1]:58292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRWjk-0005q0-Kc for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 May 2011 17:44:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRWjN-0005pH-TO for bug-gnu-emacs@gnu.org; Tue, 31 May 2011 17:44:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRWjM-000390-0K for bug-gnu-emacs@gnu.org; Tue, 31 May 2011 17:44:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRWjL-00038o-Qa for bug-gnu-emacs@gnu.org; Tue, 31 May 2011 17:44:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QRWjK-00049H-HJ; Tue, 31 May 2011 17:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Meyering Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 May 2011 21:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8771 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8771-submit@debbugs.gnu.org id=B8771.130687822515917 (code B ref 8771); Tue, 31 May 2011 21:44:02 +0000 Original-Received: (at 8771) by debbugs.gnu.org; 31 May 2011 21:43:45 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QRWj1-00048g-Lm for submit@debbugs.gnu.org; Tue, 31 May 2011 17:43:44 -0400 Original-Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QRWiz-00048S-0N for 8771@debbugs.gnu.org; Tue, 31 May 2011 17:43:42 -0400 Original-Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 7291D60184; Tue, 31 May 2011 23:43:35 +0200 (CEST) In-Reply-To: <4DE50024.5020901@cs.ucla.edu> (Paul Eggert's message of "Tue, 31 May 2011 07:50:12 -0700") Original-Lines: 161 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 31 May 2011 17:44:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46853 Archived-At: Paul Eggert wrote: > On 05/31/11 06:03, Stefan Monnier wrote: >> And rather than >> >> * composite.c (get_composition_id, gstring_lookup_cache): >> (composition_gstring_put_cache): Foobar. >> >> we usually write: >> >> * composite.c (get_composition_id, gstring_lookup_cache) >> (composition_gstring_put_cache): Foobar. > > OK, I'll adjust that ChangeLog entry by hand. I had appended > the extra colon to the first line because otherwise vc-dwim doesn't > parse the ChangeLog properly. > > This appears to be a bug in vc-dwim so I'll send this email > to bug-vc-dwim@gnu.org (the original thread is at > ). For example, > with vc-dwim 1.5 and the following ChangeLog: > > 2011-05-31 Paul Eggert > > Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771) > * composite.c (get_composition_id, gstring_lookup_cache) > (composition_gstring_put_cache): > * composite.h (struct composition.hash_index): > Use 'EMACS_UINT' and 'EMACS_INT' > for hashes and hash indexes, instead of 'unsigned' and 'int'. > > vc-dwim generates the following diagnostic: > > vc-dwim:ChangeLog: line of unexpected form: > * composite.c (get_composition_id, gstring_lookup_cache) at > /home/eggert/opt/Linux-x86_64/merged/bin/vc-dwim line 991. > > This diagnostic means vc-dwim isn't understanding the newish ChangeLog > format in the GNU coding standards > . > Also, that "line 991" is confusing, since it's not the line number in > the ChangeLog file. Hi Paul, Thanks for the report. I've added a test for that and fixed it with these: >From 92d2db3ccfa024f84db6780029a2017cf5184618 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 31 May 2011 23:41:19 +0200 Subject: [PATCH 1/2] vc-dwim: relax file-spec ChangeLog regexp to accommodate new GCS-style * vc-dwim.pl (main): Relax the file-spec matching regexp. Before, the regexp was /^\* (\S.*?):/, while now we also allow a line ending in ")": /^\* (\S.*?)(:|\)$)/ * NEWS (Bug fixes): Mention it. --- NEWS | 3 +++ vc-dwim.pl | 2 +- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/NEWS b/NEWS index 21b39f2..571b4be 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,9 @@ vc-dwim NEWS -*- outline -*- ** Bug fixes + vc-dwim no longer fails when it encounters a ChangeLog line like + "* file (...)" (i.e., with no colon) when that line ends with a ")". + "vc-dwim a/ChangeLog b/ChangeLog" would mistakenly complain about an "--author/ChangeLog mismatch" even though the two name/email pairs in the ChangeLog files were identical. diff --git a/vc-dwim.pl b/vc-dwim.pl index e474efc..76b3ae0 100755 --- a/vc-dwim.pl +++ b/vc-dwim.pl @@ -989,7 +989,7 @@ sub main if ($line =~ /^\*/) { - $line =~ /^\* (\S.*?):/ + $line =~ /^\* (\S.*?)(:|\)$)/ or die "$ME:$log: line of unexpected form:\n$line"; my $f_spec = $1; foreach my $file (change_log_line_extract_file_list ($f_spec)) -- 1.7.5.2.660.g9f46c >From d2083c184da222885e6fd96cbe204af95c86bd2b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 31 May 2011 22:39:52 +0200 Subject: [PATCH 2/2] tests: add a test to exercise a ChangeLog syntax bug * tests/cl-syntax: New script. Test for the bug reported by Paul Eggert in https://lists.gnu.org/archive/html/bug-vc-dwim/2011-05/msg00006.html * tests/Makefile.am (TESTS): Add cl-syntax. --- tests/Makefile.am | 1 + tests/cl-syntax | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 0 deletions(-) create mode 100755 tests/cl-syntax diff --git a/tests/Makefile.am b/tests/Makefile.am index 307851d..b588c3f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -14,6 +14,7 @@ TESTS = \ git-mv \ two-line-attr \ cl-other-user \ + cl-syntax \ no-vc \ symlinked-changelog \ scalar \ diff --git a/tests/cl-syntax b/tests/cl-syntax new file mode 100755 index 0000000..3a29619 --- /dev/null +++ b/tests/cl-syntax @@ -0,0 +1,34 @@ +#!/bin/sh +# Ensure that we accept relatively new ChangeLog syntax. + +. "${srcdir=.}/init.sh"; path_prepend_ .. +print_ver_ vc-dwim + +require_git_ + +cat < ChangeLog || framework_failure_ +2011-05-31 R. Andom + + * not-checked.c: Irrelevant. + +EOF +git init > /dev/null || framework_failure_ +touch foo || framework_failure_ +git add . || framework_failure_ +git commit -m m . > /dev/null || framework_failure_ + +cat < ChangeLog +2011-05-31 R. Andom + + * foo (bar) + (qux): Comment. + * not-checked.c: Irrelevant. + +EOF + +fail=0 + +echo a > foo || framework_failure_ +vc-dwim ChangeLog || fail=1 + +Exit $fail -- 1.7.5.2.660.g9f46c