You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by loudking <lo...@gmail.com> on 2016/04/07 09:21:28 UTC

svn --diff-cmd not working

Dear all, I configured svn to call a wrapper script for diff command but 
encountered following error:

~/knowsg.com/steps $ svn diff command_at_development.txt
Index: command_at_development.txt
===================================================================
exec of '/home/knowsg_admin/bin/svndiffwrap.sh' failed: No such file or 
directorysvn: '/home/knowsg_admin/bin/svndiffwrap.sh' returned 255


part of ~/.subversion/config is like this:

### Set diff-cmd to the absolute path of your 'diff' program.
### This will override the compile-time default, which is to use
### Subversion's internal diff implementation.
# diff-cmd = diff_program (diff, gdiff, etc.)
diff-cmd = /home/knowsg_admin/bin/svndiffwrap.sh


But the script is right there with executing privileges:

~/knowsg.com/steps $ ll /home/knowsg_admin/bin
total 4.0K
-rwxr-xr-x 1 knowsg_admin knowsg_admin 369 Apr 5 11:06 svndiffwrap.sh*


Even its parent directory is on $PATH:
~/knowsg.com/steps $ echo $PATH
/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:
/sbin:/home/knowsg_admin/bin


Can anybody help me with this please? Thanks.

Re: svn --diff-cmd not working

Posted by loudking <lo...@gmail.com>.
Hi all, it turns out that the problem is because of End-of-Line in the 
wrapper script. Thank you for all your help.

On Thursday, April 7, 2016 at 3:21:39 PM UTC+8, loudking wrote:
>
> Dear all, I configured svn to call a wrapper script for diff command but 
> encountered following error:
>
> ~/knowsg.com/steps $ svn diff command_at_development.txt
> Index: command_at_development.txt
> ===================================================================
> exec of '/home/knowsg_admin/bin/svndiffwrap.sh' failed: No such file or 
> directorysvn: '/home/knowsg_admin/bin/svndiffwrap.sh' returned 255
>
>
> part of ~/.subversion/config is like this:
>
> ### Set diff-cmd to the absolute path of your 'diff' program.
> ### This will override the compile-time default, which is to use
> ### Subversion's internal diff implementation.
> # diff-cmd = diff_program (diff, gdiff, etc.)
> diff-cmd = /home/knowsg_admin/bin/svndiffwrap.sh
>
>
> But the script is right there with executing privileges:
>
> ~/knowsg.com/steps $ ll /home/knowsg_admin/bin
> total 4.0K
> -rwxr-xr-x 1 knowsg_admin knowsg_admin 369 Apr 5 11:06 svndiffwrap.sh*
>
>
> Even its parent directory is on $PATH:
> ~/knowsg.com/steps $ echo $PATH
> /usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin
> :/sbin:/home/knowsg_admin/bin
>
>
> Can anybody help me with this please? Thanks.
>

Re: svn --diff-cmd not working

Posted by Stefan <lu...@posteo.de>.
Hi loudking,

> Dear all, I configured svn to call a wrapper script for diff command 
> but encountered following error:
>
> |
> ~/knowsg.com/steps $ svn diff command_at_development.txt
> Index:command_at_development.txt
> ===================================================================
> execof '/home/knowsg_admin/bin/svndiffwrap.sh'failed:Nosuch file 
> ordirectorysvn:'/home/knowsg_admin/bin/svndiffwrap.sh'returned 255
> |
>
>
> part of ~/.subversion/config is like this:
>
> |
> ### Set diff-cmd to the absolute path of your 'diff' program.
> ### This will override the compile-time default, which is to use
> ### Subversion's internal diff implementation.
> # diff-cmd = diff_program (diff, gdiff, etc.)
> diff-cmd =/home/knowsg_admin/bin/svndiffwrap.sh
> |
>
>
> But the script is right there with executing privileges:
>
> |
> ~/knowsg.com/steps $ ll /home/knowsg_admin/bin
> total 4.0K
> -rwxr-xr-x 1knowsg_admin knowsg_admin 369Apr511:06svndiffwrap.sh*
> |
>
>
> Even its parent directory is on $PATH:
> |
> ~/knowsg.com/steps $ echo $PATH
> /usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/knowsg_admin/bin
> |
>
>
> Can anybody help me with this please? Thanks.
You don't execute the svn command with a different use by any chance, do 
you?
Did you test putting the svndiffwrap.sh file somewhere else (for example 
into /var/)?

Regards,
Stefan

Re: svn --diff-cmd not working

Posted by Torge Riedel <to...@gmx.de>.
Am 08.04.2016 um 03:25 schrieb Ryan Schmidt:
>
> On Apr 7, 2016, at 2:21 AM, loudking wrote:
>
>> Dear all, I configured svn to call a wrapper script for diff command but encountered following error:
>>
>> ~/knowsg.com/steps $ svn diff command_at_development.txt
>> Index: command_at_development.txt
>> ===================================================================
>> exec of '/home/knowsg_admin/bin/svndiffwrap.sh' failed: No such file or directorysvn: '/home/knowsg_admin/bin/svndiffwrap.sh' returned 255
>>
>>
>> part of ~/.subversion/config is like this:
>>
>> ### Set diff-cmd to the absolute path of your 'diff' program.
>> ### This will override the compile-time default, which is to use
>> ### Subversion's internal diff implementation.
>> # diff-cmd = diff_program (diff, gdiff, etc.)
>> diff-cmd = /home/knowsg_admin/bin/svndiffwrap.sh
>>
>>
>> But the script is right there with executing privileges:
>>
>> ~/knowsg.com/steps $ ll /home/knowsg_admin/bin
>> total 4.0K
>> -rwxr-xr-x 1 knowsg_admin knowsg_admin 369 Apr 5 11:06 svndiffwrap.sh*
>>
>>
>> Even its parent directory is on $PATH:
>> ~/knowsg.com/steps $ echo $PATH
>> /usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/knowsg_admin/bin
>>
>>
>> Can anybody help me with this please? Thanks.
>
> Are you using SELinux? If so, you may need to tell it to allow that script to be executed.
>
>
>

Can you show us the header of the script? I'm wondering why it says "No such file or directorysvn"! Why is there this "svn"? What script interpreter have you specified? Is it installed and placed at the location specified in the script? This might raise this error too.

Torge

Re: svn --diff-cmd not working

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Apr 7, 2016, at 2:21 AM, loudking wrote:

> Dear all, I configured svn to call a wrapper script for diff command but encountered following error:
> 
> ~/knowsg.com/steps $ svn diff command_at_development.txt
> Index: command_at_development.txt
> ===================================================================
> exec of '/home/knowsg_admin/bin/svndiffwrap.sh' failed: No such file or directorysvn: '/home/knowsg_admin/bin/svndiffwrap.sh' returned 255
> 
> 
> part of ~/.subversion/config is like this:
> 
> ### Set diff-cmd to the absolute path of your 'diff' program.
> ### This will override the compile-time default, which is to use
> ### Subversion's internal diff implementation.
> # diff-cmd = diff_program (diff, gdiff, etc.)
> diff-cmd = /home/knowsg_admin/bin/svndiffwrap.sh
> 
> 
> But the script is right there with executing privileges:
> 
> ~/knowsg.com/steps $ ll /home/knowsg_admin/bin
> total 4.0K
> -rwxr-xr-x 1 knowsg_admin knowsg_admin 369 Apr 5 11:06 svndiffwrap.sh*
> 
> 
> Even its parent directory is on $PATH:
> ~/knowsg.com/steps $ echo $PATH
> /usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/knowsg_admin/bin
> 
> 
> Can anybody help me with this please? Thanks.

Are you using SELinux? If so, you may need to tell it to allow that script to be executed.



Re: svn --diff-cmd not working

Posted by Yves Martin <ym...@gmail.com>.
Hello,
Are you sure there are proper ${6} and ${7} arguments in any cases ?
You should add check in your script before invoking vim -d
I also recommend to end script with "exec /usr/bin/vim ...."

-- 
Yves Martin

Re: svn --diff-cmd not working

Posted by Stefan Sperling <st...@elego.de>.
On Thu, Apr 07, 2016 at 04:55:24PM +0800, Hongliang Wang wrote:
> Hi Stefan, Thanks for your reply. The contents of my wrapper likes this and
> it indeed has #!/bin/sh
> 
> ~/bin $ cat svndiffwrap.sh
> #!/bin/sh
> 
> /usr/bin/vim -d ${6} ${7}
> 
> /bin/sh and /usr/bin/vim both exists.
> 
> ~/bin $ ll /bin/sh
> lrwxrwxrwx. 1 root root 4 Mar 21 12:44 /bin/sh -> bash*
> ~/bin $ ll /usr/bin/vim
> -rwxr-xr-x 1 root root 2.1M Jul 24  2015 /usr/bin/vim*

I tried the equivalent configuration on my computer and it works for me.

I don't see why this doesn't work for you. Sorry, no idea :(