Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 111 lines (86 sloc) 3.754 kb
bd2d3e9 Greg Kroah-Hartman add the script...
authored
1 #!/bin/bash
2 #
f0a6748 Greg Kroah-Hartman fix up set_it_up
authored
3 # Copyright 2012 Greg Kroah-Hartman <greg@kroah.com>
4 # Copyright 2012 Linux Foundation
5 #
6 # Released under the GPLv2 only.
7 #
8 # Initialize the linux repo with the remote git trees that I need in order to
9 # get things done. This consists of the development trees in the work/
10 # directory, my local gregkh/ directory and patch queue, and the stable trees.
11 #
12 # The work directory is the most complex, it consists of one "root" repo,
13 # called "torvalds" that is based on Linus's upstream kernel tree. I then
14 # create multiple trees based on that, each in a separate subdirectory, based
15 # on the "topic". In each of those trees, I have a 'next' and 'linus' branch
16 # that is used to send stuff to linux-next and Linus's tree, respectively.
bd2d3e9 Greg Kroah-Hartman add the script...
authored
17 #
18 # I also do the "work" on branches that are based on these 'next' and 'linus'
19 # branches, that is what the 'send the email' scripts expect patches to be
20 # applied to, so they know how to push and notify people when stuff is added.
21 #
f0a6748 Greg Kroah-Hartman fix up set_it_up
authored
22 # The main gregkh/ directory is what I do local work on for things not ready to
23 # be merged upstream. It's also tied to a quilt tree, to save patches in a
24 # safe place for storage and passing to other machines.
bd2d3e9 Greg Kroah-Hartman add the script...
authored
25 # Yeah, it's a bit complex, but it works for me.
26 #
27
f0a6748 Greg Kroah-Hartman fix up set_it_up
authored
28 # go into the work directory and set up everything there first.
29
30 cd work/
31
32 WORK_TREES="driver-core staging tty usb char-misc"
bd2d3e9 Greg Kroah-Hartman add the script...
authored
33
34 # First, clone Linus's tree in --bare mode as we are going to work off of that:
35 #git clone --bare git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git torvalds
36
37 # for local testing, to make it faster...
38 git clone --bare gregkh@clark:linux/work/torvalds torvalds
39
40 # now make clones of it for the different work types
f0a6748 Greg Kroah-Hartman fix up set_it_up
authored
41 for TREE in ${WORK_TREES}
bd2d3e9 Greg Kroah-Hartman add the script...
authored
42 do
43 echo "*** creating ${TREE} tree"
44 git clone -s torvalds ${TREE}
45
46 echo "*** setting up the master link"
47 cd ${TREE}
48 git remote add temp gitolite@198.145.19.202:/pub/scm/linux/kernel/git/gregkh/${TREE}.git
49 git remote rm origin
50 git remote rename temp origin
51
52 # ok, there has to be a better way than to add the following lines to
53 # the git config to have the master branch track the remote master
54 # branch, but I can't figure it out...
55 echo "[branch \"master\"]" >> .git/config
56 echo " remote = origin" >> .git/config
57 echo " merge = refs/heads/master" >> .git/config
58
59 echo "*** setting up kroah.com link"
60 git remote add kroah.com git@git.kroah.com:kernel/${TREE}.git
61
62 echo "*** fetching from remote repo"
63 git fetch origin
64
65 echo "*** setting up branches"
66 git checkout -t -b ${TREE}-linus origin/${TREE}-linus
67 git checkout -b work-linus ${TREE}-linus
68 git checkout -t -b ${TREE}-next origin/${TREE}-next
69 git checkout -b work-next ${TREE}-next
70
71
72 cd ..
73 done
74
75 # make empty files for patch work
76 touch s s1 s2
77
f0a6748 Greg Kroah-Hartman fix up set_it_up
authored
78
79 cd ..
80
81 # clone my local tree, so that I can do stuff
82 echo "*** Creating gregkh repo"
83 git clone --shared work/torvalds gregkh
84
85 # clone my patch queue, not much there, but it's a place to work from
86 echo "*** Cloning patch queue"
87 git clone gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/gregkh/patches.git patches
88 cd patches
89 git remote add kroah.com git@git.kroah.com:kernel/patches.git
90 cd ..
91
92 # Now for the stable stuff
93 echo "*** Setting up the Stable directories"
94 cd stable/
95
96 # we need the stable-queue first
97 echo "*** Cloning the stable-queue"
98 git clone gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/stable-queue.git
99 cd stable-queue
100 git remote add kroah.com git@git.kroah.com:kernel/stable-queue.git
101 cd ..
102
103 echo "*** Cloning the linux-stable tree, will take a while"
104 git clone gitolite@ra.kernel.org:/pub/scm/linux/kernel/git/stable/linux-stable.git
105 echo "*** Done, please set up the branches and stable repos as you need."
106
107 cd ..
108
109 echo "*** Also set up longterm/ if you still need it."
110
Something went wrong with that request. Please try again.