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

Re: [PATCH 2/2] Add keyword unexpansion support to convert.c

From
Robin H. Johnson <robbat2@gentoo.org>
Date
Apr 18, 2007, 02:53 UTC
Message-ID
<20070418025338.GG31488@curie-int.orbis-terrarum.net>
In-Reply-To
<7vy7kqjw4x.fsf@assigned-by-dhcp.cox.net>
On Tue, Apr 17, 2007 at 06:42:38PM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> Junio C Hamano <junkio@cox.net> writes:
> > I do not have much against an optional "only blob id" expansion
> > myself, as I do not see any more downside than CRLF expansion in
> > it...
> Actually, there is one.  Somebody makes a patch against a file
> with $id$ expanded.  Gives it to somebody else who is git
> challenged and does not have git-apply.  The patch is useless.
So they have diff'd outside of Git, and the recipient is applying outside of
Git:
A - If they are applying the patch on top of the same base revision, it will
    apply fine, because the keywords are identical. 
B - If they are applying the patch on top of a different revision, the keywords
    won't apply, and most probably other content in the patch won't apply either.

Additional with B the longer your individual files, the more likely that the diff hunk containing the keyword change does not contain any other changes, and can be easily discarded. More that the changes are likely to be further away from the keyword ;-).

Discarding portions of patches is already wide-spread (not just for CVS keywords, the architecture keywords in Gentoo ebuilds change rapidly as well), and if git-apply can discard the keyword, it only serves to accelerate the usage of git.

Some quick stats I hacked together on lengths of Gentoo ebuilds. 23161 ebuilds total. 51% of the Gentoo ebuilds are less than 36 lines long. 76% are less than 56 lines long. 90% are less than 92 lines long. (thereafter the tail gets VERY long). 0.21% are more than 500 lines long.

> So it is not without more downsides than CRLF.

A cleaner version of my earlier command to find the changes between revisions. diff -Nuar <(git-cat-file blob $SHA1:$FILE) $TMPFILE where $TMPFILE is a temporary filename for the file from the user. This saves having to overwrite the local $FILE and restore it afterwards. It would be nice if git-diff could handle this case directly.

On a tangent, has any work gone into specialized patch mergers for specific file formats?

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Council Member
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
Previous: Junio C HamanoNext: Daniel Barkalow
Message 60 of 66 in “Add keyword unexpansion support to convert.c”
  1. 2/2 Add keyword unexpansion support to convert.cAndy Parkins, Apr 17, 2007
  2. Junio C HamanoApr 17, 2007
  3. Andy ParkinsApr 17, 2007
  4. Linus TorvaldsApr 17, 2007
  5. Andy ParkinsApr 17, 2007
  6. Linus TorvaldsApr 17, 2007
  7. Andy ParkinsApr 17, 2007
  8. Nicolas PitreApr 17, 2007
  9. David LangApr 17, 2007
  10. Nicolas PitreApr 17, 2007
  11. David LangApr 17, 2007
  12. Nicolas PitreApr 17, 2007
  13. David LangApr 17, 2007
  14. Andy ParkinsApr 17, 2007
  15. Junio C HamanoApr 17, 2007
  16. Nicolas PitreApr 18, 2007
  17. Junio C HamanoApr 18, 2007
  18. Nicolas PitreApr 18, 2007
  19. Johannes SchindelinApr 18, 2007
  20. Nicolas PitreApr 18, 2007
  21. Johannes SchindelinApr 19, 2007
  22. David LangApr 21, 2007
  23. Junio C HamanoApr 21, 2007
  24. Nicolas PitreApr 21, 2007
  25. David LangApr 21, 2007
  26. Rogan DawesApr 18, 2007
  27. Linus TorvaldsApr 18, 2007
  28. Nicolas PitreApr 18, 2007
  29. Rogan DawesApr 18, 2007
  30. Nicolas PitreApr 18, 2007
  31. Rogan DawesApr 18, 2007
  32. Alon ZivApr 18, 2007
  33. Linus TorvaldsApr 17, 2007
  34. Andy ParkinsApr 17, 2007
  35. Add keyword collapse support to convert.cAndy Parkins, Apr 17, 2007
  36. Linus TorvaldsApr 17, 2007
  37. Linus TorvaldsApr 17, 2007
  38. Johannes SchindelinApr 18, 2007
  39. Nikolai WeibullApr 20, 2007
  40. Martin LanghoffApr 17, 2007
  41. Junio C HamanoApr 17, 2007
  42. Jakub NarebskiApr 20, 2007
  43. David LangApr 21, 2007
  44. Linus TorvaldsApr 17, 2007
  45. Johannes SixtApr 17, 2007
  46. Linus TorvaldsApr 17, 2007
  47. Andy ParkinsApr 17, 2007
  48. Rogan DawesApr 17, 2007
  49. Linus TorvaldsApr 17, 2007
  50. Rogan DawesApr 17, 2007
  51. Robin H. JohnsonApr 17, 2007
  52. Junio C HamanoApr 18, 2007
  53. J. Bruce FieldsApr 18, 2007
  54. Linus TorvaldsApr 18, 2007
  55. Junio C HamanoApr 18, 2007
  56. Linus TorvaldsApr 18, 2007
  57. Robin H. JohnsonApr 18, 2007
  58. Junio C HamanoApr 18, 2007
  59. Junio C HamanoApr 18, 2007
  60. Robin H. JohnsonApr 18, 2007
  61. Daniel BarkalowApr 18, 2007
  62. Johannes SchindelinApr 18, 2007
  63. Martin LanghoffApr 18, 2007
  64. David KågedalApr 18, 2007
  65. Robin H. JohnsonApr 18, 2007
  66. Matthieu MoyApr 17, 2007

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.