Chromium Docs - Vanilla msysgit workflow (original) (raw)

This describes how you can use msysgit on Windows to work on the Chromium git repository, without setting up Cygwin or hacking the git cl, git try and other scripts to work under a regular Windows shell.

The basic setup is to set up a regular git checkout on a Linux (or Mac) box, and use this exclusively to create your branches and run tools such as git cl, and have your Windows box treat this git repository as its upstream.

The advantage is, you get a pretty clean setup on your Windows box that is unlikely to break when the various custom git tools like git cl change. The setup is also advantageous if you regularly build code on Windows and then want to test it on Linux, since all you need to test on your Linux box is a git push from Windows followed by building and testing under Linux.

The disadvantage is that it adds an extra layer between the Chromium git repo and your Windows checkout. In my experience (joi@chromium.org) this does not actually slow you down much, if at all.

The most frequently used alternative to this workflow on Windows seems to be using Cygwin and creating a checkout directly according to the instructions at UsingGit. The advantage of that approach is you lose the extra overhead, the disadvantage seems to be mostly speed and having to run a Cygwin shell rather than just a normal Windows cmd.

Please note that the instructions below are mostly from memory so they may be slightly incorrect and steps may be missing. Please feel free to update the page with corrections and additions based on your experience.

Details

Create your checkouts:

  1. Create a git checkout on your Linux box, with read/write abilities, as per UsingGit. The rest of these instructions assume it is located at /home/username/chrome
  2. Install msysgit on your Windows box.

Starting a new topic branch:

  1. Linux: git branch mytopic (or you may want to use e.g. the LKGR script from UsingGit).
  2. Windows: git fetch then git checkout mytopic

Normal workflow on Windows:

  1. ...edit/add some files...
  2. git commit -a -m "my awesome change"
  3. ...edit more...
  4. git commit -a -m "follow-up awesomeness"
  5. git push

Normal workflow on Linux:

Avoiding excessive file changes (to limit amount of Visual Studio rebuilds when switching between branches):

Pipelining:

  1. Linux:
    1. git checkout lk0426-mytopic
    2. git checkout -b lk0426-mytopic-nextstep
  2. Windows:
    1. git fetch && git checkout lk0426-mytopic-nextstep
    2. ...work as usual...
    3. git push
  3. Later, on Linux:
    1. make_new_lkgr_branch lk0428
    2. git merge lk0428 lk0426-mytopic
    3. git branch -m lk0426-mytopic lk0428-mytopic (to rename)
    4. git merge lk0428-mytopic lk0426-mytopic-nextstep
    5. git branch -m lk0428-mytopic-nextstep lk0428-mytopic-nextstep (to rename)
  4. Later, when you want to commit one of the earlier changes in the pipeline; all on Linux. The reason you may want to create the separate tip-of-tree branch is in case the try bots show your change failing on tip-of-tree and you need to do significant additional work, this avoids having to roll back the tip-of-tree merge:

Janitorial work on Windows:

Gotchas: