threads / discuss / 11602

Digging through old vendor code

Subject: Digging through old vendor code

## tl;dr

2 messages between Jan 13, 2008 and Jan 13, 2008.

replies: 1people: 2as markdown or json

Jon Smirl· Jan 13, 2008, 04:09 UTC · lore

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.

-- 
Jon Smirl
jonsmirl@gmail.com
Linus Torvalds· Jan 13, 2008, 04:41 UTC · re: Jon Smirl · lore

Re: Digging through old vendor code

On Sat, 12 Jan 2008, Jon Smirl wrote:
Show 7 quoted lines
>
> 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

← back to recent threads