Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0905318B37 for ; Tue, 18 Aug 2015 12:52:47 +0000 (UTC) Received: (qmail 1720 invoked by uid 500); 18 Aug 2015 12:52:37 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 1665 invoked by uid 500); 18 Aug 2015 12:52:37 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 1644 invoked by uid 99); 18 Aug 2015 12:52:37 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2015 12:52:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 923EBDECB6 for ; Tue, 18 Aug 2015 12:52:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.12 X-Spam-Level: X-Spam-Status: No, score=-0.12 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=btopenworld.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 1c4PpqhnbSbc for ; Tue, 18 Aug 2015 12:52:28 +0000 (UTC) Received: from rgout0204.bt.lon5.cpcloud.co.uk (rgout0204.bt.lon5.cpcloud.co.uk [65.20.0.203]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 6BDE220F51 for ; Tue, 18 Aug 2015 12:52:27 +0000 (UTC) X-OWM-Source-IP: 209.85.217.176 (US) X-OWM-Env-Sender: julianfoad@btinternet.com X-CTCH-RefID: str=0001.0A090204.55D32A83.0097,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-Junkmail-Premium-Raw: score=8/50,refid=2.7.2:2015.8.13.140916:17:8.129,ip=209.85.217.176,rules=__PHISH_SPEAR_HTTP_RECEIVED, __YOUTUBE_RCVD, __MIME_VERSION, __IN_REP_TO, __REFERENCES, __HAS_FROM, __HAS_MSGID, __SANE_MSGID, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __TO_MALFORMED_2, __CT, __CT_TEXT_PLAIN, CT_TEXT_PLAIN_UTF8_CAPS, __HELO_GMAIL, __ANY_URI, __HTTPS_URI, __URI_NO_WWW, __URI_NO_PATH, __PHISH_SPEAR_PASSWORD_1, __CP_URI_IN_BODY, __SUBJ_ALPHA_NEGATE, SUPERLONG_LINE, __URI_IN_BODY, __FORWARDED_MSG, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_2000_2999, __MIME_TEXT_ONLY, __RDNS_GMAIL, __URI_NS, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, WEBMAIL_SOURCE, __PHISH_SPEAR_STRUCTURE_1, __PHISH_SPEAR_STRUCTURE_2, BODY_SIZE_7000_LESS, __SINGLE_URI_TEXT, REFERENCES, SINGLE_URI_IN_BODY, __DQ_NEG_IP, __DQ_NEG_HEUR X-CTCH-Spam: Unknown Received: from mail-lb0-f176.google.com (209.85.217.176) by rgout02.bt.lon5.cpcloud.co.uk (8.6.122.06) (authenticated as julianfoad@btopenworld.com) id 55C03CE50199F522 for dev@subversion.apache.org; Tue, 18 Aug 2015 13:52:18 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btopenworld.com; s=btcpcloud; t=1439902346; bh=+RQjtoZpVdnOYh9TnISXqxgfM6tTgl2bQmuUNPX6gjw=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject:To:Cc; b=KqxbuA9Mw0BdoMT5RlAbwoU3Gpc1Jmphhsh1DsIz7RnUuieJGMzFSoK2nQd+pfnK65bbL1fd0HOTiwhH+xJb5PJTM4DIBoVqNVmly18+YZhcKpUBOYyKCFNlyi9ZTg9/G6mXnXhERv/jH2Grv0+ux5qsJKhA/RV8PHpMX8L1DwA= Received: by lbcbn3 with SMTP id bn3so101784520lbc.2 for ; Tue, 18 Aug 2015 05:52:18 -0700 (PDT) X-Received: by 10.152.20.196 with SMTP id p4mr6102036lae.121.1439902338873; Tue, 18 Aug 2015 05:52:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.119.166 with HTTP; Tue, 18 Aug 2015 05:51:58 -0700 (PDT) In-Reply-To: <5738538.WDV6EqNOyy@chris-pc> References: <3421020.HomHkagcjs@chris-ws> <5738538.WDV6EqNOyy@chris-pc> From: Julian Foad Date: Tue, 18 Aug 2015 13:51:58 +0100 Message-ID: Subject: Re: bash_completion - subversion add: svn ls/merge ^/ To: Christian Ferbar Cc: dev Content-Type: text/plain; charset=UTF-8 Christian Ferbar wrote: > new version. This patch are my current changes for "svn ls" only. Thanks, Chris. This looks much better already. (I haven't tried it.) > I need some feedback concerning: > > -> how to deal with svn error messages written to stderr, for example: > svn ls svn+ssh://svn.something.com/user@svn.something.com's password: > > this happens when you forget to do ssh-add I suggest it should simply not provide any completions that cannot be obtained without further input. Use --non-interactive so that Subversion does not prompt for passwords. Prevent any stderr output being printed to the console (maybe use "2> /dev/null"). Then make sure the script behaves OK (just returning no completions) when Subversion returns an error. You might need to look for a non-zero exit code explicitly, but maybe not: it might be enough to just try parsing the stdout and if there is no recognizable stdout then you get no resulting completions. > -> in bash >= 4 they changed COMP_WORDS. The Line will be split at : as well, so "file:/something" are 3 array items. Nobody would use subversion 1.9 with bash 3 ... probably. I will drop bash 3 statements, for example: > > if [[ $cur == file:* ]] > > ok? Dropping support for Bash 3 sounds OK to me, if it is difficult to keep it working. Especially good if only the URL completion depends on Bash 4 and all the rest of the existing kinds of completion keep working with Bash 3. >> Please can URL completion work on full URLs as well as on relative URLs? > for SVN LS this is done: > > 1. svn ls tabtab -> ^/ file:/// http:// https:// svn:// svn+ssh:// > 2. svn ls svn+ssh://tabtab -> will look at the ~/.ssh/known_hosts > 3. svn ls http[s]://tabtab -> lookup in ~/.subversion/simple-auth - should still be working > 4. svn ls proto://server/tabtab or ^/tabtab -> autocomplete via "svn ls" Excellent, that looks like the sort of thing I was hoping for. - Julian