KernelGitGuide

Differences between revisions 19 and 21 (spanning 2 versions)
Revision 19 as of 2007-05-18 19:44:17
Size: 4393
Editor: ip115-241-58-62
Comment: Typo
Revision 21 as of 2007-05-25 01:51:53
Size: 4290
Editor: collinsap1
Comment:
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
= Where is it? =

http://kernel.ubuntu.com/
Line 6: Line 10:
 * gutsy: rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bcollins/ubuntu-gutsy.git
 * feisty: rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bcollins/ubuntu-feisty.git
 * edgy: rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bcollins/ubuntu-edgy.git
 * dapper: rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bcollins/ubuntu-dapper.git
 * gutsy: git://kernel.ubuntu.com/ubuntu/ubuntu-gutsy.git
 * feisty: git://kernel.ubuntu.com/ubuntu/ubuntu-feisty.git
 * edgy: git://kernel.ubuntu.com/ubuntu/ubuntu-edgy.git
 * dapper: git://kernel.ubuntu.com/ubuntu/ubuntu-dapper.git
Line 11: Line 15:
(actually there are a few more and of special note are the -updates git trees (nb: there can be more than one -updates tree per stable release). To find out what else is available try browsing http://kernel.org/git/ and searching for ubuntu)

''Comment from GregorRosenauer'': The rsync://-URIs are not mentioned anymore on the official [http://git.kernel.org/ Kernel.org git]-pages, but there are git://-URIs which work perfectly (also on update using "pull"), e.g., for gutsy:
 * git://git.kernel.org/pub/scm/linux/kernel/git/bcollins/ubuntu-gutsy.git

''Comment from JurrieOvergoor'': It appears that as of Friday 18-05-2007 12:45 the kernel sources for Ubuntu have moved to kernel.ubuntu.com (see [http://git.kernel.org/?p=linux/kernel/git/bcollins/ubuntu.git;a=summary this commit]). New git://-URIs are:
 * git://kernel.ubuntu.com/ubuntu/ubuntu-dapper.git
 * git://kernel.ubuntu.com/ubuntu/ubuntu-edgy.git
 * git://kernel.ubuntu.com/ubuntu/ubuntu-feisty.git
 * git://kernel.ubuntu.com/ubuntu/ubuntu-gutsy.git
See also [http://kernel.ubuntu.com/git].
(actually there are a few more and of special note are the -updates git trees. To find out what else is available try browsing http://kernel.ubuntu.com/git and searching for ubuntu)
Line 24: Line 18:
To obtain the git binaries, simply install the `git-core` package from dapper, e.g.:{{{
To obtain the git binaries, simply install the `git-core` package from dapper, e.g.:
{{{
Line 31: Line 27:
The Ubuntu Linux kernel git repository is located at rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bcollins/ubuntu-2.6.git. To download a local copy of the repo, use this command: The Ubuntu Linux kernel git repository is located at git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git. To download a local copy of the repo, use this command:
Line 33: Line 29:
  git clone rsync://rsync.kernel.org/pub/scm/linux/kernel/git/bcollins/ubuntu-gutsy.git ubuntu-gutsy   git clone git://kernel.ubuntu.com/ubuntu/ubuntu-gutsy.git ubuntu-gutsy
Line 67: Line 63:
= Ubuntu kernel developers (with access to rookery) =
The kernel team has a private ''git'' repo located on ''rookery'' in /srv/kernel-team. Take care when pushing to this repository.
= Developers with access to kernel.ubuntu.com =
The kernel team has a ''git'' repo located on ''kernel.ubuntu.com'' (AKA zinc.ubuntu.com) in /srv/kernel.ubuntu.com/git/ubuntu.
Line 70: Line 66:
You can, if you want, create a clone for yourself in this directory, and just have your changes pulled when ready. You can, if you want, create a clone for yourself in your directory, and just have your changes pulled when ready.

Suggested way to do this:

{{{
git-clone -l -n -s /srv/kernel.ubuntu.com/git/ubuntu/ubuntu-gutsy.git
vi ubuntu-gutsy/.git/description
( give it a descriptive name )
mv ubuntu-gutsy/.git /srv/kernel.ubuntu.com/git/<user>/my-git-tree.git
}}}

You can now push your changes to this tree via '''ssh'''. Note the '''-l -n -s''' options do a few special things, mainly making your repo share objects with ours (saves space).

Suggest method for keeping this tree synced with the ubuntu tree, instead of git-pull, is to do:

{{{
cd my-tree
git-fetch origin
git-rebase origin
}}}

This will keep your changes on top of the original tree (as opposed to being merged). This is also a good idea because during development (e.g. while following the upstream git repo), we frequently rebase to linux-2.6.git upstream, so the '''HEAD''' is not always suitable for pull/merge.
Line 73: Line 90:
Please read the documentation included with the git source for more details on git commands. Please read the documentation included with the '''git-core''' package for more details on git commands.

Summary

Git is the new SCM used by the Linux kernel developers. Ubuntu has adopted this tool for our own Linux kernel source code so that we can interact better with the community and the other kernel developers.

Where is it?

http://kernel.ubuntu.com/

Current GIT Trees

  • gutsy: git://kernel.ubuntu.com/ubuntu/ubuntu-gutsy.git
  • feisty: git://kernel.ubuntu.com/ubuntu/ubuntu-feisty.git
  • edgy: git://kernel.ubuntu.com/ubuntu/ubuntu-edgy.git
  • dapper: git://kernel.ubuntu.com/ubuntu/ubuntu-dapper.git

(actually there are a few more and of special note are the -updates git trees. To find out what else is available try browsing http://kernel.ubuntu.com/git and searching for ubuntu)

Getting GIT

To obtain the git binaries, simply install the git-core package from dapper, e.g.:

sudo apt-get install git-core

Note that the git package is an entirely different tool which will not do what you want.

Getting the Ubuntu Linux kernel repo

The Ubuntu Linux kernel git repository is located at git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git. To download a local copy of the repo, use this command:

  git clone git://kernel.ubuntu.com/ubuntu/ubuntu-gutsy.git ubuntu-gutsy

This will take some time depending on your connection. There's around 220 MiB of data to download currently (and this always increases).

Once this is complete, you can keep your tree up-to-date by running this command:

  git pull

Pushing changes to the main repo

Since the main repo is not publicly writable, the primary means for sending patches to the kernel team is using git-format-patch. The output from this command can then be sent to the [mailto:kernel-team@lists.ubuntu.com kernel-team] mailing list.

Alternatively, if you have a publicly available git repository for which changes can be pulled from, you can use git-request-pull to generate an email message to send to the [mailto:kernel-team@lists.ubuntu.com kernel-team] mailing list.

Commit templates

In debian/commit-templates/ there are several templates that must be used when commiting changes that you expect to be integrated with the Ubuntu kernel repo. The commit templates contain comments for how to fill out the required information. Also note that all commits must have a Signed-off-by line (the "-s" option to git-commit). A typical git-commit command will look like:

  git-commit -s -F debian/commit-templates/patch -e

Note that the -e (edit) option must follow the -F option, else git will not let you edit the commit-template before committing.

An example commit log will look like such:

  UBUNTU: scsi: My cool change to the scsi subsystem

  UpstreamStatus: Merged with 2.6.15-rc3

  My cool change to the scsi subsystem makes scsi transfers increase
  magically to 124GiB/sec.

  Signed-off-by: Joe Cool Hacker <jch@reet.com>

Developers with access to kernel.ubuntu.com

The kernel team has a git repo located on kernel.ubuntu.com (AKA zinc.ubuntu.com) in /srv/kernel.ubuntu.com/git/ubuntu.

You can, if you want, create a clone for yourself in your directory, and just have your changes pulled when ready.

Suggested way to do this:

git-clone -l -n -s /srv/kernel.ubuntu.com/git/ubuntu/ubuntu-gutsy.git
vi ubuntu-gutsy/.git/description
( give it a descriptive name )
mv ubuntu-gutsy/.git /srv/kernel.ubuntu.com/git/<user>/my-git-tree.git

You can now push your changes to this tree via ssh. Note the -l -n -s options do a few special things, mainly making your repo share objects with ours (saves space).

Suggest method for keeping this tree synced with the ubuntu tree, instead of git-pull, is to do:

cd my-tree
git-fetch origin
git-rebase origin

This will keep your changes on top of the original tree (as opposed to being merged). This is also a good idea because during development (e.g. while following the upstream git repo), we frequently rebase to linux-2.6.git upstream, so the HEAD is not always suitable for pull/merge.

More information

Please read the documentation included with the git-core package for more details on git commands.


CategoryKernel

KernelTeam/KernelGitGuide (last edited 2010-06-28 23:55:41 by c-76-105-148-120)