[PATCH] completion: add deprecated __git_complete_file ()

Subsystems: the rest

STALE3741d

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

[PATCH] completion: add deprecated __git_complete_file ()

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:57:35

77c130 (completion: clarify ls-tree, archive, show completion,
2013-06-02) removed __git_complete_file () because it had no callers
left in the file.  However, to avoid breaking user scripts that may
depend on this, add it back as a deprecated alias.

Signed-off-by: Ramkumar Ramachandra <redacted>
---
 Based on pu.

 contrib/completion/git-completion.bash | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index d0a9ba4..0fb81c9 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -489,6 +489,11 @@ __git_complete_revlist_file ()
 	esac
 }
 
+# no callers; deprecated alias
+__git_complete_file ()
+{
+	__git_complete_revlist_file
+}
 
 # __git_complete_index_file requires 1 argument:
 # 1: the options to pass to ls-file
-- 
1.8.3.244.g98dd9db.dirty

Re: [PATCH] completion: add deprecated __git_complete_file ()

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:35

On Fri, Jun 7, 2013 at 2:09 PM, Ramkumar Ramachandra [off-list ref] wrote:
77c130 (completion: clarify ls-tree, archive, show completion,
2013-06-02) removed __git_complete_file () because it had no callers
left in the file.  However, to avoid breaking user scripts that may
depend on this, add it back as a deprecated alias.
This is fine by me, but at some point we need to decide how we should
prefix the functions that are supposed to be used by external scripts.

Also, maybe we should start adding '# TODO remove in v2.0' so we
remember to do that in v2.0.

-- 
Felipe Contreras

Re: [PATCH] completion: add deprecated __git_complete_file ()

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:57:35

Felipe Contreras wrote:
This is fine by me, but at some point we need to decide how we should
prefix the functions that are supposed to be used by external scripts.
Yeah, I thought __ meant "internal" :/
Also, maybe we should start adding '# TODO remove in v2.0' so we
remember to do that in v2.0.
While at it, let's also clean up the deprecated zsh nonsense in
git-completion.bash.

Re: [PATCH] completion: add deprecated __git_complete_file ()

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:35

On Fri, Jun 7, 2013 at 2:29 PM, Ramkumar Ramachandra [off-list ref] wrote:
Felipe Contreras wrote:
quoted
This is fine by me, but at some point we need to decide how we should
prefix the functions that are supposed to be used by external scripts.
Yeah, I thought __ meant "internal" :/
quoted
Also, maybe we should start adding '# TODO remove in v2.0' so we
remember to do that in v2.0.
While at it, let's also clean up the deprecated zsh nonsense in
git-completion.bash.
And the _git _gitk compatibility wrappers.

-- 
Felipe Contreras

Re: [PATCH] completion: add deprecated __git_complete_file ()

From: SZEDER Gábor <hidden>
Date: 2016-06-15 22:57:36

On Fri, Jun 07, 2013 at 02:25:54PM -0500, Felipe Contreras wrote:
On Fri, Jun 7, 2013 at 2:09 PM, Ramkumar Ramachandra [off-list ref] wrote:
quoted
77c130 (completion: clarify ls-tree, archive, show completion,
2013-06-02) removed __git_complete_file () because it had no callers
left in the file.  However, to avoid breaking user scripts that may
depend on this, add it back as a deprecated alias.
This is fine by me, but at some point we need to decide how we should
prefix the functions that are supposed to be used by external scripts.
Or rather how we should prefix the functions that are _not_ supposed
to be used by external scripts.  That way all public functions would
retain the "__git" prefix and existing scripts calling only common
functions like __git_(heads|git_refs|find_on_cmdline|etc.) would work
without modification.


Best,
Gábor
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help