EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
<== Date ==> <== Thread ==>

Subject: [Bug 2015234] Re: newline problem with genVersionHeader.pl
From: Dirk Zimoch via Core-talk <core-talk at aps.anl.gov>
To: core-talk at aps.anl.gov
Date: Tue, 04 Apr 2023 15:35:30 -0000
With no 'chomp' in neither line 98 nor 139, I get both newlines in the output.
So it seems that 'chomp' removes only one newline.
My perl version is v5.16.3, in case it may be relevant.

-- 
You received this bug notification because you are a member of EPICS
Core Developers, which is subscribed to EPICS Base.
Matching subscriptions: epics-core-list-subscription
https://bugs.launchpad.net/bugs/2015234

Title:
  newline problem with genVersionHeader.pl

Status in EPICS Base:
  New

Bug description:
  After merging the current EPICS 7.0 branch into my PSI branch, I got a
  generated epicsVCS.h header file with invalid syntax on RHEL7 (but not
  on RHEL8):

  #ifndef EPICS_VCS_VERSION_DATE
    #define EPICS_VCS_VERSION_DATE "Git: 2023-03-29 13:36:52 +0200
  "

  Note the newline within the string.

  I tracked that down to a strange behavior of git show in git version
  1.8.3.1 as installed by default on RHEL7:

  Whenever the current commit is a merge, then the output of 'git show
  -s --format=%ci' (as used by genVersionHeader.pl) shows an extra
  newline!

  Piping it to hexdump show the issue:
  $git co 7.0
  git show -s --format=%ci | hexdump -C
  00000000  32 30 32 33 2d 30 33 2d  31 30 20 31 32 3a 30 32  |2023-03-10 12:02|
  00000010  3a 32 39 20 2b 30 30 30  30 0a                    |:29 +0000.|
  0000001a
  Just as it should be.

  Now check out a merge commit:
  $git co e63184e
  [...]
  HEAD is now at e63184e... Merge PR #63, longout.OOPT
  $ git show -s --format=%ci | hexdump -C
  00000000  32 30 32 32 2d 31 32 2d  32 39 20 31 36 3a 33 31  |2022-12-29 16:31|
  00000010  3a 34 32 20 2d 30 36 30  30 0a 0a                 |:42 -0600..|
  0000001b

  Note the extra 0a!

  This extra newline gets pasted into epicsVCS.h.

  BTW: Git version 2.31.1 as installed by default on RHEL8 does not show
  this bug.

  Of course one could blame the problem on the old git version, but I
  think just to be on the safe side, it would be better to remove all
  terminating newlines (and returns, maybe all whitespace) and not only
  the last one, as perl seems to do.

To manage notifications about this bug go to:
https://bugs.launchpad.net/epics-base/+bug/2015234/+subscriptions


References:
[Bug 2015234] [NEW] newline problem with genVersionHeader.pl Dirk Zimoch via Core-talk

Navigate by Date:
Prev: [Bug 2015234] Re: newline problem with genVersionHeader.pl Dirk Zimoch via Core-talk
Next: [Bug 2015234] Re: newline problem with genVersionHeader.pl Dirk Zimoch via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: [Bug 2015234] Re: newline problem with genVersionHeader.pl Dirk Zimoch via Core-talk
Next: [Bug 2015234] Re: newline problem with genVersionHeader.pl Dirk Zimoch via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
ANJ, 04 Apr 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·