• iannucci@chromium.org's avatar
    Add git-number script to calculate generation numbers for commits. · aa74cf65
    iannucci@chromium.org authored
    Compatible with any git topology (multiple roots, weird branching/merging, etc.)
    I can't get it to be any faster (in python). Suggestions welcome :).
    
    On z600/linux, this takes 5.1s to calculate the initial count for 2e3de954ef0a
    (HEAD on src.git at the time of writing). Subsequent lookups take ~0.06s. For
    reference, this machine takes 3s to just list the revisions in sorted order
    without any additional processing (using rev-list).
    
    All calculations are stored in a git-notes-style ref with the exception that the
    leaf 'tree' object which would normally be stored in a git-notes world is
    replaced with a packed binary file which consists of records [hash int]. Each
    run of this script will create only 1 commit object on this internal ref which
    will have as its parents:
      * The previous git number commit
      * All of the target commits we calculated numbers for.
    This ref is then excluded on subsequent invocations of rev-list, which means that
    git-number will only ever process commit objects which it hasn't already
    calculated a value for. It also prevents you from attempting to number this
    special ref :).
    
    This implementation only has a 1-byte fanout which seems to be the best
    performance for the repos we're dealing with (i.e. on the order of 500k commit
    objects).  Bumping this up to a 2-byte fanout became extremely slow (I suspect
    the internal caching structures I'm using are not efficient in this mode and
    could be improved). Using no fanout is slower than the 1 byte fanout for lookups
    by about 30%.
    
    R=agable@chromium.org, stip@chromium.org, szager@chromium.org
    BUG=280154,309692,skia:1639
    
    Review URL: https://codereview.chromium.org/26109002
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@236035 0039d316-1c4b-4281-b951-d872f2087c98
    aa74cf65
Name
Last commit
Last update
bootstrap Loading commit data...
git-templates Loading commit data...
git_utils Loading commit data...
recipes Loading commit data...
support Loading commit data...
testing_support Loading commit data...
tests Loading commit data...
third_party Loading commit data...
zsh-goodies Loading commit data...
.gitignore Loading commit data...
LICENSE Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README Loading commit data...
README.codereview Loading commit data...
README.gclient Loading commit data...
README.git-cl Loading commit data...
README.testing Loading commit data...
WATCHLISTS Loading commit data...
apply_issue Loading commit data...
apply_issue.bat Loading commit data...
apply_issue.py Loading commit data...
breakpad.py Loading commit data...
cbuildbot Loading commit data...
checkout.py Loading commit data...
chrome-update-create-task.bat Loading commit data...
chrome-update.bat Loading commit data...
chrome-update.py Loading commit data...
chrome_set_ver Loading commit data...
codereview.settings Loading commit data...
commit_queue.py Loading commit data...
cpplint.bat Loading commit data...
cpplint.py Loading commit data...
cpplint_chromium.py Loading commit data...
create-chromium-git-src Loading commit data...
create-ntfs-junction.c Loading commit data...
create-ntfs-junction.exe Loading commit data...
cros Loading commit data...
cros_sdk Loading commit data...
crup-runner.sh Loading commit data...
download_from_google_storage Loading commit data...
download_from_google_storage.bat Loading commit data...
download_from_google_storage.py Loading commit data...
drover Loading commit data...
drover.bat Loading commit data...
drover.py Loading commit data...
fetch Loading commit data...
fetch.bat Loading commit data...
fetch.py Loading commit data...
fix_encoding.py Loading commit data...
gcl Loading commit data...
gcl.bat Loading commit data...
gcl.py Loading commit data...
gclient Loading commit data...
gclient-new-workdir.py Loading commit data...
gclient.bat Loading commit data...
gclient.py Loading commit data...
gclient_scm.py Loading commit data...
gclient_utils.py Loading commit data...
gerrit_util.py Loading commit data...
git-cl Loading commit data...
git-cl-upload-hook Loading commit data...
git-crsync Loading commit data...
git-crup Loading commit data...
git-gs Loading commit data...
git-lkgr Loading commit data...
git-number Loading commit data...
git-runhooks Loading commit data...
git-try Loading commit data...
git_cl.py Loading commit data...
git_common.py Loading commit data...
git_number.py Loading commit data...
git_try.py Loading commit data...
gn Loading commit data...
gn.bat Loading commit data...
gn.py Loading commit data...
hammer Loading commit data...
hammer.bat Loading commit data...
my_activity.py Loading commit data...
my_reviews.py Loading commit data...
ninja Loading commit data...
ninja-linux32 Loading commit data...
ninja-linux64 Loading commit data...
ninja-mac Loading commit data...
ninja.exe Loading commit data...
owners.py Loading commit data...
owners_finder.py Loading commit data...
patch.py Loading commit data...
presubmit_canned_checks.py Loading commit data...
presubmit_support.py Loading commit data...
profile.xml Loading commit data...
pylint Loading commit data...
pylint.py Loading commit data...
pylintrc Loading commit data...
repo Loading commit data...
rietveld.py Loading commit data...
scm.py Loading commit data...
subcommand.py Loading commit data...
subprocess2.py Loading commit data...
trychange.py Loading commit data...
update_depot_tools Loading commit data...
update_depot_tools.bat Loading commit data...
upload_to_google_storage.py Loading commit data...
watchlists.py Loading commit data...
weekly Loading commit data...
wtf Loading commit data...