You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Aaron Hillegass <in...@bignerdranch.com> on 2005/07/27 19:26:28 UTC
Custom merge/diff tool feature request
We are using subversion for all our source code for our applications
and our books. It is a great tool, and we are greatly indebted to
all of you. I do, however, have a suggestion for an improvement:
For most types of source code, the default line-based merge/diff
works beautifully. There are, however, other types of file that
might be mergeable: database files, nib files, compressed files. For
these, I would want to write a custom merge/diff tool. My tool would
have to take the same arguments as GNU diff.
Then, from the command-line, I can specify:
svn diff --diff-cmd sqlite_diff foo.sql
svn merge --diff3-cmd sqlite_diff foo.sql
But, what I really want is a way to configure subversion to use my
custom diff/merge for a given file type. I want a way to say: "For
any file with a .sql extension, use sql_diff instead of the standard
line-based merge/diff".
Regards,
Aaron Hillegass
Big Nerd Ranch, Inc.
http://www.bignerdranch.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Custom merge/diff tool feature request
Posted by "C. Michael Pilato" <cm...@collab.net>.
Julian Foad <ju...@btopenworld.com> writes:
> > Subversion needs only to do the following:
> > - *always* call the external diff/diff3 program when those have
> > been customized (via --diff[3]-cmd or the runtime configuration
> > area), instead of automatically ruling out diffs on "binary"
> > files.
>
> Excellent proposal. +1 on that instead.
Thanks.
> > - ensure that the temporary files passed to the external diff tool
> > have predictable, documented naming schemes.
>
> Did you mean instead,
>
> - ensure that the called program has a deterministic way to access
> the Subversion working copy (if applicable) and repository URL
> associated with each target file.
>
> ? I hope so. Based on what you say below, I think so.
I didn't, but hey, makes sense. +1.
> > I'd prefer if the values of the
> > --diff[3]-cmd options were format strings:
> > diff-cmd = /my/diff/program --left %L --right %R --mime-type %M
>
> That would have been good for the status quo or if Subversion were to
> call different diff programs for different files, but after your
> proposal above, every diff will be handled by the same script, so
> there is no longer any need for the calling convention to be
> customisable. Just invent a calling convention like we do for the
> repository hook scripts.
Okay, that's cool. Note also that we need more than a calling
convention -- return values from the script would also be an important
part of the contract (indicating success, detected conflicts, binary
files that can't be handled, or whatever, like the GNU programs do).
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Custom merge/diff tool feature request
Posted by Julian Foad <ju...@btopenworld.com>.
C. Michael Pilato wrote:
> Aaron Hillegass <in...@bignerdranch.com> writes:
>
>>But, what I really want is a way to configure subversion to use my
>>custom diff/merge for a given file type. I want a way to say: "For
>>any file with a .sql extension, use sql_diff instead of the standard
>>line-based merge/diff".
>
> We've seen requests like this before. And until a week ago, I was
> even +1 on the idea. But no more.
So was I.
>
> Subversion needs only to do the following:
>
> - *always* call the external diff/diff3 program when those have
> been customized (via --diff[3]-cmd or the runtime configuration
> area), instead of automatically ruling out diffs on "binary"
> files.
Excellent proposal. +1 on that instead.
>
> - ensure that the temporary files passed to the external diff tool
> have predictable, documented naming schemes.
Did you mean instead,
- ensure that the called program has a deterministic way to access the
Subversion working copy (if applicable) and repository URL associated with each
target file.
? I hope so. Based on what you say below, I think so.
> This would allow folks to write a script used as the value of
> --diff-cmd which can determine the input file's type either by its
> file extension or by asking Subversion about the mimetype, and then
> call the *real* program of your choosing.
[...]
> I'd prefer if the values of the
> --diff[3]-cmd options were format strings:
>
> diff-cmd = /my/diff/program --left %L --right %R --mime-type %M
That would have been good for the status quo or if Subversion were to call
different diff programs for different files, but after your proposal above,
every diff will be handled by the same script, so there is no longer any need
for the calling convention to be customisable. Just invent a calling
convention like we do for the repository hook scripts.
- Julian
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: Custom merge/diff tool feature request
Posted by "C. Michael Pilato" <cm...@collab.net>.
Aaron Hillegass <in...@bignerdranch.com> writes:
> We are using subversion for all our source code for our applications
> and our books. It is a great tool, and we are greatly indebted to
> all of you. I do, however, have a suggestion for an improvement:
>
> For most types of source code, the default line-based merge/diff
> works beautifully. There are, however, other types of file that
> might be mergeable: database files, nib files, compressed files. For
> these, I would want to write a custom merge/diff tool. My tool would
> have to take the same arguments as GNU diff.
>
> Then, from the command-line, I can specify:
> svn diff --diff-cmd sqlite_diff foo.sql
> svn merge --diff3-cmd sqlite_diff foo.sql
>
> But, what I really want is a way to configure subversion to use my
> custom diff/merge for a given file type. I want a way to say: "For
> any file with a .sql extension, use sql_diff instead of the standard
> line-based merge/diff".
We've seen requests like this before. And until a week ago, I was
even +1 on the idea. But no more.
Subversion needs only to do the following:
- *always* call the external diff/diff3 program when those have
been customized (via --diff[3]-cmd or the runtime configuration
area), instead of automatically ruling out diffs on "binary"
files.
- ensure that the temporary files passed to the external diff tool
have predictable, documented naming schemes.
This would allow folks to write a script used as the value of
--diff-cmd which can determine the input file's type either by its
file extension or by asking Subversion about the mimetype, and then
call the *real* program of your choosing.
A separate frustration is that Subversion always calls the external
programs with a set of parameters suitable for (only?) GNU diff and
diff3. That's stupid cruft. I'd prefer if the values of the
--diff[3]-cmd options were format strings:
diff-cmd = /my/diff/program --left %L --right %R --mime-type %M
Sum'in like that.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org