Bug 110073 - Add a script to automatically configure a git clone
Summary: Add a script to automatically configure a git clone
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
Depends on:
Blocks: 126217
  Show dependency treegraph
Reported: 2013-02-17 20:09 PST by Ryosuke Niwa
Modified: 2013-12-24 11:10 PST (History)
10 users (show)

See Also:

Adds a new webkit-patch command (6.31 KB, patch)
2013-12-03 14:17 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Patch for landing (6.32 KB, patch)
2013-12-03 14:24 PST, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-02-17 20:09:26 PST
http://trac.webkit.org/wiki/UsingGitWithWebKit has a lot of instruction on how to setup a git clone.

git svn init --prefix=origin/ -T trunk http://svn.webkit.org/repository/webkit
git config --replace svn-remote.svn.fetch trunk:refs/remotes/origin/master

git config core.webKitBranchBuild true

git config merge.changelog.driver "perl Tools/Scripts/resolve-ChangeLogs --fix-merged --merge-driver %O %A %B"

git config color.status auto
git config color.diff auto
git config color.branch auto

All of this should be automated in a script so that we don't have to remember to execute them. Since some of the configurations depend on the workflow a particular contributor uses, the script should probably ask a couple of questions at the beginning and set things up automatically based on the answers.
Comment 1 Eric Seidel (no email) 2013-02-17 20:15:15 PST
Don't forget the github workflows too. :)
Comment 2 Ryosuke Niwa 2013-02-17 20:18:15 PST
(In reply to comment #1)
> Don't forget the github workflows too. :)

Yeah, that's probably the first thing the script should ask.

As is, there are too many miscellaneous things each contributor needs to do before he/she can start submitting patches on a git clone while you can just run "svn co" and start writing patches on a subversion checkout.
Comment 3 Eric Seidel (no email) 2013-02-17 21:01:23 PST
Perhaps.  We could make a much more straight-forward git contribution path, but currently we're using several divergent git contribution paths as there is no officially sanctioned one.  You can't actually use git to contribute directly from a normal git pull/push model, but rather have to use the git-svn bridge.  And git.webkit.org itself isn't writeable, so you have to use github for any branches you'd like. :)  I'm not saying this is necessarily bad, but they do contribute to this proliferation of secondary solutions.

Given the results of Maciej's latest survey, which showed git-usage very high, I'm glad we're considering improving the workflow. :)
Comment 4 Ryosuke Niwa 2013-02-20 02:11:20 PST
FYI, I'm not intending to work on this bug. I just filed it for the record so if anyone's interested in adding such a script, please do so.
Comment 5 Ryosuke Niwa 2013-12-03 14:17:20 PST
Created attachment 218339 [details]
Adds a new webkit-patch command
Comment 6 Benjamin Poulain 2013-12-03 14:23:10 PST
Comment on attachment 218339 [details]
Adds a new webkit-patch command

View in context: https://bugs.webkit.org/attachment.cgi?id=218339&action=review

Great idea!

> Tools/Scripts/webkitpy/tool/commands/setupgitclone.py:49
> +        run_git(["svn", "init", "--prefix=origin/", "-T", "trunk", "http://svn.webkit.org/repository/webkit"])

Should this be using https?
Comment 7 Ryosuke Niwa 2013-12-03 14:24:50 PST
Created attachment 218341 [details]
Patch for landing
Comment 8 Ryosuke Niwa 2013-12-03 14:26:46 PST
Comment on attachment 218341 [details]
Patch for landing

Clearing flags on attachment: 218341

Committed r160039: <http://trac.webkit.org/changeset/160039>
Comment 9 Ryosuke Niwa 2013-12-03 14:26:51 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Ryosuke Niwa 2013-12-03 14:35:28 PST
Committed r160043: <http://trac.webkit.org/changeset/160043>