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

Re: [PATCH 2/3] Introduce rename factorization in diffcore.

From
Yann Dirson <ydirson@altern.org>
Date
Nov 7, 2008, 20:39 UTC
Message-ID
<20081107203952.GJ5158@nan92-1-81-57-214-146.fbx.proxad.net>
In-Reply-To
<7v3ai3gugt.fsf@gitster.siamese.dyndns.org>
On Fri, Nov 07, 2008 at 12:19:14PM -0800, Junio C Hamano wrote:
> I am afraid that this is totally unacceptable, as you yourself mentioned,
> the end result is unapplicable with any existing tool and would confuse
> viewers like gitk and gitweb.

Well, other tools will still have to be taught about a new syntax, if they're going to use the new flag - just like it was for --rename.

That makes me think that it could be interesting to have a header telling which diff extensions it is using. It could even be interesting to come with a cross-vc convention, which would ease the interchange of modern patch files (I suppose some other tools already have their own extensions for file renames).

What about some hint like the following ?
|extended diff features: git:rename git:binary git:filetypes
|extended diff features: git:unixperms git:dir-rename

Maybe we could leave "filetype" and "unixperms" out, since these do not replace an information that would otherwise be present in a standard diff anyway, and would just be ignored by a tool not supporting them.

Show 15 quoted lines
> I think it would be a much better approach to emit a hint that talks about
> directory rename in a format that does not fool usual "patch" application
> tools.  E.g.
> 
> |directory moved with similarity index 82%
> |rename from ppc
> |rename from foo
> |diff --git a/ppc/sha1.h b/foo/sha1.h
> |similarity index 85%
> |rename from ppc/sha1.h
> |rename to foo/sha1.h
> |index  9b34f76..8fce4b7 100644
> |--- ppc/sha1.h
> |+++ foo/sha1.h
> |@@ ...

So you're favoring the "patch is not textually splittable approach". Don't you think it would be good to add some sort of hint about this as a patch header ?

> IOW, do not add anything that begins with "diff --git" if it is not a
> patch.
OK.
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 15 in “Detection of directory renames”
  1. 0/3 Detection of directory renamesYann Dirson, Nov 1, 2008
  2. 1/3 Fix error in diff_filepair::status documentation.Yann Dirson, Nov 1, 2008
  3. Junio C HamanoNov 2, 2008
  4. 2/3 Introduce rename factorization in diffcore.Yann Dirson, Nov 1, 2008
  5. Junio C HamanoNov 7, 2008
  6. Yann DirsonNov 7, 2008
  7. Junio C HamanoNov 7, 2008
  8. Yann DirsonNov 7, 2008
  9. Junio C HamanoNov 7, 2008
  10. Yann DirsonNov 7, 2008
  11. Junio C HamanoNov 7, 2008
  12. Yann DirsonNov 8, 2008
  13. Junio C HamanoNov 8, 2008
  14. Yann DirsonNov 8, 2008
  15. 3/3 Add testcases for the --factorize-renames diffcore flag.Yann Dirson, Nov 1, 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.