git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Digging through old vendor code

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jan 13, 2008, 04:41 UTC
Message-ID
<alpine.LFD.1.00.0801122034090.2806@woody.linux-foundation.org>
In-Reply-To
<9e4733910801122009k5658488bx69c04a5cbf7d832a@mail.gmail.com>
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
Previous: Jon Smirl
Message 2 of 2 in “Digging through old vendor code”
  1. Jon SmirlJan 13, 2008
  2. Linus TorvaldsJan 13, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.