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

Re: [PATCH 0/1] Diff-helper update

From
Junio C Hamano <junkio@cox.net>
Date
May 18, 2005, 17:58 UTC
Message-ID
<7v64xgpgb0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0505180821470.18337@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:

LT> However, git-diff-helper doesn't understand these things, and the builtin LT> diff doesn't do the rename thing. Yet it would be very very useful to do.

It is unclear what you meant by "these things" in "doesn't understand these things", and what you meant by "it" in "it would be very very useful to do." Could you explain?

About the built-in diff not doing the rename , I have a bit longer term (knowing _my_ timescale I'd imagine you would understand that is not that long ;-) plan to have -p option for diff-* family to use the same rename detection logic that I added to diff-helper in the patch you are commenting on. It involves slight change to callers (three diff-* family main programs) to add a call to tell the diff driver "I've given you all the diffs, now go look for renames") at the end, and the rest is changes to what diff.c does internally.

LT> So what I'd suggest is one (or both) of two possibilities: LT> - make the internal diff logic also able to do the same rename handling LT> as the external diff-helper. This may or may not be complex, I've not LT> looked at it.

Yes that is part of the plan. I wanted to do things in these steps:

  - Put rename detect in helper so screwups there would not
    impact the diff-* family's built-in output, with the initial
    dumb rename detection.
  - Improve rename detection still keeping the logic and
    machinery in diff-helper only.  I expect a heuristics
    similar to the one you posted on the deltification thread
    would work nicely here as well.
  - Straighten out the GIT_EXTERNAL_DIFF interface so that it
    can also express renames (the patch I sent currently punts
    there).  They will get eighth argument (rename destination)
    only when they are being fed a rename patch.
    git-apply-patch-script needs to be adjusted for this change.
  - Change diff-helper not to do the rename detection itself,
    but clean it up so it uses the same diff_addremove(),
    diff_change(), and diff_unmerge() interface the diff-*
    family use.  Change the implementation of these three
    functions so that they do not directly call
    run_external_diff() but pool changes for later matching when
    rename detection is in effect.  Add diff_finished() which
    would flush the rename candidate pools, and call that at the
    end of program from three diff-* family and diff-helper.
    The rename detection logic in diff-helper will be moved to
    this "inspect the pooled rename candidates, match them up
    and flush" part.
The patch I sent is the first step in the above sequence.

LT> - change diff-helper subtly: instead of printing "cannot parse %s", any LT> nonrecognized line would be a "ignore this line, but process all LT> pending potential renames".

Once the built-in diff driver is straightened out the way I outlined above, this change may turn out to be unnecessary, I need to look at the whatchanged output and think a bit more about this later today.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 3 of 13 in “Diff-helper update”
  1. 0/1 Diff-helper updateJunio C Hamano, May 18, 2005
  2. Linus TorvaldsMay 18, 2005
  3. Junio C HamanoMay 18, 2005
  4. Linus TorvaldsMay 18, 2005
  5. Linus TorvaldsMay 18, 2005
  6. Thomas GlanzmannMay 18, 2005
  7. Junio C HamanoMay 18, 2005
  8. Linus TorvaldsMay 18, 2005
  9. Junio C HamanoMay 18, 2005
  10. Junio C HamanoMay 19, 2005
  11. [preview] diff-helper rename detection.Junio C Hamano, May 19, 2005
  12. Linus TorvaldsMay 19, 2005
  13. Junio C HamanoMay 19, 2005

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.