530 likes | 721 Views
27-Mar(Fri) , 2009. 3 rd Korea Android Seminar. Using Repo to maintain Android. Lim,GeunSik (invain@naver.com , leemgs@gmail.com) http://blog.naver.com/invain OS Group, SAIT, Samsung Electronics. 1 /51. Agenda.
E N D
27-Mar(Fri) , 2009 3rd Korea Android Seminar Using Repo to maintain Android • Lim,GeunSik • (invain@naver.com , leemgs@gmail.com) • http://blog.naver.com/invain • OS Group, SAIT, Samsung Electronics 1/51 3rd Korea Android Seminar
3rd Korea Android Seminar Agenda 01. History02. Repo on android opensource project (AOSP)03. git Brief overview 04. How to use git ( installation and Practice )05. Commands (Tutorial)06. Contribution Workflow for AOSP 07. Opensource tools to help git08. Quick Reference09. X86 android using git tree10. X86 Android Platform on VirtualBox 2/51
3rd Korea Android Seminar 01. History Why do I prepare Repo(Git) as SCM? Internal Potential Power • Google is a content provider • Partnerships (OHA 47 companies) • Mind-Share • Still Vaporware in market • Lack of Vertical Integration Android’s SWOT Analysis SCM Of Android • Proprietary clones (License Inheritance) • Advertising competition • Social networking applications • Developing markets * SCM : Source Code Management External Environments 3/51
3rd Korea Android Seminar 01. History Location of SCM in FOSS World 4/51
3rd Korea Android Seminar 01. History Have we addressed everyting? requirements How to glue all together? Design Implement integrate How to design Linux? Tools? What packages to use? test What package version? Dependencies? deployment maintenance 5/51
3rd Korea Android Seminar 01. History Can we control scalable project ? It’s hard enough to control everything when you know where it all came from add packages to a variety of platforms ... 6/51
3rd Korea Android Seminar 01. History What do you like Version Control System? 7/51
3rd Korea Android Seminar 02. Repo on aosp Repo Command on Android Git trees • What is “Repo”(The Multiple Git Repository Tool ) Script? • Repo is a tool that we built on top of Git. Repo helps us manage the many Git repositories. Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android. • Installing Repo • $ curl(or wget) http://android.git.kernel.org/repo >~/bin/repo • $ chmod a+x ~/bin/repo • $ mkdir mydroid ← working-directory-name • $ cd mydroid • $ repo init -u git://android.git.kernel.org/platform/manifest.git • Synchronizing your client • To synchronize the files for all available projects: • $ repo sync • To synchronize the files for selected projects: • $ repo sync project1 project2 ... 8/51
3rd Korea Android Seminar 02. Repo on aosp Repo Command on Android Git trees • Creating topic branches • To start a topic branch using Repo: • $ repo start branchname • To verify that your new branch was created: • $ repo status • Using topic branches • To assign the branch to a particular project: • $ repo start branchname project • To switch back and forth among branches that you have created in your local work environment: • $ git checkout branchname • To see a list of existing branches: • $ git branch • The name of the current branch will be preceded by an asterisk. 9/51
3rd Korea Android Seminar 02. Repo on aosp Repo Command on Android Git trees • Viewing client status • To list the state of your files: • $ repo status • To see uncommitted edits: • $ repo diff • The repo diff command shows every local edit that you have made that would not go into the commit, if you were to commit right now. • To see every edit that would go into the commit if you were to commit right now, you need a Git command, git diff. Before running it, be sure you are down in the project directory: • $ cd ~/workingdirectory/project • $ git diff --cached 10/51
3rd Korea Android Seminar 02. Repo on aosp Repo Command on Android Git trees • Recovering sync conflicts • If a repo sync shows sync conflicts: • View the files that are unmerged (status code = U). • Edit the conflict regions as necessary. • Change into the relevant project directory, run git add and git commit for the files in question, and then "rebase" the changes. For example: • $ cd bionic • $ git add bionic/* • $ git commit • $ git rebase --continue • When the rebase is complete start the entire sync again: • $ repo sync bionic proj2 proj3 ... projN 11/51
3rd Korea Android Seminar 02. Repo on aosp Repo Command on Android Git trees • Cleaning up your client files • To update your local working directory after changes are merged in Gerrit: • $ repo sync • To safely remove stale topic branches: • $ repo prune • Deleting a client • Deleting a client will permanently delete any changes you have not yet uploaded for review. Because all state information is stored in your client, you only need to delete the directory from your filesystem: • $ cd ~ • $ rm -rf working-directory-name 12/51
3rd Korea Android Seminar 02. Repo on aosp Repo Command on Android Git tree • Scripting common tasks • You can use Repo to run the same program across all projects: • $ repo forall [ proj1 proj2 ... projN ] -c 'echo $REPO_PROJECT $@' [ arg1 arg2 ... argN ] • The -c argument is evaluated through /bin/sh and any arguments after it are passed through as shell positional parameters. • Repo command reference • (init, sync, upload, download, forall, help, prune, start, status) • Repo usage takes the following form: • $ repo command options • Optional elements are shown in brackets [ ]. Once Repo is installed, you can get information about any command by running • $ repo help command 13/51
3rd Korea Android Seminar 03. git Brief overview History of Git • Started in 2005 to replace BitKeeper(http://www.bitkeeper.com/.) • Designed to support the kernel development. (2.6.12 ~ )http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=summary • Multi-platform: Mac OS X, Windows, Linux and Unix • GPL v2 & Originally written by Linus Torvalds • http://git.or.cz/gitwiki/LinusTalk200705Transcript • Git is currently maintained by Junio C Hamano 14/51
3rd Korea Android Seminar 03. git Brief overview Projects that use Git for their SCM • Used widely • Android (http://android.git.kernel.org ) , • Moblin (http://git.moblin.org) , • OLPC (http://dev.laptop.org/git )) , • Linux (http://git.kernel.org , from 2.6.12 on 17 Jun 2005 ) , • GCC (http://gcc.gnu.org/git/), • Glibc (http://sourceware.org/git/), • Fedora(http://git.fedoraproject.org/) , • Gnome (http://git.gnome.org ), • Wine (http://source.winehq.org/git/) , • Samba (http://gitweb.samba.org/) , • FreeDesktop.org (http://cgit.freedesktop.org/ X.org,Cairo) , • Perl (http://perl5.git.perl.org/) , • Ruby on Rails, VLC, yum, OpenVZ, Udev, ALSA, mtd-utils, DragonFly BSD, Compiz-Fusion, GNU AutoConf/Automake, U-Boot, X264, etc … Glibc 15/51
3rd Korea Android Seminar 03. git Brief overview What is Git? • Git manages changes to tree of files over time. • Git is optimized for: • Distributed Development • Large files set • Complex merges • Making trial branches • Being very fast • Being robust • Git is not optimized for: • Tracking file permissions and ownership • Track individual filles with separate history http://git-scm.com/ (Before → http://git.or.cz) 16/51
3rd Korea Android Seminar 03. git Brief overview Git Homepage What is Git? SourceCode Quick Guide Manual (http://book.git-scm.com) 17/51
3rd Korea Android Seminar 03. git Brief overview The name "I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'git' " -Linus Torvald git is British slang for "silly, stupid, or worthless person" 18/51
3rd Korea Android Seminar 03. git Brief overview The name • Alternatively, Linus said: • that "git" can mean anything, depending on your mood: • Random three-letter combination that is pronounceable, and not actually used by any common UNIX command. • Stupid. Contemptible and despicable. Simple. • Global information tracker if you're in a good mood, and it actually works for you. • Goddamn idiotic truckload of sh*t when it breaks 19/51
3rd Korea Android Seminar 03. git Brief overview Linus’s Core Goal • It must be distributed • Disconnected mode of operation • "Trusted Lieutenants" concept • Very strong safeguards against corruption, either accidental or malicious • Fast merge and search • "Take CVS as an example of what not to do; if in doubt, make the exact opposite decision." -Linus 20/51
3rd Korea Android Seminar 03. git Brief overview Usage Concepts • Everyone has the commit bit. • Send the patch or publish repository. • Multi protocols: git, HTTP and SSH. • Everyone has the entire "repository". • (Disks are cheap) • Every ID is based on SHA-1 sha-1 is 160 bits long 21/51
3rd Korea Android Seminar 03. git Brief overview Facts 2009-03-04 • The overall design is heavily based on pipeline of tools" • UNIX philosophy. • Mostly written in C, with higher level UI in POSIX shell and some Perl/Python/Wish mixture. • Every git command is a git-XXXX application. • Currently more than 140+ commands are available. • Git doesn't have a specialized built-in help system.
3rd Korea Android Seminar 03. git Brief overview Concepts • Repository:an archive of what the working tree looked like at different times in the past • Working tree: The tree of actual checked out files. Contains a .git directory. • Branch: a new development tree, which is disjoint from the other you've just cloned. • Master repository:The mainline of development in most repositories is done on a branch master called “master". • Tag: a link to a commit ID. • Head: HEAD refers to the most recent commit of the last • branch you checked out. • Merge: Consolidate work • Index: Git does not commit changes directly from the working tree into the repository. Instead, changes are rst registered in something called the index.
3rd Korea Android Seminar 03. git Brief overview Flow
3rd Korea Android Seminar 04. How to use git How to install git Fedora 9: sudo yum install git Ubuntu 8.XX: sudo apt-get install git git-core giggle If you want to install full components, use asterrisk character like git*. giggle is a GUI tool, others are gitk git-gui 25/51
3rd Korea Android Seminar 05.Commands (Tutorial) Git’s components Git has many component program, the following is an unabridged list of the them as of git version 1.6.2. 140+ Commands
3rd Korea Android Seminar 05.Commands (Tutorial) Git Quick Howto Summary: basic commands • init/clone • pull • log/gitk • add/commit • push $ git init $ git clone <some/where/else> $ git pull <origin> <master> $ git log $ gitk $ git add <./kernel/sched.c> $ git commit $ git push <origin> <head>
3rd Korea Android Seminar 06. Contribution Workflow for AOSP Contribution Workflow for AOSP 1/2 If you are interested in developing applications for Android, visit the Android application developer site. Continue 28/51
3rd Korea Android Seminar 06. Contribution Workflow for AOSP Contribution Workflow for AOSP 2/2 29/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - gitk GITK is Generalized Interface Toolkit. The aim of the GITK project is to provide a solution, which will dramatically improve the adaptivity of software. The vision is to get "user interfaces for all" and even more. http://gitk.sourceforge.net/ 30/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - Git-gui http://www.kernel.org/pub/software/scm/git/docs/git-gui.html A Tcl/Tk based portable graphical user interface to Git. git-gui focuses on allowing users to make changes to their repository 31/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - Git-web Gitweb is a Git web interface, the one working on http://www.kernel.org/git/. It is written in Perl, and can be used as a CGI script, or as a mod_perl legacy script (run by ModPerl::Registry handler). It allows browsing a git repository (or a set of git repositories) using a web browser. 32/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - Git-php The goal of git-php is a robust PHP web interface to git repositories. It is meant to be easily customizable through styles and the ability to be embedded into any PHP page. For example, creating a git repository viewer plug-in for your favorite PHP based cms should be easy with git-php. http://code.google.com/p/git-php/ 33/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - Tig Tig is a git repository browser that additionally can act as a pager for output from various git commands. http://jonas.nitro.dk/tig/ * Examples: The blame view, The diff view, The log view, The main and diff view, The main view, The revision graph rendering, Browsing the commit tree The revision graph rendering 34/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - Msysgit Git on Windows was only officially supported using Cygwin. To help make a native Windows version, this project was started, based on the fork. This project tries to provide a repository containing everything needed to compile MinGW Git from scratch, on Windows. http://code.google.com/p/msysgit/ 35/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - GitHub GitHub(Online project hosting using Git.) is the easiest and prettiest way to participate in that collaboration: fork projects, send pull requests, monitor development, all with ease. GitHub was written for public, open source projects and private, proprietary codes — if you use Git, GitHub is for you. • Free! • Unlimited Public Repositories • Unlimited Public Collaborators • 300 MB Disk Space 36/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - cgit Cgit is a cgi application implemented in C: it's basically (yet) another git command, used to generate html. it is licensed under GPL v2. All git operations are performed by linking with libgit.a http://hjemli.net/git/cgit/ 37/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - gitstat Gitstat is an Open Source, web-based git statistics interface. You can browse up-to-date statistics information, search and view changesets(patchs) status, monitor git tree. ... http://sourceforge.net/projects/gitstat/ 38/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - Qgit • QGit is a git GUI viewer built on Qt/C++. Qgit implements a GUI for the most common StGIT commands like push/pop and apply/format patches. • With qgit you will be able to browse revisions history, view patch content and changed files, graphically following different development branches. http://digilander.libero.it/mcostalba/ 39/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - TortoiseGit • It is porting TortoiseSVN to TortoiseGit The latest release 0.4.2.0 This release can complete regular task, such commit, show log, diff two version, create branch and tag, Create patch and so on. http://code.google.com/p/tortoisegit/ 40/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - Git Extensions • Git Extensions is a toolkit to make working with Git under Windows more intuitive. The shell extension will intergrate in Windows Explorer and presents a context menu on files and directories. There is also a Visual Studio plugin to use git from Visual Studio. Sourcecode: http://github.com/spdr870/gitextensions/tree/master 41/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - Gerrit • Gerrit is a web based code review system, facilitating online code reviews for projects using the Git version control system. • http://code.google.com/p/gerrit/ 42/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - Jgit/Egit • JGit/EGit is an Eclipse plugin for working with Git repositories. JGit and EGit are implementations of the Git SCM (by King Penguin) in Java. • It consists of a generic package for reading and writing to a Git repository, plus an Eclipse-specific plugin. • EGit is an Eclipse Team provider for Git. http://code.google.com/p/egit/ • JGit is a 100% pure Java implementation of Git. EGit relies upon JGit for the bulk of its implementation. http://www.jgit.org/ 43/51
3rd Korea Android Seminar 07. Opensource tools to help git Front Ends - StGit StGit is a Python application providing similar functionality to Quilt (i.e. pushing/popping patches to/from a stack) on top of Git. These operations are performed using Git commands and the patches are stored as Git commit objects, allowing easy merging of the StGit patches into other repositories using standard Git functionality. http://www.procode.org/stgit/ • *Help • For a full list of StGit commands: $ stg helpFor • quick help on individual subcommands: $ stg help <cmd> • For more extensive help on a subcommand: $ man stg-<cmd> • (The documentation is also available in HTML format.) Ref) Quilt originally was based on Andrew Morton's patch scripts found at http://www.zip.com.au/~akpm/linux/patches/ 44/51
3rd Korea Android Seminar 08. Quick Reference Git Overview 45/51
3rd Korea Android Seminar 08. Quick Reference Git Cheat Sheet 1/2 46/51
3rd Korea Android Seminar 08. Quick Reference Git and Repo Cheat Sheet 47/51
3rd Korea Android Seminar 09. X86 android using git tree ASUS EEE701 Netbook’s Git tree Dima Zavin <dima@android.com> Dima Zavin <dima@android.com> * Config file for X86 Netbookhttp://android.git.kernel.org/?p=platform/vendor/asus/eee_701.git;a=blob;f=kernel.config;h=181bdcff0ee5996c4c9d93deb9f2666db2f9f473;hb=3d3a44ef8809c999ffb5d1e18d0178e7c13cf49b 48/51
3rd Korea Android Seminar 09. X86 android using git tree ASUS EEE701 Netbook’s Git tree kernel kernel.config kernel.version modules/atl2.ko modules/bitblit.ko modules/cfbcopyarea.ko modules/cfbfillrect.ko modules/cfbimgblt.ko modules/drm-patches/0001-intelfb-Force-color-depth-changes-to-be-applied-to.patch modules/drm-patches/0002-intelfb-Also-fail-check_var-if-the-virtual-screen-d.patch modules/drm-patches/0003-intel_fb-pan_display-should-call-mode_set_base-and.patch modules/drm-patches/0004-intel_fb-Add-a-hack-to-allocate-the-virtual-screen.patch modules/drm.ko modules/fbcon.ko modules/font.ko modules/i915.ko modules/module.versions modules/softcursor.ko system.prop AT_Translated_Set_2_keyboard.kcm AT_Translated_Set_2_keyboard.kl Android.mk AndroidProducts.mk BoardConfig.mk disk_layout.conf eee_701.mk init.eee_701.rc init.eee_701.sh init.rc 49/51
3rd Korea Android Seminar 10. X86 Android Platform on VirtualBox X86 Android Platform on Virtualbox http://www.youtube.com/watch?v=y3dnFD9CBOk 50/51