<?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>25456</bug_id>
          
          <creation_ts>2009-04-28 12:48:38 -0700</creation_ts>
          <short_desc>resolve-ChangeLogs fails when run from anywhere other than the git root</short_desc>
          <delta_ts>2009-04-28 20:34:05 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>18599</dup_id>
          
          <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="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aroben</cc>
    
    <cc>ddkilzer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>119152</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-28 12:48:38 -0700</bug_when>
    <thetext>resolve-ChangeLogs fails when run from anywhere other than the git root

1.  do a git rebase with some changelog conflicts
2.  cd into a sub directory (like WebCore)
3.  Run resolve-ChangeLogs

It fails with:
WARNING: LayoutTests/ChangeLog does not need merging.
WARNING: WebCore/ChangeLog does not need merging.

Even though if you were at the git root, it would succeed.

I believe the problem is in sub findUnmergedChangeLogs():

git diff -r --name-status --diff-filter=U -C -C -M                              [~/Projects/WebKit/WebCore]
U       LayoutTests/ChangeLog
U       WebCore/ChangeLog

Notice how the returned paths are root-relative.

Evan Martin suggested we just add
cd $(git rev-parse --show-cdup)
to the top of the script, but I expect that would break:

resolve-ChangeLogs ChangeLog ../LayoutTests/ChangeLog
(not that we handle that case very well to begin with, since git doesn&apos;t like ..)

I looked at fixing this, but honestly I could not easily tell what half the variables in the darn script meant.  $_[0] I can only assume is the first argument?  And who knows what File::Spec-&gt;catfile($_[0], &quot;ChangeLog&quot;); is supposed to do?  (Maybe that grabs the contents of the file?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119153</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-04-28 13:02:45 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; I looked at fixing this, but honestly I could not easily tell what half the
&gt; variables in the darn script meant.  $_[0] I can only assume is the first
&gt; argument?  And who knows what File::Spec-&gt;catfile($_[0], &quot;ChangeLog&quot;); is
&gt; supposed to do?  (Maybe that grabs the contents of the file?)

man perlvar  [search for @_]
man File::Spec  [search for catfile]

I&apos;ll see what I can do the next time I get a ChangeLog conflict.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119158</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-04-28 13:52:06 -0700</bug_when>
    <thetext>Thank you for the pointers (and being sympathetic to my frustration w/ the script).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119256</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2009-04-28 20:34:05 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 18599 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>