[PATCH v2 1/4] completion: prioritize ./git-completion.bash

2014-01-03 Thread Ramkumar Ramachandra
To ease development, prioritize ./git-completion.bash over other
standard system paths.

Signed-off-by: Ramkumar Ramachandra artag...@gmail.com
---
 contrib/completion/git-completion.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.zsh 
b/contrib/completion/git-completion.zsh
index fac5e71..6fca145 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -30,10 +30,10 @@ if [ -z $script ]; then
local -a locations
local e
locations=(
+   $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
'/etc/bash_completion.d/git' # fedora, old debian
'/usr/share/bash-completion/completions/git' # arch, ubuntu, 
new debian
'/usr/share/bash-completion/git' # gentoo
-   $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
)
for e in $locations; do
test -f $e  script=$e  break
-- 
1.8.5.2.227.g53f3478

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/4] completion: prioritize ./git-completion.bash

2014-01-03 Thread brian m. carlson
On Fri, Jan 03, 2014 at 01:30:28PM +0530, Ramkumar Ramachandra wrote:
 To ease development, prioritize ./git-completion.bash over other
 standard system paths.
 
 Signed-off-by: Ramkumar Ramachandra artag...@gmail.com
 ---
  contrib/completion/git-completion.zsh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/contrib/completion/git-completion.zsh 
 b/contrib/completion/git-completion.zsh
 index fac5e71..6fca145 100644
 --- a/contrib/completion/git-completion.zsh
 +++ b/contrib/completion/git-completion.zsh
 @@ -30,10 +30,10 @@ if [ -z $script ]; then
   local -a locations
   local e
   locations=(
 + $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
   '/etc/bash_completion.d/git' # fedora, old debian
   '/usr/share/bash-completion/completions/git' # arch, ubuntu, 
 new debian
   '/usr/share/bash-completion/git' # gentoo
 - $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
   )
   for e in $locations; do
   test -f $e  script=$e  break

I'm not clear on this change.  It looks like this loads
git-completion.bash from the same directory as git-completion.zsh.  Is
this correct?  Your commit message says ./, and if that's the case, it
has the same security problems as putting . first in your PATH.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187


signature.asc
Description: Digital signature


Re: [PATCH v2 1/4] completion: prioritize ./git-completion.bash

2014-01-03 Thread Junio C Hamano
brian m. carlson sand...@crustytoothpaste.net writes:

 On Fri, Jan 03, 2014 at 01:30:28PM +0530, Ramkumar Ramachandra wrote:
 To ease development, prioritize ./git-completion.bash over other
 standard system paths.
 
 Signed-off-by: Ramkumar Ramachandra artag...@gmail.com
 ---
  contrib/completion/git-completion.zsh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/contrib/completion/git-completion.zsh 
 b/contrib/completion/git-completion.zsh
 index fac5e71..6fca145 100644
 --- a/contrib/completion/git-completion.zsh
 +++ b/contrib/completion/git-completion.zsh
 @@ -30,10 +30,10 @@ if [ -z $script ]; then
  local -a locations
  local e
  locations=(
 +$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
  '/etc/bash_completion.d/git' # fedora, old debian
  '/usr/share/bash-completion/completions/git' # arch, ubuntu, 
 new debian
  '/usr/share/bash-completion/git' # gentoo
 -$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
  )
  for e in $locations; do
  test -f $e  script=$e  break

 I'm not clear on this change.  It looks like this loads
 git-completion.bash from the same directory as git-completion.zsh.  Is
 this correct?

I think the idea is to help those who have installed a closer to
bleeding-edge version of completion scripts --- they will not be
reading their zsh completions from the system default locations,
and the place next to it would be a place more likely to have the
matching bleeding-edge version of bash completion than the system
default place.

 Your commit message says ./, and if that's the case, it
 has the same security problems as putting . first in your PATH.

A correct observation. I think

Subject: zsh completion: find matching custom bash completion

If zsh completion is being read from a location that is
different from system-wide default, it is likely that the
user is trying to use a custom version, perhaps closer to
the bleeding edge, installed in her own directory. We will
more likely to find the matching bash completion script in
the same directory than in those system default places.

would probably a lot closer to what the patch really does.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html