GNU bug report logs - #38862
attribution line parsing

Previous Next

Package: vc-dwim;

Reported by: Karl Berry <karl <at> freefriends.org>

Date: Thu, 2 Jan 2020 02:44:01 UTC

Severity: normal

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 38862 in the body.
You can then email your comments to 38862 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-vc-dwim <at> gnu.org:
bug#38862; Package vc-dwim. (Thu, 02 Jan 2020 02:44:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Karl Berry <karl <at> freefriends.org>:
New bug report received and forwarded. Copy sent to bug-vc-dwim <at> gnu.org. (Thu, 02 Jan 2020 02:44:01 GMT) Full text and rfc822 format available.

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

From: Karl Berry <karl <at> freefriends.org>
To: bug-vc-dwim <at> gnu.org
Subject: attribution line parsing
Date: Wed, 1 Jan 2020 19:43:14 -0700
Hi Jim - When I had only a single space between date and name in the
attribution line, as in:

2020-01-01 Karl Berry  <karl <at> freefriends.org>

vcd gave no errors by default. Then I accidentally ran vcd --commit with
that CL and the only error (warning) was at the end, direct from Perl:

Use of uninitialized value $author in sprintf at /u/karl/gnu/src/vkarl/VC.pm line 210.
Use of uninitialized value $author in sprintf at /u/karl/gnu/src/vkarl/VC.pm line 210.

I was not left in a good state.  There seemed to be no good way to
recover from this, since the erroneous ChangeLog was already committed,
so vcd did not think there were any files in the ChangeLog lines.

So I ended up doing rm -rf .git/c/.git and running vcd --init again to
restart my CL repo, and also
  git fetch && git reset --hard origin && git checkout && git submodule update
to eradicate all my changes (after saving the actual diff :) in the
source repo. Thankfully, that apparently erased the memory of the bad CL
so I could proceed.

Instead of worrying about the exact number of spaces, I wonder about
parsing attr lines by checking that first word is a YYYY-MM-DD date, the
last word is <an <at> email.adr>, and considering the words in between to be
the real name.

Reasonable error msgs would then be easy to give if the first and last
words don't fit the expected syntax.  And if there is no author, it
could give up at that point. After all, vcd relies on all kinds of
finicky details about the CL, so seems like it might as well force a
good attr line too instead of accepting bad ones.

If the idea seems ok, maybe one of us (or a new contributor!) can work
in that direction eventually. --best, karl.




Reply sent to Jim Meyering <jim <at> meyering.net>:
You have taken responsibility. (Sat, 04 Jan 2020 06:02:02 GMT) Full text and rfc822 format available.

Notification sent to Karl Berry <karl <at> freefriends.org>:
bug acknowledged by developer. (Sat, 04 Jan 2020 06:02:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: Karl Berry <karl <at> freefriends.org>
Cc: 38862-done <at> debbugs.gnu.org
Subject: Re: [Bug-vc-dwim] bug#38862: attribution line parsing
Date: Fri, 3 Jan 2020 22:01:38 -0800
[Message part 1 (text/plain, inline)]
On Wed, Jan 1, 2020 at 6:44 PM Karl Berry <karl <at> freefriends.org> wrote:
> Hi Jim - When I had only a single space between date and name in the
> attribution line, as in:
>
> 2020-01-01 Karl Berry  <karl <at> freefriends.org>
>
> vcd gave no errors by default. Then I accidentally ran vcd --commit with
> that CL and the only error (warning) was at the end, direct from Perl:
>
> Use of uninitialized value $author in sprintf at /u/karl/gnu/src/vkarl/VC.pm line 210.
> Use of uninitialized value $author in sprintf at /u/karl/gnu/src/vkarl/VC.pm line 210.
>
> I was not left in a good state.  There seemed to be no good way to
> recover from this, since the erroneous ChangeLog was already committed,
> so vcd did not think there were any files in the ChangeLog lines.
>
> So I ended up doing rm -rf .git/c/.git and running vcd --init again to
> restart my CL repo, and also
>   git fetch && git reset --hard origin && git checkout && git submodule update
> to eradicate all my changes (after saving the actual diff :) in the
> source repo. Thankfully, that apparently erased the memory of the bad CL
> so I could proceed.
>
> Instead of worrying about the exact number of spaces, I wonder about
> parsing attr lines by checking that first word is a YYYY-MM-DD date, the
> last word is <an <at> email.adr>, and considering the words in between to be
> the real name.
>
> Reasonable error msgs would then be easy to give if the first and last
> words don't fit the expected syntax.  And if there is no author, it
> could give up at that point. After all, vcd relies on all kinds of
> finicky details about the CL, so seems like it might as well force a
> good attr line too instead of accepting bad ones.
>
> If the idea seems ok, maybe one of us (or a new contributor!) can work
> in that direction eventually. --best, karl.

Hi Karl,
Thanks for reporting and digging into that.
Here's the change that I've just pushed to address it:
[vcd-diagnose-bad-date-line.diff (application/octet-stream, attachment)]

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

This bug report was last modified 4 years and 79 days ago.

Previous Next


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