<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>34058</bug_id>
          
          <creation_ts>2010-01-24 11:17:22 -0800</creation_ts>
          <short_desc>prepare-ChangeLog: Leading spacing of description can be improved when running with Git</short_desc>
          <delta_ts>2010-01-25 03:22:10 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Jerdonek">cjerdonek</reporter>
          <assigned_to name="Chris Jerdonek">cjerdonek</assigned_to>
          <cc>abarth</cc>
    
    <cc>aroben</cc>
    
    <cc>cjerdonek</cc>
    
    <cc>commit-queue</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>184085</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-01-24 11:17:22 -0800</bug_when>
    <thetext>A couple things can be improved with the leading spacing of the ChangeLog description when running prepare-ChangeLog with Git:

(1) Empty lines should include no white space.
(2) Existing indentation (e.g. by subtracting a constant number of spaces determined by the first non-empty line)

Below you can see an example of these two things (uncorrected) when regenerating a ChangeLog with Git.

2010-01-24  Chris Jerdonek  &lt;cjerdonek@webkit.org&gt;

        Reviewed by NOBODY (OOPS!).

        Refactored svn-apply and svn-unapply to use the new
        parsePatch() subroutine.
        &lt;-- Leading spaces.
        Reviewed by NOBODY (OOPS!).
        &lt;-- Leading spaces.
        https://bugs.webkit.org/show_bug.cgi?id=34033
        
        * Scripts/VCSUtils.pm:
        - Consolidated %diffHash documentation.
        - Added prepareParsedPatch().
          &lt;-- The secondary bullets should start here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184086</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-01-24 11:19:40 -0800</bug_when>
    <thetext>(In reply to comment #0)

&gt; (2) Existing indentation (e.g. by subtracting a constant number of spaces
&gt; determined by the first non-empty line)

Meant to say--

(2) Existing (relative) indentation should be preserved (e.g. by subtracting
a constant number of spaces determined by the first non-empty line)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184101</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-01-24 14:04:05 -0800</bug_when>
    <thetext>What command are you using?  I&apos;m confused as to what you think it wrong here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184114</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-01-24 14:37:10 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; What command are you using?  I&apos;m confused as to what you think it wrong here.

I&apos;m using prepare-Changelog --git-commit to create a ChangeLog entry from a git commit that already has a message.

prepare-ChangeLog inserts the git commit message as the description in the ChangeLog entry.  I&apos;m saying that the script should preserve the relative indentation of the commit message when inserting the message into the ChangeLog entry, and not introduce trailing white space into empty lines.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184149</commentid>
    <comment_count>4</comment_count>
      <attachid>47308</attachid>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-01-24 21:37:15 -0800</bug_when>
    <thetext>Created attachment 47308
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184157</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-01-24 22:16:44 -0800</bug_when>
    <thetext>This looks sane to me (although I don&apos;t speak Perl very well).  It would be nice if we had some tests for this script so we could see the effect clearly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184165</commentid>
    <comment_count>6</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-01-24 22:41:04 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; This looks sane to me (although I don&apos;t speak Perl very well).  It would be
&gt; nice if we had some tests for this script so we could see the effect clearly.

It would probably take a fair amount of intrusive refactoring to get the surrounding function into a unit-testable state (something I am currently doing for other Perl code).

Alternatively, I&apos;ll paste below the effect of the change.  For this example, the following is the git commit message prior to running prepare-ChangeLog:

    Improved prepare-ChangeLog so that it preserves the relative
    indentation of a git commit message.
    
    Reviewed by NOBODY (OOPS!).
    
    https://bugs.webkit.org/show_bug.cgi?id=34058
    
    * Scripts/prepare-ChangeLog:
      - Also adjusted the script so that it does not add white
        space characters to empty lines.

To make the effect more visible in the below, I&apos;ve replaced spaces with periods, and truncated the right side to make sure that line-wrapping does not take place.

WITHOUT.THE.CHANGE:

2010-01-24..Chris.Jerdonek..&lt;cjerdonek

........Reviewed.by.NOBODY.(OOPS!).

........Improved.prepare-ChangeLog.so.
........indentation.of.a.git.commit.me
........
........Reviewed.by.NOBODY.(OOPS!).
........
........https://bugs.webkit.org/show_b
........
........*.Scripts/prepare-ChangeLog:
........-.Also.adjusted.the.script.so.
........space.characters.to.empty.line

........Need.a.short.description.and.b

........*.Scripts/prepare-ChangeLog:


WITH.THE.CHANGE:

2010-01-24..Chris.Jerdonek..&lt;cjerdonek

........Reviewed.by.NOBODY.(OOPS!).

........Improved.prepare-ChangeLog.so.
........indentation.of.a.git.commit.me

........Reviewed.by.NOBODY.(OOPS!).

........https://bugs.webkit.org/show_b

........*.Scripts/prepare-ChangeLog:
..........-.Also.adjusted.the.script.s
............space.characters.to.empty.

........Need.a.short.description.and.b

........*.Scripts/prepare-ChangeLog:</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184224</commentid>
    <comment_count>7</comment_count>
      <attachid>47308</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-01-25 02:58:22 -0800</bug_when>
    <thetext>Comment on attachment 47308
Proposed patch

That output is indeed much prettier.  :)

