From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Jeff King" <peff@peff.net>
Cc: linux@horizon.com, git@vger.kernel.org, torvalds@linux-foundation.org
Subject: Re: Digging through old vendor code
Date: Mon, 14 Jan 2008 09:49:30 -0500 [thread overview]
Message-ID: <9e4733910801140649u5c2b74cbkcf0d790d0e7bc0a2@mail.gmail.com> (raw)
In-Reply-To: <20080114120807.GB12723@coredump.intra.peff.net>
On 1/14/08, Jeff King <peff@peff.net> wrote:
> On Sun, Jan 13, 2008 at 11:28:06AM -0500, linux@horizon.com 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@gmail.com
next prev parent reply other threads:[~2008-01-14 14:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-13 16:28 Digging through old vendor code linux
2008-01-13 17:04 ` Jon Smirl
2008-01-13 17:31 ` Jon Smirl
2008-01-14 12:08 ` Jeff King
2008-01-14 14:49 ` Jon Smirl [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-01-13 4:09 Jon Smirl
2008-01-13 4:41 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9e4733910801140649u5c2b74cbkcf0d790d0e7bc0a2@mail.gmail.com \
--to=jonsmirl@gmail.com \
--cc=git@vger.kernel.org \
--cc=linux@horizon.com \
--cc=peff@peff.net \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).