You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by anatoly techtonik <te...@gmail.com> on 2010/08/24 06:31:08 UTC

Disable diff-cmd

Hello,

Is there any way to disable "diff-cmd" setting for just one run of "svn diff"?
I need it for code review upload script, which fails when users have
configured graphical diff. Is there any way to force svn use internal
diff implemantation? I've tried:
svn diff --config-option config:helpers:diff-cmd=""
svn diff --diff-cmd ""
svn diff --diff-cmd NUL

with no effect.

Please, CC.
--
anatoly t.

Re: Disable diff-cmd

Posted by anatoly techtonik <te...@gmail.com>.
On Tue, Aug 24, 2010 at 3:48 PM, Philip Martin
<ph...@wandisco.com> wrote:
>
>> Not really. In Rietveld project we call "svn diff" by upload.py script
>> used to send diffs for review to remote server. We can't instruct
>> users to copy config dir, so we need to do this automatically. That
>> means copying the whole config dir and comment only one option just
>> for the sake of running "svn diff"
>
> I suppose you could use the Python bindings and bypass the command
> line client.  Then the script would have full control.

upload.py helper script is aimed to be used by the end users
(developers) from a fresh checkout of a project. The project itself
may not use Python at all. Having a requirement to install Subversion
bindings besides Python would be an overkill.

Re: Disable diff-cmd

Posted by anatoly techtonik <te...@gmail.com>.
On Tue, Aug 24, 2010 at 3:48 PM, Philip Martin
<ph...@wandisco.com> wrote:
>
>> Not really. In Rietveld project we call "svn diff" by upload.py script
>> used to send diffs for review to remote server. We can't instruct
>> users to copy config dir, so we need to do this automatically. That
>> means copying the whole config dir and comment only one option just
>> for the sake of running "svn diff"
>
> I suppose you could use the Python bindings and bypass the command
> line client.  Then the script would have full control.

upload.py helper script is aimed to be used by the end users
(developers) from a fresh checkout of a project. The project itself
may not use Python at all. Having a requirement to install Subversion
bindings besides Python would be an overkill.

>From my experience installing Subversion Python bindings is not a
trivial task. You need to be careful about exact Python/Subversion
versions and be aware about installation procedure for your platform.
Matters are complicated by the fact that there seems to be several
different bindings in the wild.

If I remember correctly only `ctypes` bindings can work with multiple
version of Python, but I can't recall that Subversion installer
proposed to install them, and do not remember seeing any standalone
distributions.

Philip Martin <ph...@wandisco.com> wrote:
>
> Another thing you could do is explicitly invoke an external diff to
> override any user default.

That could be a solution if only `diff` was available on Windows by
default, but it's not.

Please, CC.
-- 
anatoly t.

Re: Disable diff-cmd

Posted by Philip Martin <ph...@wandisco.com>.
Philip Martin <ph...@wandisco.com> writes:

> anatoly techtonik <te...@gmail.com> writes:
>
>> Not really. In Rietveld project we call "svn diff" by upload.py script
>> used to send diffs for review to remote server. We can't instruct
>> users to copy config dir, so we need to do this automatically. That
>> means copying the whole config dir and comment only one option just
>> for the sake of running "svn diff"
>
> I suppose you could use the Python bindings and bypass the command
> line client.  Then the script would have full control.

Another thing you could do is explicitly invoke an external diff to
override any user default.

-- 
Philip

Re: Disable diff-cmd

Posted by Philip Martin <ph...@wandisco.com>.
anatoly techtonik <te...@gmail.com> writes:

> Not really. In Rietveld project we call "svn diff" by upload.py script
> used to send diffs for review to remote server. We can't instruct
> users to copy config dir, so we need to do this automatically. That
> means copying the whole config dir and comment only one option just
> for the sake of running "svn diff"

I suppose you could use the Python bindings and bypass the command
line client.  Then the script would have full control.

-- 
Philip

Re: Disable diff-cmd

Posted by Stefan Sperling <st...@elego.de>.
On Tue, Aug 24, 2010 at 01:48:43PM +0100, Julian Foad wrote:
> anatoly techtonik wrote:
> > On Tue, Aug 24, 2010 at 2:29 PM, Stefan Sperling <st...@elego.de> wrote:
> > >> >
> > >> > --internal-diff seems to be new in 1.7 so i guess the only option is using
> > >> > --config-dir to override it.
> > >>
> > >> Why not to stop proliferation of options by allowing an empty value
> > >> for --diff-cmd to be treated as an instructions to use internal
> > >> implementation?
> > >
> > > Boils down to personal preference.
> > > See http://svn.haxx.se/dev/archive-2010-05/0456.shtml
> > 
> > I believe Git has --no-ext-diff option for that purpose, but I still
> 
> Let's rename "--internal-diff" to "--no-ext-diff", just for ease of
> memory for those who use both Svn and Git.
> 
> > think that universal ability to reset option to default with
> > `--diff-cmd=""` or `--config-option config:helpers:diff-cmd=""` is a
> > better approach, because it will also allow to use default values for
> > other cmd options like editor-cmd, diff3-cmd, merge-tool-cmd and ssh.
> 
> You know what?  I like that reasoning.
> 
> We could still have a "--internal-diff" (or "--no-ext-diff") for
> user-friendliness reasons, but define it as an alias for
> "--diff-cmd=''".  That would have the advantage of making clear how
> those two options would interact if both are specified.

