{"id":784,"date":"2016-04-16T11:56:21","date_gmt":"2016-04-16T15:56:21","guid":{"rendered":"http:\/\/www.rfdm.com\/blog\/?p=784"},"modified":"2016-04-17T23:16:00","modified_gmt":"2016-04-18T03:16:00","slug":"tcsh-completions-for-svn-urls","status":"publish","type":"post","link":"https:\/\/www.rfdm.com\/blog\/?p=784","title":{"rendered":"tcsh completions for svn URLs"},"content":{"rendered":"<p>For quite some time, I&#8217;ve wanted tcsh completions for URLs when using svn (the Subversion command-line client).  I finally wrote my own recently.<\/p>\n<p>There were solutions available on the web, but they only worked with file:\/\/ URLs.  I suspect most developers are rarely using file:\/\/ URLs.  Typically the repository is on another machine with some type of remote access.  In my case, via svn+ssh:\/\/ URLs.  I was unable to find anything that worked with remote URLs.<\/p>\n<p>Since tcsh 6.17 and above expose a COMMAND_LINE environment variable that contains the current command line, it wasn&#8217;t rocket science to write a simple C++ program to complete svn URLs.  The source code for my simple solution is available here: <a href=\"http:\/\/www.rfdm.com\/Daniel\/Computing\/Software\/svnutils\/svnutils_tcsh.tgz\">svnutils_tcsh.tgz<\/a><\/p>\n<p>If you compile this and put the resulting cmpl_svn_url binary in your bin directory, you can then have an svn completion in your .tcshrc that contains this:<\/p>\n<pre>\r\ncomplete svn ...\r\n             'C@file:\/\/\/@`'\"${HOME}\/bin\/cmpl_svn_url\"'`@@' \\\r\n             'C@svn+ssh:\/\/@`'\"${HOME}\/bin\/cmpl_svn_url\"'`@@' \\\r\n             'C@http:\/\/@`'\"${HOME}\/bin\/cmpl_svn_url\"'`@@' \\\r\n             'C@https:\/\/@`'\"${HOME}\/bin\/cmpl_svn_url\"'`@@' \\\r\n             ...\r\n<\/pre>\n<p>Obviously this will be slow if access to the Subversion server is slow.  That&#8217;s not the case for my home repository since it&#8217;s on a local gigabit ethernet connection.  But even when slow, it&#8217;s handy for new checkouts, creating branches or tags, listing the repository or &#8216;svn cat&#8217; to see a file in the repository.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For quite some time, I&#8217;ve wanted tcsh completions for URLs when using svn (the Subversion command-line client). I finally wrote my own recently. There were solutions available on the web, but they only worked with file:\/\/ URLs. I suspect most developers are rarely using file:\/\/ URLs. Typically the repository is on another machine with some &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.rfdm.com\/blog\/?p=784\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;tcsh completions for svn URLs&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-784","post","type-post","status-publish","format-standard","hentry","category-software-development"],"_links":{"self":[{"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=784"}],"version-history":[{"count":5,"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/784\/revisions"}],"predecessor-version":[{"id":789,"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/784\/revisions\/789"}],"wp:attachment":[{"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rfdm.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}