On 1/14/08, Jeff King <peff@xxxxxxxx> wrote: > On Sun, Jan 13, 2008 at 11:28:06AM -0500, linux@xxxxxxxxxxx wrote: > > > Maybe a real git wizard will show me how to insert the index entries > > directly without ever doing anything as pedestrian as extracting, hashing, > > and then deleting the files, but it's still not that bad. > > git-read-tree? Unfortunately it has no option to insert only a subset > of the tree. But you can make do with git-ls-tree piped to > git-update-index. > > Using the script below, Jon's sample file seems to be > > v2.6.15-rc6-81-g0b57ee9:drivers/serial/amba-pl010.c > > and it runs in about 8 seconds on v2.6.13..v2.6.15. I think it might be > more intuitive to just diff a temporary index against each tree, but I > don't think there's a way to say "find copies harder, but use only this > subset of files as the source" which makes it less efficient. > > Jon, you might try playing around with different ranges. I get a > different answer for v2.6.13..v2.6.16. That's probably because some of the other drivers in there were also created via copy and edit. The similarity between drivers is what made the original base hard to find. amba-pl010.c is probably a copy/edit from one of the other drivers. I'm pretty sure 2.6.15/amba-pl010.c is right. I started undoing some of the obvious changes like renaming the functions and the diffs are getting pretty small. Thanks for the help on this. I have enough info now to separate the diffs. This would probably make a nice command to add to git since I'm sure other vendors have done copy/edit to make their out of tree drivers. I doubt if any other SCM has a command like this. I'm really starting to hate the "port and forget" that goes on in the embedded world. But I'm beginning to understand why it happens. I've been working since November to get a patch into i2c without success - 19 versions. The process is chewing up way too much time relative to the importance of the patch to my code. So I'm just about ready to "port and forget" the patch. > > -- >8 -- > SRC=drivers/serial > > echo >&2 Cleaning up after old runs... > rm -f tmpindex > git branch -D tmpbranch > > echo >&2 Creating giant source commit... > for i in `git rev-list v2.6.13..v2.6.15 -- $SRC`; do > git ls-tree -r $i -- $SRC | > # note the whitespace is a literal tab > sed "s, , $i/," | > GIT_INDEX_FILE=tmpindex git update-index --index-info > done > tree=`GIT_INDEX_FILE=tmpindex git write-tree` > commit=`echo source | git commit-tree $tree` > git update-ref refs/heads/tmpbranch $commit > > echo >&2 Creating updated index... > GIT_INDEX_FILE=tmpindex git add candidate.c > echo >&2 Diffing... > GIT_INDEX_FILE=tmpindex git diff-index --cached -l0 -M1% -C1% --find-copies-harder tmpbranch > > # now you should manually git-describe the winner > -- Jon Smirl jonsmirl@xxxxxxxxx - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html