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

Re: [PATCH] diff --no-index: support more than one file pair

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jan 12, 2012, 18:26 UTC
Message-ID
<vpq8vlc93qk.fsf@bauges.imag.fr>
In-Reply-To
<CACsJy8B460CwtACV+o0wnwqi1On_oEavLfDAL8f=w6kyfktKcQ@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 11 quoted lines
>>>  - hell, i might even benefit from git copy/modify detection
>>
>> I don't see how, if you specify explicitely the pairs (old, new). You
>> may have such benefit if you let the command-line express "here's a
>> bunch of old files, and a bunch of new ones", but not with your proposed
>> syntax.
>
> That's what git gives to diff machinery: a set of file pairs, and the
> diff machinery has to figure out copy/modify pairs, shuffling them up
> if necessary. I simply cut of tree traversal part out and feed file
> pairs directly to diff machinery.

If you want to benefit from copy detection, you cannot hardcode the fact that you have as many source and destination files. And even to benefit from rename detection, I find the user interface really weird. If I provide files in pairs, I really don't expect Git to shuffle them like

git diff --no-index A1 B1 A2 B2 --- A1 +++ B2 .. --- A2 +++ B1 ..

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Nguyen Thai Ngoc DuyNext: Neal Kreitzinger
Message 6 of 7 in “diff --no-index: support more than one file pair”
  1. diff --no-index: support more than one file pairNguyễn Thái Ngọc Duy, Jan 12, 2012
  2. Matthieu MoyJan 12, 2012
  3. Nguyen Thai Ngoc DuyJan 12, 2012
  4. Matthieu MoyJan 12, 2012
  5. Nguyen Thai Ngoc DuyJan 12, 2012
  6. Matthieu MoyJan 12, 2012
  7. Neal KreitzingerJan 12, 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.