<?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>51960</bug_id>
          
          <creation_ts>2011-01-05 15:05:29 -0800</creation_ts>
          <short_desc>review tool formatted diff doesn&apos;t match the uploaded diff</short_desc>
          <delta_ts>2011-01-12 15:49: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>PC</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="Ojan Vafai">ojan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>aroben</cc>
    
    <cc>eric</cc>
    
    <cc>koz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>329813</commentid>
    <comment_count>0</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-05 15:05:29 -0800</bug_when>
    <thetext>https://bugs.webkit.org/attachment.cgi?id=78048&amp;action=review doesn&apos;t match https://bug-51959-attachments.webkit.org/attachment.cgi?id=78048. The diff on code-review.js has an extra blank line at the end that doesn&apos;t exist in the diff or in the file in svn. Other than just being wrong, this also causes the expand logic to be unable to apply the diff.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>330308</commentid>
    <comment_count>1</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-06 12:29:08 -0800</bug_when>
    <thetext>Another case that hits this. The last diff on the page has an extra blank line that is not in the uploaded diff https://bugs.webkit.org/attachment.cgi?id=78143&amp;action=review</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>332853</commentid>
    <comment_count>2</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-11 18:37:46 -0800</bug_when>
    <thetext>Adam, do you know the pretty patch code well enough to identify what&apos;s going wrong here? I&apos;m kinda scared to touch it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>332855</commentid>
    <comment_count>3</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-11 18:41:37 -0800</bug_when>
    <thetext>Oh, I think I know what&apos;s going wrong. It&apos;s putting a blank line after the final newline in the diff.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>332857</commentid>
    <comment_count>4</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-11 18:44:33 -0800</bug_when>
    <thetext>Maybe I should just fix this on the JS side then? I assume the problem is around here: http://trac.webkit.org/browser/trunk/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb#L576.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>332860</commentid>
    <comment_count>5</comment_count>
      <attachid>78639</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-11 18:57:22 -0800</bug_when>
    <thetext>Created attachment 78639
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>332946</commentid>
    <comment_count>6</comment_count>
      <attachid>78639</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-01-12 00:18:57 -0800</bug_when>
    <thetext>Comment on attachment 78639
Patch

I think we should fix this on the server side.  aroben can help us.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333160</commentid>
    <comment_count>7</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-01-12 10:52:41 -0800</bug_when>
    <thetext>Just running prettify.rb on the patch doesn&apos;t seem to result in the extra line being added. So maybe the JS is adding the extra line?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333170</commentid>
    <comment_count>8</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-12 11:04:43 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; Just running prettify.rb on the patch doesn&apos;t seem to result in the extra line being added. So maybe the JS is adding the extra line?

I don&apos;t think it&apos;s the JS. If I delete all the JS, it&apos;s still there. But yeah, I can verify that prettify.rb doesn&apos;t add the extra line. A problem on the bugzilla side maybe?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333182</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-01-12 11:18:09 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; Just running prettify.rb on the patch doesn&apos;t seem to result in the extra line being added. So maybe the JS is adding the extra line?
&gt; 
&gt; I don&apos;t think it&apos;s the JS. If I delete all the JS, it&apos;s still there. But yeah, I can verify that prettify.rb doesn&apos;t add the extra line. A problem on the bugzilla side maybe?

Oooh: http://trac.webkit.org/browser/trunk/Websites/bugs.webkit.org/attachment.cgi?rev=75500#L399</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333185</commentid>
    <comment_count>10</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-12 11:21:14 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #8)
