Re: [PATCH] optionally disable normalization of working copy files in diff invocations
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Thu, 17 Jul 2014 14:47:10 +0100
> Matthias Gerstner wrote:
Hi Matthias, thanks for the patch. I understand why this is useful, and basically I agree.
The main point I want to make is that the user interface you chose is an example of the "X Y problem" <http://mywiki.wooledge.org/XyProblem>. What does the user really want? To have their actual working file loaded in the external diff program. What does the user tell Subversion?
svn diff --don't-normalize-the-content
A better interface, the user would tell Subversion what they really want:
svn diff --load-my-actual-file-not-a-copy-of-it
See the difference?
(It's possible Subversion may, today or tomorrow, pass a temporary file for reasons other than normalizing the content. It's also possible that Subversion may, tomorrow, be able to normalize the keyword expansions in the working file, run the diff, and then put them back again; that's not necessarily a good idea for various reasons, but in principle things like that are possible. So disabling normalization does not logically imply getting the original file, and vice-versa.)
I'd like the interface (option name, help text, C symbols, API docs) to say what it means.
Stefan Sperling wrote:
I agree that yet another command-line option is somewhat unwelcome, but, as you know, we're generally careful not to change the user interface unnecessarily, because we don't want to break people's existing scripts and work flows. This does seem to me like a case where that would potentially cause unnecessary disruption to people who are already using an external diff tool and have adapted to the way it currently behaves. For example, I once wrote an external diff tool plug-in script which took Subversion's diff parameters and then found and opened the actual WC working file instead, for this very reason.
It would be better if we could make it easy to get the new behaviour without forcing users of the old behaviour to change their diff set-ups.
Since you point out that this is only relevant when using a third party diff tool, it would be a good idea to make it a configuration file option. It would be silly to be able to configure an external diff tool in the config file (as we already can) but then have to add the '--whatever' option manually on every 'svn diff' command.
Then the question is, is it useful to have a dedicated command-line option as well? I think perhaps not. (There's always the ability to specify a config option on the command line using "--config-option=...".)
> In terms of coding style, I'd use a boolean that switches normal
The rest of Stefan's comments, above, I agree with (and I haven't looked further into those or into the patch itself).
- Julian
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.