• 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
..
gstools Loading commit data...
subversion_config Loading commit data...
abandon.sh Loading commit data...
basic.sh Loading commit data...
breakpad_unittest.py Loading commit data...
checkout_test.py Loading commit data...
download_from_google_storage_unittests.py Loading commit data...
fix_encoding_test.py Loading commit data...
gcl_unittest.py Loading commit data...
gclient_scm_test.py Loading commit data...
gclient_smoketest.py Loading commit data...
gclient_test.py Loading commit data...
gclient_utils_test.py Loading commit data...
git_cl_test.py Loading commit data...
git_common_test.py Loading commit data...
git_number_test.py Loading commit data...
hooks.sh Loading commit data...
owners.sh Loading commit data...
owners_finder_test.py Loading commit data...
owners_unittest.py Loading commit data...
patch.sh Loading commit data...
patch_test.py Loading commit data...
post-dcommit-hook-test.sh Loading commit data...
presubmit_unittest.py Loading commit data...
push-basic.sh Loading commit data...
push-from-logs.sh Loading commit data...
rename.sh Loading commit data...
rietveld_test.py Loading commit data...
sample_pre_commit_hook Loading commit data...
save-description-on-failure.sh Loading commit data...
scm_unittest.py Loading commit data...
submit-from-new-dir.sh Loading commit data...
submodule-merge-test.sh Loading commit data...
subprocess2_test.py Loading commit data...
test-lib.sh Loading commit data...
trychange_unittest.py Loading commit data...
upload-local-tracking-branch.sh Loading commit data...
upload-stale.sh Loading commit data...
upload_to_google_storage_unittests.py Loading commit data...
upstream.sh Loading commit data...
watchlists_unittest.py Loading commit data...