&gt; &gt; (In reply to comment #7)
&gt; &gt; &gt; Just running prettify.rb on the patch doesn&apos;t seem to result in the extra line being added. So maybe the JS is adding the extra line?
&gt; &gt; 
&gt; &gt; I don&apos;t think it&apos;s the JS. If I delete all the JS, it&apos;s still there. But yeah, I can verify that prettify.rb doesn&apos;t add the extra line. A problem on the bugzilla side maybe?
&gt; 
&gt; Oooh: http://trac.webkit.org/browser/trunk/Websites/bugs.webkit.org/attachment.cgi?rev=75500#L399

Lol. Nice find. Presumably we can just delete that line? It seems to only be used for the PrettyPatch code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333187</commentid>
    <comment_count>11</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-12 11:22:28 -0800</bug_when>
    <thetext>Actually, I wonder if there are cases where uploaded patches don&apos;t end in a newline? We should probably change that code to add a newline only if it doesn&apos;t already end in one?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333193</commentid>
    <comment_count>12</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-01-12 11:34:08 -0800</bug_when>
    <thetext>(In reply to comment #11)
&gt; Actually, I wonder if there are cases where uploaded patches don&apos;t end in a newline? We should probably change that code to add a newline only if it doesn&apos;t already end in one?

It should be easy to test what happens when there&apos;s no trailing newline. If PrettyPatch behaves itself then we can just get rid of the &apos; . &quot;\n&quot;&apos; part of that line.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333357</commentid>
    <comment_count>13</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-12 15:29:31 -0800</bug_when>
    <thetext>(In reply to comment #12)
&gt; It should be easy to test what happens when there&apos;s no trailing newline. If PrettyPatch behaves itself then we can just get rid of the &apos; . &quot;\n&quot;&apos; part of that line.

It seems to work the same without the trailing newline in the patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333359</commentid>
    <comment_count>14</comment_count>
      <attachid>78747</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-12 15:33:30 -0800</bug_when>
    <thetext>Created attachment 78747
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333360</commentid>
    <comment_count>15</comment_count>
      <attachid>78747</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-01-12 15:36:09 -0800</bug_when>
    <thetext>Comment on attachment 78747
Patch

Maybe the buffer doesn&apos;t get flushed if there&apos;s no trailing newline?  I&apos;m trying to imagine the disaster scenarios...  close() should flush though...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>333374</commentid>
    <comment_count>16</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2011-01-12 15:49:10 -0800</bug_when>
    <thetext>Committed r75650: &lt;http://trac.webkit.org/changeset/75650&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>78639</attachid>
            <date>2011-01-11 18:57:22 -0800</date>
            <delta_ts>2011-01-12 15:33:26 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-51960-20110111185721.patch</filename>
            <type>text/plain</type>
            <size>1874</size>
            <attacher name="Ojan Vafai">ojan</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYnNpdGVzL2J1Z3Mud2Via2l0Lm9yZy9DaGFuZ2VMb2cgYi9XZWJzaXRl
cy9idWdzLndlYmtpdC5vcmcvQ2hhbmdlTG9nCmluZGV4IDhkOWRmOTVjZGEzYzllODNjOWM0ZDA0
Nzc1ZmZmODIwMDFmNWE5NGEuLjgyZDEwZGQ4OTU4YzkyOWU0ZDcwMDg4OWY4NjIyZjI2MzY1Yzg1
NzMgMTAwNjQ0Ci0tLSBhL1dlYnNpdGVzL2J1Z3Mud2Via2l0Lm9yZy9DaGFuZ2VMb2cKKysrIGIv
V2Vic2l0ZXMvYnVncy53ZWJraXQub3JnL0NoYW5nZUxvZwpAQCAtMSw1ICsxLDE2IEBACiAyMDEx
LTAxLTExICBPamFuIFZhZmFpICA8b2phbkBjaHJvbWl1bS5vcmc+CiAKKyAgICAgICAgUmV2aWV3
ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgcmV2aWV3IHRvb2wgZm9ybWF0dGVkIGRp
ZmYgZG9lc24ndCBtYXRjaCB0aGUgdXBsb2FkZWQgZGlmZgorICAgICAgICBodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZy9zaG93X2J1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BkaWZmTGlua3NIdG1sKCdMaW5rQ29udGFpbmVyJykgKwpA
QCAtNzQ0LDYgKzc0NSwxNyBAQAogICAgIGxvYWREaWZmU3RhdGUoKTsKICAgfSk7CiAKKyAgLy8g
V29ya2Fyb3VuZCBhIGJ1ZyBpbiBQcmV0dHlQYXRjaC5yYiB3aGVyZSBpdCBpbmNsdWRlcyBhbiBl
eHRyYSBsaW5lIGFmdGVyIHRoZQorICAvLyBmaW5hbCBuZXdsaW5lIGluIHRoZSBkaWZmLgorICBm
dW5jdGlvbiByZW1vdmVFeHRyYW5lb3VzTmV3bGluZSgpIHsKKyAgICB2YXIgbGFzdCA9ICQoJy5M
aW5lJykubGFzdCgpOworICAgIGlmICgkKCcudGV4dCcsIGxhc3QpLnRleHQoKSAhPSAnJykgewor
ICAgICAgY29uc29sZS5sb2coJ0V4cGVjdGVkIGxhc3QgbGluZSB0byBiZSBlbXB0eSBhbmQgaXQg
d2FzIG5vdC4nKTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgICAgbGFzdC5kZXRhY2goKTsKKyAg
fQorCiAgIGZ1bmN0aW9uIGxvYWREaWZmU3RhdGUoKSB7CiAgICAgdmFyIGRpZmZzdGF0ZSA9IGxv
Y2FsU3RvcmFnZS5nZXRJdGVtKCdjb2RlLXJldmlldy1kaWZmc3RhdGUnKTsKICAgICBpZiAoZGlm
ZnN0YXRlICE9ICdzaWRlYnlzaWRlJyAmJiBkaWZmc3RhdGUgIT0gJ3VuaWZpZWQnKQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>78747</attachid>
            <date>2011-01-12 15:33:30 -0800</date>
            <delta_ts>2011-01-12 15:36:09 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-51960-20110112153329.patch</filename>
            <type>text/plain</type>
            <size>1395</size>
            <attacher name="Ojan Vafai">ojan</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYnNpdGVzL2J1Z3Mud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1dlYnNpdGVzL2J1Z3Mud2Via2l0Lm9yZy9hdHRhY2htZW50LmNnaQppbmRleCA5
MGMyNzlkYzRhNGRjMDc1NWZlNjQwZWEyN2RjYWQ5Yjg0NWE2MTMzLi4yNDI3YjU5YmEyY2NmNTgx
OWYzOGVjN2NjYjE4YzgyNDc4NzJhMTE0IDEwMDc1NQotLS0gYS9XZWJzaXRlcy9idWdzLndlYmtp
dC5vcmcvYXR0YWNobWVudC5jZ2kKKysrIGIvV2Vic2l0ZXMvYnVncy53ZWJraXQub3JnL2F0dGFj
aG1lbnQuY2dpCkBAIC0zOTYsNyArMzk2LDcgQEAgc3ViIHByZXR0eVBhdGNoCiAgICAgJEVOVnsn
UEFUSCd9ID0gIi9vcHQvbG9jYWwvYmluOiIgLiAkRU5WeydQQVRIJ307CiAgICAgb3BlbjIoXCpP
VVQsIFwqSU4sICIvdXNyL2Jpbi9ydWJ5IiwgIi1JIiwgIlByZXR0eVBhdGNoIiwgIlByZXR0eVBh
dGNoL3ByZXR0aWZ5LnJiIiwgIi0taHRtbC1leGNlcHRpb25zIik7CiAgICAgJEVOVnsnUEFUSCd9
ID0gJG9yaWdfcGF0aDsKLSAgICBwcmludCBJTiAkYXR0YWNobWVudC0+ZGF0YSAuICJcbiI7Cisg
ICAgcHJpbnQgSU4gJGF0dGFjaG1lbnQtPmRhdGE7CiAgICAgY2xvc2UoSU4pOwogICAgIHdoaWxl
ICg8T1VUPikgewogICAgICAgICBwcmludDsK
</data>
<flag name="review"
          id="70110"
          type_id="1"
          status="+"
          setter="abarth"
    />
          </attachment>
      

    </bug>

</bugzilla>