All fine with me.

Stefan

Re: Disable diff-cmd

Posted by Julian Foad <ju...@wandisco.com>.
anatoly techtonik wrote:
> On Tue, Aug 24, 2010 at 2:29 PM, Stefan Sperling <st...@elego.de> wrote:
> >> >
> >> > --internal-diff seems to be new in 1.7 so i guess the only option is using
> >> > --config-dir to override it.
> >>
> >> Why not to stop proliferation of options by allowing an empty value
> >> for --diff-cmd to be treated as an instructions to use internal
> >> implementation?
> >
> > Boils down to personal preference.
> > See http://svn.haxx.se/dev/archive-2010-05/0456.shtml
> 
> I believe Git has --no-ext-diff option for that purpose, but I still

Let's rename "--internal-diff" to "--no-ext-diff", just for ease of
memory for those who use both Svn and Git.

> think that universal ability to reset option to default with
> `--diff-cmd=""` or `--config-option config:helpers:diff-cmd=""` is a
> better approach, because it will also allow to use default values for
> other cmd options like editor-cmd, diff3-cmd, merge-tool-cmd and ssh.

You know what?  I like that reasoning.

We could still have a "--internal-diff" (or "--no-ext-diff") for
user-friendliness reasons, but define it as an alias for
"--diff-cmd=''".  That would have the advantage of making clear how
those two options would interact if both are specified.

- Julian


Re: Disable diff-cmd

Posted by anatoly techtonik <te...@gmail.com>.
On Tue, Aug 24, 2010 at 2:29 PM, Stefan Sperling <st...@elego.de> wrote:
>> >
>> > --internal-diff seems to be new in 1.7 so i guess the only option is using
>> > --config-dir to override it.
>>
>> Why not to stop proliferation of options by allowing an empty value
>> for --diff-cmd to be treated as an instructions to use internal
>> implementation?
>
> Boils down to personal preference.
> See http://svn.haxx.se/dev/archive-2010-05/0456.shtml

I believe Git has --no-ext-diff option for that purpose, but I still
think that universal ability to reset option to default with
`--diff-cmd=""` or `--config-option config:helpers:diff-cmd=""` is a
better approach, because it will also allow to use default values for
other cmd options like editor-cmd, diff3-cmd, merge-tool-cmd and ssh.

>> This looks like a bug that can be fixed in 1.6 series as well.
>
> If there is strong demand for backporting the --internal-diff option
> I guess we could do it. But is using --config-dir an acceptable
> workaround for now?

Not really. In Rietveld project we call "svn diff" by upload.py script
used to send diffs for review to remote server. We can't instruct
users to copy config dir, so we need to do this automatically. That
means copying the whole config dir and comment only one option just
for the sake of running "svn diff"

Copying is required, because there are some options that may affect
"svn diff" output. Some options may even be specified in windows
registry. Extracting them from there is an overkill. That's why a
simple solution with one option override at a time is better.

Having --internal-diff option backported will allow us to detect if an
external diff tool is used and advise users to upgrade to a newer 1.6
Subversion instead of implementing config dir copy and override logic.
Not many will be ready to switch to 1.7 and I doubt that it will
appear in Debian backports any time soon.

http://code.google.com/p/rietveld/issues/detail?id=217

Please, CC.
-- 
anatoly t.

Re: Disable diff-cmd

Posted by Stefan Sperling <st...@elego.de>.
On Tue, Aug 24, 2010 at 02:24:25PM +0300, anatoly techtonik wrote:
> On Tue, Aug 24, 2010 at 11:35 AM, Martin Furter <mf...@rola.ch> wrote:
> >
> > --internal-diff seems to be new in 1.7 so i guess the only option is using
> > --config-dir to override it.
> 
> Why not to stop proliferation of options by allowing an empty value
> for --diff-cmd to be treated as an instructions to use internal
> implementation?

Boils down to personal preference.
See http://svn.haxx.se/dev/archive-2010-05/0456.shtml

> This looks like a bug that can be fixed in 1.6 series as well.

If there is strong demand for backporting the --internal-diff option
I guess we could do it. But is using --config-dir an acceptable
workaround for now?

Stefan

Re: Disable diff-cmd

Posted by anatoly techtonik <te...@gmail.com>.
On Tue, Aug 24, 2010 at 11:35 AM, Martin Furter <mf...@rola.ch> wrote:
>
> --internal-diff seems to be new in 1.7 so i guess the only option is using
> --config-dir to override it.

Why not to stop proliferation of options by allowing an empty value
for --diff-cmd to be treated as an instructions to use internal
implementation? This looks like a bug that can be fixed in 1.6 series
as well.

Please, CC.
--
anatoly t.

Re: Disable diff-cmd

Posted by Martin Furter <mf...@rola.ch>.

On Tue, 24 Aug 2010, anatoly techtonik wrote:

> Hello,
>
> Is there any way to disable "diff-cmd" setting for just one run of "svn diff"?
> I need it for code review upload script, which fails when users have
> configured graphical diff. Is there any way to force svn use internal
> diff implemantation? I've tried:
> svn diff --config-option config:helpers:diff-cmd=""
> svn diff --diff-cmd ""
> svn diff --diff-cmd NUL
>
> with no effect.

--internal-diff seems to be new in 1.7 so i guess the only option is using 
--config-dir to override it.

HTH
Martin