When contributing code to Chromium, the last step in the life of a change list is committing it, after which it's closed.
The preferred way of committing changes is via the commit queue. However, in certain circumstances it is acceptable or necessary to directly commit your change, bypassing the commit queue. This is discouraged however, due to not running the tests (hence higher risk of breakage), and requires more supervision on the part of the committer. Generally directly committing should only be done if the CQ itself is broken, or the CL cannot be processed by the CQ. If you wish to skip the tree status checks, but otherwise use the CQ, you can use NOTREECHECKS=true in the Rietveld issue description, though this is obviously strongly discouraged. The primary use case is if the tree is closed due to some breakage, and you wish to commit a change that will fix the breakage.NOTRY and NOTREECHECKS are flags for the CQ: you still commit by clicking the "Commit" box.In a nutshell:
In case of emergencies, please remember to at least:
Tree closure: If the most recent set of changes to the repository breaks the build, we say the tree is red, or closed. You cannot check in your changes until it is green again. You can check the status via apps at Chromium Tree Status or Blink Tree Status. More low-level, you can check the BuildBot waterfalls (Chromium | Chromium OS) to see that the columns are mostly green before checking in your changes. Otherwise, you will not know if your changes break the build or not.
ReasonsGood reasons to dcommit code:
Bad reasons to dcommit code:
Commandsgit cl land (for git repos)git cl landgit cl dcommit (for svn repos)For ChromiumOS:
git cl push
In more detail:
# Sync branch to ToTgit pull --rebase origin mastergit rebase master my_feature_branchgclient sync# Update git-svn data with ToTgit fetch origingit svn fetch# Actually commitgit cl dcommitdcommitgit cl dcommit is lower-level and pickier than the commit queue; you need to have git-svn data set up, and your branch needs to be up-to-date with ToT. This command is only used for svn repositories.If your checkout was created by fetch, it should have the git-svn data set up. If it wasn't, or if it was created by
fetch --nosvn=True, set up the git-svn metadata by running:git svn init --prefix=origin/ -T trunk/src svn://svn.chromium.org/chromegit config --replace svn-remote.svn.fetch trunk/src:refs/remotes/origin/git-svngit fetch origingit svn fetchSync branch with ToT:
git pull --rebase origin mastergit rebase master my_feature_branchgclient syncUpdate git-svn data with ToT:
git fetch origin # Optional, makes next step fastergit svn fetch # Ensure your svn data is up-to-date with ToTTroubleshooting dcommitSometimes dcommit fails, primarily due to SVN metadata being out of date or corrupted (e.g., if git cl is interrupted during a dcommit). Symptoms include it trying to refetch commits you've already fetched, or printing
"Transaction is out of date" errors on unrelated files. This can be fixed by updating or rebuilding SVN metadata, which does not require any changes to your local git repository itself (outside of the SVN metadata).If the metadata is just out of date, this updates it:
cd "$CHROMIUM_DIR" # or $BLINK_DIR or other repository rootgit fetch origingit svn fetchIf the metadata is corrupt, this deletes it and rebuilds it:
cd "$CHROMIUM_DIR" && rm -rf .git/svn # clobber git-svn metadatagit svn find-rev r1 # run a no-op command to rebuild metadataIf you get the following error:
Can't guess svn branch -- try specifying it on the command line...then you probably need to re-run the git-svn setup steps correctly on the master branch, and then create a new branch. See Get the Code for git-svn setup details.
svn dcommitIt is also possible to use
svn dcommit, but this does not integrate with Rietveld (e.g., it uses your local git commit log as the commit message) and is discouraged, generally being reserved for emergencies.Committing a patch for a non-committerFirst check that the non-committer has signed the CLA/CCLA and are listed in the AUTHORS and CL Description.
Committing to BlinkTo dcommit to the Blink repo you will need to set up git-svn metadata in third_party/WebKit. (This is not done automatically by 'fetch blink'.) cd third_party/WebKitgit config --replace svn-remote.svn.fetch trunk:refs/remotes/origin/mastergit fetch origingit svn fetchOnce this is set up, you can use git cl dcommit as described above. |
For Developers > Contributing Code >
