From: Linus Torvalds Date: Sun, 13 Jan 2008 04:41:31 GMT Subject: Re: Digging through old vendor code Message-ID: In-Reply-To: <9e4733910801122009k5658488bx69c04a5cbf7d832a@mail.gmail.com> On Sat, 12 Jan 2008, Jon Smirl wrote: > > I have a file that a vendor has modified. It's a serial driver so I > know which directory the original file came from. Is there a way to > ask git to search through all of the past versions of all of the files > in this directory and give me the top two or three choices as to what > file the vendor originally copied before staring to edit? This is the > same problem as picking the best diff base. Heh. Maybe you could just use the rename logic? Example of what *might* work: - go to the directory in the git tree you think the file came from - delete all the files that are *potential* sources (eg "rm *.c") - add the new file to that directory - commit the end result - ask git to find the best rename possibility, using a low rename detection score, something like: git show -M1% (and no, I don't guarantee that that "-M1%" is the right syntax, and in general you might well want to play with this concept a bit..) No guarantees, but it just might work.. Linus