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

Re: [PATCH] Resurrect diff-tree-helper -R

From
DJDaniel Jacobowitz <dan@debian.org>
Date
May 1, 2005, 01:47 UTC
Message-ID
<20050501014726.GA15220@nevyn.them.org>
In-Reply-To
<Pine.LNX.4.58.0504301805300.2296@ppc970.osdl.org>
On Sat, Apr 30, 2005 at 06:09:53PM -0700, Linus Torvalds wrote:
Show 13 quoted lines
> So it would be much nicer (I think) if mode changes are handled 
> separately, with a simple separate line before the diff saying
> 
> 	"Mode change: %o->%o %s", oldmode, newmode, path
> 
> and not mess up the diff header. That way, you only see it when it
> actually makes any difference, and it's more readable both for humans
> _and_ machines as a result.
> 
> Normal "patch" will just ignore the extra lines before the diff anyway, so 
> it won't matter there.
> 
> Comments?

It sounds good - but could you efficiently collect them before any diff output? If you have something like this, it'll be easy to read:

Mode change: 644->755 foo.sh Mode change: 644->755 bar.sh

--- ChangeLog +++ ChangeLog

@@ -1,0 +1,1 @@
+New line
--- copyright
+++ copyright
@@ -1,0 +1,1 @@
+New line


But if you generate this then you might as well not generate the mode
lines at all, for all a human looking at the diff is going to notice
them:

--- ChangeLog
+++ ChangeLog
@@ -1,0 +1,1 @@
+New line
Mode change: 644->755 foo.sh
--- copyright
+++ copyright
@@ -1,0 +1,1 @@
+New line
Mode change: 644->755 bar.sh


The latter is how diff does its "Only in" messages.  I never see them
when I'm looking through a diff of any size; only via diffstat, where
they're clearly disambiguated.
-- 
Daniel Jacobowitz
CodeSourcery, LLC
Previous: Linus TorvaldsNext: Linus Torvalds
Message 3 of 25 in “Resurrect diff-tree-helper -R”
  1. Resurrect diff-tree-helper -RJunio C Hamano, May 1, 2005
  2. Linus TorvaldsMay 1, 2005
  3. Daniel JacobowitzMay 1, 2005
  4. Linus TorvaldsMay 1, 2005
  5. Junio C HamanoMay 1, 2005
  6. Linus TorvaldsMay 1, 2005
  7. Junio C HamanoMay 1, 2005
  8. Add git-apply-patch-script.Junio C Hamano, May 1, 2005
  9. Rework built-in diff to make its output more dense.Junio C Hamano, May 1, 2005
  10. Petr BaudisMay 13, 2005
  11. Junio C HamanoMay 13, 2005
  12. Junio C HamanoMay 13, 2005
  13. Petr BaudisMay 13, 2005
  14. Junio C HamanoMay 13, 2005
  15. Junio C HamanoMay 14, 2005
  16. Petr BaudisMay 14, 2005
  17. Junio C HamanoMay 14, 2005
  18. Petr BaudisMay 14, 2005
  19. Junio C HamanoMay 15, 2005
  20. Petr BaudisMay 15, 2005
  21. Junio C HamanoMay 15, 2005
  22. Tweak diff output further to make it a bit less distracting.Junio C Hamano, May 15, 2005
  23. Petr BaudisMay 14, 2005
  24. Junio C HamanoMay 14, 2005
  25. Junio C HamanoMay 13, 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.