Finding where source has branched from git

后端 未结 6 1028
天命终不由人
天命终不由人 2021-01-05 05:22

I have a git repository (covering more or less project history) and separate sources (just a tarball with few files) which have forked some time ago (actually somewhere in 2

6条回答
  •  没有蜡笔的小新
    2021-01-05 06:05

    based on what araqnid said I came up with 9c6c864426bf88429e77c7e22b5aa78e9295b97a (just asked for stuff between 0.61.0 and HEAD) this is probably not the best) you might do better with something like

    git rev-list --no-merges --all | while read rev; do patchsize=$(git diff $rev | wc -c); echo $patchsize $rev; done | sort -n | less
    

    assuming you've imported the tarball into git and have that revision checked out (I did this by untaring and then

    git init
    git add .
    git commit -m "import tarball"
    git remote add origin git://gitorious.org/gammu/mainline.git
    

    So after you do that and the run the above it should output the size of all the diffs in ascending order of patchsize (the first one will be 0 since it'll find the current head) it'll take a long time... but it should find the smallest diff...

提交回复
热议问题