<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>265730</bug_id>
          
          <creation_ts>2011-02-07 22:29:25 +0000</creation_ts>
          <short_desc>KDE 4.6.0: kate: startup noise and broken external tool</short_desc>
          <delta_ts>2011-07-29 16:43:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kate</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Jon Nelson">jnelson-kde</reporter>
          <assigned_to name="KWrite Developers">kwrite-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1085056</commentid>
    <comment_count>0</comment_count>
    <who name="Jon Nelson">jnelson-kde</who>
    <bug_when>2011-02-07 22:29:25 +0000</bug_when>
    <thetext>Version:           unspecified (using KDE 4.6.0) 
OS:                Linux

Every time kate is opened the following is spammed:

&quot;KConfigIni: In file /usr/share/kde4/apps/kate/externaltools, line 8: &quot;
&quot;Invalid escape sequence &quot;\&apos;&quot;.&quot; 
&quot;KConfigIni: In file /usr/share/kde4/apps/kate/externaltools, line 8: &quot;
&quot;Invalid escape sequence &quot;\&apos;&quot;.&quot; 
&quot;KConfigIni: In file /usr/share/kde4/apps/kate/externaltools, line 8: &quot;
&quot;Invalid escape sequence &quot;\&apos;&quot;.&quot; 
&quot;KConfigIni: In file /usr/share/kde4/apps/kate/externaltools, line 8: &quot;
&quot;Invalid escape sequence &quot;\&apos;&quot;.&quot; 


This should be pretty trivial to fix:

change:
 \&apos;%filename\&apos;
to:
 \\&apos;%filename\\&apos;
or
&apos;%filename&apos;

(I&apos;m not sure which is correct)



Reproducible: Always</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1088495</commentid>
    <comment_count>1</comment_count>
    <who name="Jon Nelson">jnelson-kde</who>
    <bug_when>2011-02-16 16:19:39 +0000</bug_when>
    <thetext>A corrected command:


command=if [ -z %directory ];  then kdialog --title Error --msgbox &quot;The document has never been saved and thus cannot be compared to RCS.&quot;; else\ncd %directory\nif [ -d .svn ] &amp;&amp; grep %filename .svn/entries 2&gt;&amp;1 &gt;/dev/null ; then\n  svn diff %filename|kompare -o -\nelif [ -d CVS ] &amp;&amp; grep %filename CVS/Entries 2&gt;&amp;1 &gt;/dev/null ; then\n  cvs diff -ub %filename|kompare -o -\nelif [ -d .git ] &amp;&amp; echo $(git ls-files) | grep %filename 2&gt;&amp;1 &gt;/dev/null ; then\n  git diff %filename|kompare -o -\nelse\n  kdialog --title Error --msgbox &quot;The file &apos;%filename&apos; is not under revision control.&quot;;\nfi\nfi\n
executable=kompare


Please note the addition of a semi-colon after the initial &apos;if&apos; (and before &apos;then&apos;) and the correction of the back-whack (&apos;\&apos;) before the single-quotes in the message &quot;The file &apos;%filename&apos; is not under revision control.&quot;

Please note:

echo $(git ls-files) &lt;&lt;- wrong
git ls-files | grep &lt;&lt;- right

Please note: the original script placed an &quot;fi&quot; before &quot;cd %directory&quot;. This is wrong. If %directory was empty then kdialog would get executed with &quot;The document has never been saved and thus..&quot; *however* the script would then continue anyway.  The logic here *should* be:

if [ -z %directory ]; then
  kdialog --title Error --msgbox &quot;The document has never been saved and thus cannot be compared to RCS.&quot;;
else
  cd %directory || exit 1
  if [ -d .svn ] &amp;&amp; grep %filename .svn/entries 2&gt;&amp;1 &gt;/dev/null ; then
   svn diff %filename|kompare -o -
  elif [ -d CVS ] &amp;&amp; grep %filename CVS/Entries 2&gt;&amp;1 &gt;/dev/null ; then
   cvs diff -ub %filename|kompare -o -
  elif [ -d .git ] &amp;&amp; git ls-files | grep %filename 2&gt;&amp;1 &gt;/dev/null ; then
   git diff %filename|kompare -o -
  else
   kdialog --title Error --msgbox &quot;The file &apos;%filename&apos; is not under revision control.&quot;;
  fi
fi


Lastly, *none* of these work in subdirectories of the top-level project (except perhaps CVS -- I can&apos;t say). 

Almost all of these external commands are probably better implemented as external *helper scripts* which kate then executes with the right arguments. That would make them easier to maintain, easier to write correctly, and probably safer to execute.

In this particular case, kate shipped with an external command that didn&apos;t even parse properly and doesn&apos;t work anyway.  I suggest that this particular command be removed -- it has too many issues to be corrected.

ditto externaltool_CompareDirectoryofCurrentDocumenttoRCS and externaltool_EmailCVSDiffforCurrentDocument.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1127832</commentid>
    <comment_count>2</comment_count>
    <who name="Christoph Cullmann">christoph</who>
    <bug_when>2011-06-05 17:39:43 +0000</bug_when>
    <thetext>Git commit 50d61a17d2d651ee5464f112f35fc5e4b9f204d9 by Christoph Cullmann.
Committed on 05/06/2011 at 17:39.
Pushed by cullmann into branch &apos;master&apos;.

remove broken commands
thanks for pointing this out to Jon Nelson
BUG: 265730

M  +1    -31   kate/plugins/externaltools/externaltools     

http://commits.kde.org/kate/50d61a17d2d651ee5464f112f35fc5e4b9f204d9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1146969</commentid>
    <comment_count>3</comment_count>
    <who name="Jon Nelson">jnelson-kde</who>
    <bug_when>2011-07-29 16:43:00 +0000</bug_when>
    <thetext>Confirm it is fixed in 4.7.0 final.
Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>