I didn&apos;t mean that we should hold up this patch for testing, just that I&apos;m appreciative of your work on the rest of our tools.  :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184229</commentid>
    <comment_count>8</comment_count>
      <attachid>47308</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-01-25 03:18:07 -0800</bug_when>
    <thetext>Comment on attachment 47308
Proposed patch

Clearing flags on attachment: 47308

Committed r53796: &lt;http://trac.webkit.org/changeset/53796&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184230</commentid>
    <comment_count>9</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-01-25 03:18:14 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>184231</commentid>
    <comment_count>10</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-01-25 03:22:10 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; (From update of attachment 47308 [details])
&gt; I didn&apos;t mean that we should hold up this patch for testing, just that I&apos;m
&gt; appreciative of your work on the rest of our tools.  :)

I wasn&apos;t sure before.  Thanks for the review+.  And for the comments! :)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>47308</attachid>
            <date>2010-01-24 21:37:15 -0800</date>
            <delta_ts>2010-01-25 03:18:07 -0800</delta_ts>
            <desc>Proposed patch</desc>
            <filename>_patch-34058-1.txt</filename>
            <type>text/plain</type>
            <size>2153</size>
            <attacher name="Chris Jerdonek">cjerdonek</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYktpdFRvb2xzL0NoYW5nZUxvZyBiL1dlYktpdFRvb2xzL0NoYW5nZUxv
