bug-vc-dwim
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-vc-dwim] vc-chlog vs two-word function name like "operator dele


From: Jim Meyering
Subject: Re: [Bug-vc-dwim] vc-chlog vs two-word function name like "operator delete"
Date: Tue, 08 Mar 2011 07:59:02 +0100

Ralf Wildenhues wrote:

> Hi Jim,
>
> * Jim Meyering wrote on Mon, Mar 07, 2011 at 02:21:40PM CET:
>> Subject: [PATCH] vc-chlog: handle two-word function names like "operator 
>> delete"
>>
>> With exuberant ctags, a file in gcc would provoke diagnostics like this:
>>   vc-chlog: line 425: test: delete: integer expression expected
>> * vc-chlog.in (func_taglist): Don't let a function name like "operator
>> delete" provoke shell syntax errors.
>
> OK thanks.
>
>> --- a/vc-chlog.in
>> +++ b/vc-chlog.in
>> @@ -307,7 +307,9 @@ func_taglist ()
>>        print $3, $1;
>>      }'
>>      else
>> -      $AWK '{ print $2, $1; }'
>> +      # Handle output like this:
>> +      # operator delete   32 libstdc++-v3/libsupc++/del_opnt.cc operator 
>> delete
>> +      $AWK '{if ($1 == "operator") print $3, $1, $2; else print $2, $1; }'
>
> If you could put each awk statement on a line of its own, even better,
> for debugging purposes.

Sure.
Also added a NEWS entry (which I mentioned in the commit log
but forgot to add to ChangeLog -- imho not worth fixing, now.
If anything, I am inclined to remove ChangeLog from VC.  WDYT?).

I've pushed this:

>From c999b76333d418ce935e0d8ad4c1aa1309ea04cd Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 7 Mar 2011 14:19:45 +0100
Subject: [PATCH] vc-chlog: handle two-word function names like "operator delete"

With exuberant ctags, a file in gcc would provoke diagnostics like this:
  vc-chlog: line 425: test: delete: integer expression expected
* vc-chlog.in (func_taglist): Don't let a function name like "operator
delete" provoke shell syntax errors.
* NEWS: Mention it.
---
 ChangeLog   |    8 ++++++++
 NEWS        |    2 ++
 vc-chlog.in |   10 +++++++++-
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3e7a41f..18dda36 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-03-07  Jim Meyering  <address@hidden>
+
+       vc-chlog: handle two-word function names like "operator delete"
+       With exuberant ctags, a file in gcc would provoke diagnostics like this:
+         vc-chlog: line 425: test: delete: integer expression expected
+       * vc-chlog.in (func_taglist): Don't let a function name like "operator
+       delete" provoke shell syntax errors.
+
 2011-01-05  Jim Meyering  <address@hidden>

        doc: don't emit @@ME@@ strings into generated man page
diff --git a/NEWS b/NEWS
index 53be6f7..ac5bd02 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ vc-dwim NEWS                                          -*- 
outline -*-

 * Noteworthy changes in release ?.? (????-??-??) [?]

+  vc-chlog can now handle two-word function names like "operator delete"
+

 * Noteworthy changes in release 1.3 (2010-11-06) [stable]

diff --git a/vc-chlog.in b/vc-chlog.in
index 7485750..12e97cd 100755
--- a/vc-chlog.in
+++ b/vc-chlog.in
@@ -307,7 +307,15 @@ func_taglist ()
          print $3, $1;
        }'
     else
-      $AWK '{ print $2, $1; }'
+      # Handle output like this:
+      # operator delete   32 libstdc++-v3/libsupc++/del_opnt.cc operator delete
+      $AWK '
+        {
+          if ($1 == "operator")
+            print $3, $1, $2;
+          else
+            print $2, $1;
+        }'
     fi
     # Heuristic: to avoid identifying changes outside of functions
     # with the previous function, we add end-of-function markers
--
1.7.4.1.299.ga459d



reply via email to

[Prev in Thread] Current Thread [Next in Thread]