Revision 4e1dc640097d4e389f12bcf12f75cdf7e4ceae61 authored by Junio C Hamano on 14 April 2006, 22:57:32 UTC, committed by Junio C Hamano on 15 April 2006, 04:52:50 UTC
I noticed bisect does not work well without both good and bad.
Running this script in git.git repository would give you quite
different results:

	#!/bin/sh
        initial=e83c5163316f89bfbde7d9ab23ca2e25604af290

        mid0=`git rev-list --bisect ^$initial --all`

        git rev-list $mid0 | wc -l
        git rev-list ^$mid0 --all | wc -l

        mid1=`git rev-list --bisect --all`

        git rev-list $mid1 | wc -l
        git rev-list ^$mid1 --all | wc -l

The $initial commit is the very first commit you made.  The
first midpoint bisects things evenly as designed, but the latter
does not.

The reason I got interested in this was because I was wondering
if something like the following would help people converting a
huge repository from foreign SCM, or preparing a repository to
be fetched over plain dumb HTTP only:

        #!/bin/sh

        N=4
        P=.git/objects/pack
        bottom=

        while test 0 \< $N
        do
                N=$((N-1))
                if test -z "$bottom"
                then
                        newbottom=`git rev-list --bisect --all`
                else
                        newbottom=`git rev-list --bisect ^$bottom --all`
                fi
                if test -z "$bottom"
                then
                        rev_list="$newbottom"
                elif test 0 = $N
                then
                        rev_list="^$bottom --all"
                else
                        rev_list="^$bottom $newbottom"
                fi
                p=$(git rev-list --unpacked --objects $rev_list |
                    git pack-objects $P/pack)
                git show-index <$P/pack-$p.idx | wc -l
                bottom=$newbottom
        done

The idea is to pack older half of the history to one pack, then
older half of the remaining history to another, to continue a
few times, using finer granularity as we get closer to the tip.

This may not matter, since for a truly huge history, running
bisect number of times could be quite time consuming, and we
might be better off running "git rev-list --all" once into a
temporary file, and manually pick cut-off points from the
resulting list of commits.  After all we are talking about
"approximately half" for such an usage, and older history does
not matter much.

Signed-off-by: Junio C Hamano <junkio@cox.net>

1 parent 40c2fe0
History
File Mode Size
t4100
.gitignore -rw-r--r-- 6 bytes
Makefile -rw-r--r-- 422 bytes
README -rw-r--r-- 6.6 KB
annotate-tests.sh -rw-r--r-- 3.2 KB
diff-lib.sh -rwxr-xr-x 1.4 KB
lib-read-tree-m-3way.sh -rwxr-xr-x 4.1 KB
t0000-basic.sh -rwxr-xr-x 7.6 KB
t0010-racy-git.sh -rwxr-xr-x 609 bytes
t1000-read-tree-m-3way.sh -rwxr-xr-x 16.3 KB
t1001-read-tree-m-2way.sh -rwxr-xr-x 10.2 KB
t1002-read-tree-m-u-2way.sh -rwxr-xr-x 9.7 KB
t1100-commit-tree-options.sh -rwxr-xr-x 1.1 KB
t1200-tutorial.sh -rwxr-xr-x 4.1 KB
t1300-repo-config.sh -rwxr-xr-x 5.3 KB
t2000-checkout-cache-clash.sh -rwxr-xr-x 1.2 KB
t2001-checkout-cache-clash.sh -rwxr-xr-x 2.4 KB
t2002-checkout-cache-u.sh -rwxr-xr-x 740 bytes
t2003-checkout-cache-mkdir.sh -rwxr-xr-x 2.5 KB
t2004-checkout-cache-temp.sh -rwxr-xr-x 5.5 KB
t2100-update-cache-badpath.sh -rwxr-xr-x 1.0 KB
t3000-ls-files-others.sh -rwxr-xr-x 1.1 KB
t3001-ls-files-others-exclude.sh -rwxr-xr-x 1.3 KB
t3002-ls-files-dashpath.sh -rwxr-xr-x 1.2 KB
t3010-ls-files-killed-modified.sh -rwxr-xr-x 2.0 KB
t3020-ls-files-error-unmatch.sh -rwxr-xr-x 650 bytes
t3100-ls-tree-restrict.sh -rwxr-xr-x 3.6 KB
t3101-ls-tree-dirname.sh -rwxr-xr-x 3.7 KB
t3200-branch.sh -rwxr-xr-x 909 bytes
t3300-funny-names.sh -rwxr-xr-x 4.0 KB
t3400-rebase.sh -rwxr-xr-x 902 bytes
t3401-rebase-partial.sh -rwxr-xr-x 1.2 KB
t3500-cherry.sh -rwxr-xr-x 1.4 KB
t3600-rm.sh -rwxr-xr-x 2.2 KB
t3700-add.sh -rwxr-xr-x 416 bytes
t4000-diff-format.sh -rwxr-xr-x 1.0 KB
t4001-diff-rename.sh -rwxr-xr-x 1.0 KB
t4002-diff-basic.sh -rwxr-xr-x 14.5 KB
t4003-diff-rename-1.sh -rwxr-xr-x 4.0 KB
t4004-diff-rename-symlink.sh -rwxr-xr-x 1.5 KB
t4005-diff-rename-2.sh -rwxr-xr-x 2.8 KB
t4006-diff-mode.sh -rwxr-xr-x 1006 bytes
t4007-rename-3.sh -rwxr-xr-x 2.7 KB
t4008-diff-break-rewrite.sh -rwxr-xr-x 5.9 KB
t4009-diff-rename-4.sh -rwxr-xr-x 2.8 KB
t4010-diff-pathspec.sh -rwxr-xr-x 1.7 KB
t4011-diff-symlink.sh -rwxr-xr-x 1.7 KB
t4100-apply-stat.sh -rwxr-xr-x 1.2 KB
t4101-apply-nonl.sh -rwxr-xr-x 647 bytes
t4102-apply-rename.sh -rwxr-xr-x 689 bytes
t4103-apply-binary.sh -rwxr-xr-x 3.0 KB
t4109-apply-multifrag.sh -rwxr-xr-x 2.7 KB
t4110-apply-scan.sh -rwxr-xr-x 1.3 KB
t4112-apply-renames.sh -rwxr-xr-x 3.2 KB
t5000-tar-tree.sh -rwxr-xr-x 2.7 KB
t5300-pack-object.sh -rwxr-xr-x 4.9 KB
t5400-send-pack.sh -rwxr-xr-x 1.4 KB
t5500-fetch-pack.sh -rwxr-xr-x 2.7 KB
t5600-clone-fail-cleanup.sh -rwxr-xr-x 897 bytes
t6000lib.sh -rwxr-xr-x 2.5 KB
t6002-rev-list-bisect.sh -rwxr-xr-x 8.2 KB
t6003-rev-list-topo-order.sh -rwxr-xr-x 8.5 KB
t6010-merge-base.sh -rwxr-xr-x 1.2 KB
t6020-merge-df.sh -rwxr-xr-x 528 bytes
t6021-merge-criss-cross.sh -rwxr-xr-x 1.3 KB
t6022-merge-rename.sh -rwxr-xr-x 5.1 KB
t6101-rev-parse-parents.sh -rwxr-xr-x 1.6 KB
t7001-mv.sh -rwxr-xr-x 1.0 KB
t7101-reset.sh -rwxr-xr-x 1.4 KB
t8001-annotate.sh -rwxr-xr-x 114 bytes
t8002-blame.sh -rwxr-xr-x 111 bytes
test-lib.sh -rwxr-xr-x 4.6 KB

README

back to top