Re: [PATCH 5/6] completion: clarify difftool completion

2013-06-03 Thread Junio C Hamano
Ramkumar Ramachandra  writes:

> 'git difftool' is clearly a frontend to 'git diff' and is used in
> exactly the same way, but it uses a misleading completion function name
> __git_complete_file (aliased to to __git_complete_revlist_file).  Change
> it to use __git_complete_revlist_file, just like 'git diff'.  No
> functional changes.

Makes sense.  The completion helper for both revname and pathname
should not be called __git_complete_file, and this is a step in the
right direction.

If we have a situation where we _know_ we only want to complete
pathname and never revname, we may want to keep __git_complete_file
function.  For example, after seeing "--" on the command line, we
may want to use __git_complete_file (that does not look at revs,
instead of __git_complete_revlist_file function.

Will apply.

Thanks.

>
> Signed-off-by: Ramkumar Ramachandra 
> ---
>  contrib/completion/git-completion.bash | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/completion/git-completion.bash 
> b/contrib/completion/git-completion.bash
> index f46964d..8d70c30 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1305,7 +1305,7 @@ _git_difftool ()
>   return
>   ;;
>   esac
> - __git_complete_file
> + __git_complete_revlist_file
>  }
>  
>  __git_fetch_options="

--
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


[PATCH 5/6] completion: clarify difftool completion

2013-06-02 Thread Ramkumar Ramachandra
'git difftool' is clearly a frontend to 'git diff' and is used in
exactly the same way, but it uses a misleading completion function name
__git_complete_file (aliased to to __git_complete_revlist_file).  Change
it to use __git_complete_revlist_file, just like 'git diff'.  No
functional changes.

Signed-off-by: Ramkumar Ramachandra 
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash 
b/contrib/completion/git-completion.bash
index f46964d..8d70c30 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1305,7 +1305,7 @@ _git_difftool ()
return
;;
esac
-   __git_complete_file
+   __git_complete_revlist_file
 }
 
 __git_fetch_options="
-- 
1.8.3.457.g2410d5e

--
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