WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
95177
check-webkit-style fails when WebKit is in a Git submodule
https://bugs.webkit.org/show_bug.cgi?id=95177
Summary
check-webkit-style fails when WebKit is in a Git submodule
Kevin Funk
Reported
2012-08-28 00:55:34 PDT
The problem is in /Tools/Scripts/webkitpy/common/checkout/scm/git.py, function find_checkout_root(). If WebKit is checked out using git submodules, git.py identifies "$WEBKIT_SUBMODULE\..\.git\modules" as the checkout root, which is wrong. === Example (here: Qt5 repository layout): qt5 - qtbase (submodule) - ... - qtwebkit (submodule) Issue: find_checkout_root() then returns "qt5/.git/modules" as the checkout root (wrong!). === Patch following.
Attachments
Patch
(2.07 KB, patch)
2012-08-28 01:03 PDT
,
Kevin Funk
abarth
: review-
Details
Formatted Diff
Diff
Patch v2
(1.97 KB, patch)
2012-08-29 07:35 PDT
,
Kevin Funk
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Kevin Funk
Comment 1
2012-08-28 01:03:17 PDT
Created
attachment 160925
[details]
Patch
Adam Barth
Comment 2
2012-08-28 08:16:33 PDT
Comment on
attachment 160925
[details]
Patch We need to use self._filesystem, not os.path so that this code will work properly in unit tests.
Kevin Funk
Comment 3
2012-08-28 08:43:28 PDT
Okay. Would you accept the patch if I am re-adding the two lines with the self._filesystem* calls?
Adam Barth
Comment 4
2012-08-28 08:55:12 PDT
I would either need to ask a git expert or read the documentation about the difference between those two flags. We would like to fix this bug, and I'm willing to believe you're doing it the right way. I just need to check. :) Also, please be sure to run ./Tools/Scripts/test-webkitpy. Ideally, you'd also add a test to make sure we don't regress this bug.
Simon Hausmann
Comment 5
2012-08-28 10:06:07 PDT
I think using --show-toplevel is indeed better than using --git-dir and then trying to parse away the .git portion of the path.
Adam Barth
Comment 6
2012-08-28 10:11:18 PDT
Thanks. Ok, so it sounds like we just need to go through self._filesystem.
Kevin Funk
Comment 7
2012-08-29 07:35:33 PDT
Created
attachment 161224
[details]
Patch v2
Dirk Pranke
Comment 8
2012-08-29 09:43:35 PDT
Interesting. It does look like --show-toplevel is a better thing to use, but from the documentation, it sounds like --git-dir is supposed to be returning path-to/.git and we're getting path-to/.git/modules instead. Is this a git bug?
Kevin Funk
Comment 9
2012-08-29 11:38:04 PDT
Just checked again: In Qt5's qtwebkit submodule there is a *file* named ".git" which breaks the assumed behaviour. Reading out the file yields: $ cat qtwebkit/.git gitdir: ../.git/modules/qtwebkit So git rev-parse --git-dir within qtwebkit will refer to "../.git/modules/qtwebkit" (hard-coded). I am not entirely sure, but I think the reason for doing this is to share the Git history between several submodules (there are at least "qtwebkit" and "qtwebkit1" registered as submodules). So, Dirk, you are probably right. In normal cases --git-dir works fine, but not with that "separate-git-dir" feature used within qtwebkit. Reference:
http://www.kernel.org/pub/software/scm/git/docs/git-init.html
- '--separate-git-dir'
Dirk Pranke
Comment 10
2012-08-29 11:43:30 PDT
interesting. I could believe separate-git-dir might confuse things. I'll have to play around with it a bit more.
WebKit Review Bot
Comment 11
2012-08-29 15:47:21 PDT
Comment on
attachment 161224
[details]
Patch v2 Clearing flags on attachment: 161224 Committed
r127059
: <
http://trac.webkit.org/changeset/127059
>
WebKit Review Bot
Comment 12
2012-08-29 15:47:24 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug