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

Re: 'git diff' against files outside a git repo

From
BCBrandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
Date
Sep 24, 2010, 22:30 UTC
Message-ID
<-30AUOVW2mMJiL1EZcTFG9LhiQWZDLcLpaLzWQHRY8tnzFEGXuZLuw@cipher.nrlssc.navy.mil>
In-Reply-To
<AANLkTinR7BJpD-FOS_DShg=r0ucF2C9oE6p-YoZU-5En@mail.gmail.com>
On 09/24/2010 05:23 PM, Avery Pennarun wrote:
Show 23 quoted lines
> Hi all,
> 
> I'm interested in using 'git diff' on some files that aren't actually
> inside a git repo at all.  Specifically, the --color-words and
> --word-diff-regex are really cool and I happen to have a use for them
> on files that aren't stored verbatim in git.  As a whole, git's
> implementation of diff seems to be the fastest-moving one out there,
> so I'd rather use it instead of another random diff implementation.
> 
> (For the curious: the particular "files" I want to compare are
> actually split into a hierarchical tree of blobs using bup's rolling
> checksum and *then* stored in git.  Obviously I have to reassemble
> them before I can diff them, which is fine and easy, but I then want
> to run 'git diff' against them, which seems to not be so easy.)
> 
> (For the extremely curious: the particular files I want to diff are
> mega-gigantic csv files from database dumps.  Because of bup's tree
> format, I should be able to zoom in on just the overall part of the
> file that has changed, then diff only that, which will be much faster
> than running a diff algorithm against the whole file.  Essentially
> O(log n) vs. the file size.)
> 
> Is there already a way to get 'git diff' to do this?
Doesn't
   git diff file.one file.two
work?
Or are you asking for something else?
-Brandon
Previous: Michael J Gruber
Message 7 of 7 in “'git diff' against files outside a git repo”
  1. Avery PennarunSep 24, 2010
  2. Elijah NewrenSep 24, 2010
  3. Avery PennarunSep 25, 2010
  4. Junio C HamanoSep 26, 2010
  5. Avery PennarunSep 26, 2010
  6. Michael J GruberSep 27, 2010
  7. Brandon CaseySep 24, 2010

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.