Bug 25456 - resolve-ChangeLogs fails when run from anywhere other than the git root
Summary: resolve-ChangeLogs fails when run from anywhere other than the git root
Status: RESOLVED DUPLICATE of bug 18599
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-28 12:48 PDT by Eric Seidel (no email)
Modified: 2009-04-28 20:34 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-04-28 12:48:38 PDT
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'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->catfile($_[0], "ChangeLog"); is supposed to do?  (Maybe that grabs the contents of the file?)
Comment 1 David Kilzer (:ddkilzer) 2009-04-28 13:02:45 PDT
(In reply to comment #0)
> 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->catfile($_[0], "ChangeLog"); is
> supposed to do?  (Maybe that grabs the contents of the file?)

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

I'll see what I can do the next time I get a ChangeLog conflict.
Comment 2 Eric Seidel (no email) 2009-04-28 13:52:06 PDT
Thank you for the pointers (and being sympathetic to my frustration w/ the script).
Comment 3 David Kilzer (:ddkilzer) 2009-04-28 20:34:05 PDT

*** This bug has been marked as a duplicate of 18599 ***