From: Daniel Jacobowitz Date: Sun, 01 May 2005 01:47:26 GMT Subject: Re: [PATCH] Resurrect diff-tree-helper -R Message-ID: <20050501014726.GA15220@nevyn.them.org> In-Reply-To: On Sat, Apr 30, 2005 at 06:09:53PM -0700, Linus Torvalds wrote: > 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