ZwppbmRleCBjNDlkMzE3Li45YTVjODY0IDEwMDY0NAotLS0gYS9XZWJLaXRUb29scy9DaGFuZ2VM
b2cKKysrIGIvV2ViS2l0VG9vbHMvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTAtMDEt
MjQgIENocmlzIEplcmRvbmVrICA8Y2plcmRvbmVrQHdlYmtpdC5vcmc+CisKKyAgICAgICAgUmV2
aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgSW1wcm92ZWQgcHJlcGFyZS1DaGFu
Z2VMb2cgc28gdGhhdCBpdCBwcmVzZXJ2ZXMgdGhlIHJlbGF0aXZlCisgICAgICAgIGluZGVudGF0
aW9uIG9mIGEgZ2l0IGNvbW1pdCBtZXNzYWdlLgorCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3JnL3Nob3dfYnVnLmNnaT9pZD0zNDA1OAorCisgICAgICAgICogU2NyaXB0cy9wcmVwYXJl
LUNoYW5nZUxvZzoKKyAgICAgICAgICAtIEFsc28gYWRqdXN0ZWQgdGhlIHNjcmlwdCBzbyB0aGF0
IGl0IGRvZXMgbm90IGFkZCB3aGl0ZQorICAgICAgICAgICAgc3BhY2UgY2hhcmFjdGVycyB0byBl
bXB0eSBsaW5lcy4KKwogMjAxMC0wMS0yNCAgRXJpYyBTZWlkZWwgIDxlcmljQHdlYmtpdC5vcmc+
CiAKICAgICAgICAgTm8gcmV2aWV3LCByb2xsaW5nIG91dCByNTM3NjMuCmRpZmYgLS1naXQgYS9X
ZWJLaXRUb29scy9TY3JpcHRzL3ByZXBhcmUtQ2hhbmdlTG9nIGIvV2ViS2l0VG9vbHMvU2NyaXB0
cy9wcmVwYXJlLUNoYW5nZUxvZwppbmRleCA0YzU5YWY5Li41Nzc0M2U3IDEwMDc1NQotLS0gYS9X
ZWJLaXRUb29scy9TY3JpcHRzL3ByZXBhcmUtQ2hhbmdlTG9nCisrKyBiL1dlYktpdFRvb2xzL1Nj
cmlwdHMvcHJlcGFyZS1DaGFuZ2VMb2cKQEAgLTE2MDYsNiArMTYwNiw3IEBAIHN1YiByZXZpZXdl
ckFuZERlc2NyaXB0aW9uRm9yR2l0Q29tbWl0KCQpCiAgICAgICAgICRkZXNjcmlwdGlvbiAuPSAi
XG4iIGlmICRjb21taXRMb2dDb3VudDsKICAgICAgICAgJGNvbW1pdExvZ0NvdW50Kys7CiAgICAg
ICAgIG15ICRpbkhlYWRlciA9IDE7CisgICAgICAgIG15ICRjb21taXRMb2dJbmRlbnQ7IAogICAg
ICAgICBteSBAbGluZXMgPSBzcGxpdCgvXG4vLCAkY29tbWl0TG9nKTsKICAgICAgICAgc2hpZnQg
QGxpbmVzOyAjIFJlbW92ZSBpbml0aWFsIGJsYW5rIGxpbmUKICAgICAgICAgZm9yZWFjaCBteSAk
bGluZSAoQGxpbmVzKSB7CkBAIC0xNjIwLDExICsxNjIxLDE4IEBAIHN1YiByZXZpZXdlckFuZERl
c2NyaXB0aW9uRm9yR2l0Q29tbWl0KCQpCiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAg
ICAgICAgICAgICAgICAgJHJldmlld2VyIC49ICIsICIgLiAkMTsKICAgICAgICAgICAgICAgICB9
Ci0gICAgICAgICAgICB9IGVsc2lmIChsZW5ndGggJGxpbmUgPT0gMCkgeworICAgICAgICAgICAg
fSBlbHNpZiAoJGxpbmUgPX4gL15ccyokLykgewogICAgICAgICAgICAgICAgICRkZXNjcmlwdGlv
biA9ICRkZXNjcmlwdGlvbiAuICJcbiI7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAg
ICAgICAgICRsaW5lID1+IHMvXlxzKi8vOwotICAgICAgICAgICAgICAgICRkZXNjcmlwdGlvbiA9
ICRkZXNjcmlwdGlvbiAuICIgICAgICAgICIgLiAkbGluZSAuICJcbiI7CisgICAgICAgICAgICAg
ICAgaWYgKCFkZWZpbmVkKCRjb21taXRMb2dJbmRlbnQpKSB7CisgICAgICAgICAgICAgICAgICAg
ICMgTGV0IHRoZSBmaXJzdCBsaW5lIHdpdGggbm9uLXdoaXRlIHNwYWNlIGRldGVybWluZQorICAg
ICAgICAgICAgICAgICAgICAjIHRoZSBnbG9iYWwgaW5kZW50LgorICAgICAgICAgICAgICAgICAg
ICAkbGluZSA9fiAvXihccyopXFMvOworICAgICAgICAgICAgICAgICAgICAkY29tbWl0TG9nSW5k
ZW50ID0gbGVuZ3RoKCQxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIyBT
dHJpcCBhdCBtb3N0IHRoZSBpbmRlbnQgdG8gcHJlc2VydmUgcmVsYXRpdmUgaW5kZW50cy4KKyAg
ICAgICAgICAgICAgICAkbGluZSA9fiBzL15cc3swLCRjb21taXRMb2dJbmRlbnR9Ly87CisgICAg
ICAgICAgICAgICAgJGRlc2NyaXB0aW9uID0gJGRlc2NyaXB0aW9uIC4gKCIgIiB4IDgpIC4gJGxp
bmUgLiAiXG4iOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgfQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>