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

Re: [PATCH 6/9] difftool: replace system call with Git::command_noisy

From
Tim Henigan <tim.henigan@gmail.com>
Date
Mar 18, 2012, 01:21 UTC
Message-ID
<CAFouetgJsHD9UoVPE6V16vAsJ4Q1neHzH7jrwGma6e2ZHELgFA@mail.gmail.com>
In-Reply-To
<CAJDDKr4+0iWoZhxo6kMVa0YUtDzmrH=XTZnDqQdbnM6TJ41UDg@mail.gmail.com>
On Fri, Mar 16, 2012 at 10:48 PM, David Aguilar <davvid@gmail.com> wrote:
Show 8 quoted lines
> On Fri, Mar 16, 2012 at 6:59 PM, Tim Henigan <tim.henigan@gmail.com> wrote:
>
> In general, I am a little nervous about having difftool copy worktree
> content somewhere temporary only to copy it back in later.  Is there
> some way to make the diff machinery reuse the worktree?  I was under
> the impression that we could do some GIT_INDEX tricks to do it, though
> I will admit that I did not read that suggestion in depth, nor did I
> grasp whether this was the problem it was meant to address.

I have not been able to find any other way to do it. The GIT_INDEX trick allows the tmp directories to be built using 'git update-index' and 'git checkout-index', but they offer no help for this problem.

If we use the working tree directory as one of the diff targets, then all the files in the working directory would be included in the diff...unless there was some way to remove the files that aren't part of the diff from the working tree. However at that point, I don't think the solution would be any better (i.e. deleting files from the working tree and then checking them back out is no better than copying files to the tmp dir and back again).

The only other option I can think of is to build a complete copy of
the repo in the tmp directory for comparison against the working tree.
 However, this could obviously lead to resource/performance problems
on large repos.
I am open to suggestions, but I have not found any better solution.
Previous: Alex Riesen
Message 6 of 6 in “difftool: replace system call with Git::command_noisy”
  1. 6/9 difftool: replace system call with Git::command_noisyTim Henigan, Mar 17, 2012
  2. David AguilarMar 17, 2012
  3. Alex RiesenMar 17, 2012
  4. Tim HeniganMar 17, 2012
  5. Alex RiesenMar 17, 2012
  6. Tim HeniganMar 18, 2012

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.