# [PATCH] completion: add deprecated __git_complete_file ()

7 messages from 2013-06-07 to 2013-06-08. Participants: Ramkumar Ramachandra, Felipe Contreras, Junio C Hamano, SZEDER Gábor.
Thread: https://gitlist.dev/t/34051

## Ramkumar Ramachandra, 2013-06-07 19:09

Subject: [PATCH] completion: add deprecated __git_complete_file ()
Message-ID: <1370632168-25298-1-git-send-email-artagnon@gmail.com>
URL: https://gitlist.dev/e/1370632168-25298-1-git-send-email-artagnon%40gmail.com

```
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 <artagnon@gmail.com>
---
 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

```

## Felipe Contreras, 2013-06-07 19:25

Subject: Re: [PATCH] completion: add deprecated __git_complete_file ()
Message-ID: <CAMP44s0_YkZeC_Xrd1XUo=4=yJDy=8wQKYe34uybhXVqi9bd9Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s0_YkZeC_Xrd1XUo%3D4%3DyJDy%3D8wQKYe34uybhXVqi9bd9Q%40mail.gmail.com
In-Reply-To: <1370632168-25298-1-git-send-email-artagnon@gmail.com>

```
On Fri, Jun 7, 2013 at 2:09 PM, Ramkumar Ramachandra <artagnon@gmail.com> 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

```

## Ramkumar Ramachandra, 2013-06-07 19:29

Subject: Re: [PATCH] completion: add deprecated __git_complete_file ()
Message-ID: <CALkWK0mvsQC4fbfnd+Kbk6q6qRCQGgGxQ89=D4O1+EKfXgw34A@mail.gmail.com>
URL: https://gitlist.dev/e/CALkWK0mvsQC4fbfnd%2BKbk6q6qRCQGgGxQ89%3DD4O1%2BEKfXgw34A%40mail.gmail.com
In-Reply-To: <CAMP44s0_YkZeC_Xrd1XUo=4=yJDy=8wQKYe34uybhXVqi9bd9Q@mail.gmail.com>

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

```

## Felipe Contreras, 2013-06-07 19:31

Subject: Re: [PATCH] completion: add deprecated __git_complete_file ()
Message-ID: <CAMP44s0nn_cFNmxy=GXPMYFNy92RbkZyZok7phEHnkc+HHKYfQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s0nn_cFNmxy%3DGXPMYFNy92RbkZyZok7phEHnkc%2BHHKYfQ%40mail.gmail.com
In-Reply-To: <CALkWK0mvsQC4fbfnd+Kbk6q6qRCQGgGxQ89=D4O1+EKfXgw34A@mail.gmail.com>

```
On Fri, Jun 7, 2013 at 2:29 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
> 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.

And the _git _gitk compatibility wrappers.

-- 
Felipe Contreras

```

## Junio C Hamano, 2013-06-07 20:38

Subject: Re: [PATCH] completion: add deprecated __git_complete_file ()
Message-ID: <7vobbhsll3.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vobbhsll3.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1370632168-25298-1-git-send-email-artagnon@gmail.com>

```
Ramkumar Ramachandra <artagnon@gmail.com> writes:

> 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 <artagnon@gmail.com>
> ---
>  Based on pu.

Will queue; thanks.  With this, I think it will be safe to push the
series in question to 'master'.

```

## SZEDER Gábor, 2013-06-08 00:24

Subject: Re: [PATCH] completion: add deprecated __git_complete_file ()
Message-ID: <20130608002452.GE31625@goldbirke>
URL: https://gitlist.dev/e/20130608002452.GE31625%40goldbirke
In-Reply-To: <7vobbhsll3.fsf@alter.siamese.dyndns.org>

```
On Fri, Jun 07, 2013 at 01:38:16PM -0700, Junio C Hamano wrote:
> Ramkumar Ramachandra <artagnon@gmail.com> writes:
> 
> > 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 <artagnon@gmail.com>
> > ---
> >  Based on pu.
> 
> Will queue; thanks.  With this, I think it will be safe to push the
> series in question to 'master'.

Safe?  Yes, at least scripts won't break because of the missing
function.

However, I still think it would be worth reverting at least the hunks
modifying the completion functions of ls-tree and archive.  Or better
yet, the whole series.

```

## SZEDER Gábor, 2013-06-08 00:35

Subject: Re: [PATCH] completion: add deprecated __git_complete_file ()
Message-ID: <20130608003512.GF31625@goldbirke>
URL: https://gitlist.dev/e/20130608003512.GF31625%40goldbirke
In-Reply-To: <CAMP44s0_YkZeC_Xrd1XUo=4=yJDy=8wQKYe34uybhXVqi9bd9Q@mail.gmail.com>

```
On Fri, Jun 07, 2013 at 02:25:54PM -0500, Felipe Contreras wrote:
> On Fri, Jun 7, 2013 at 2:09 PM, Ramkumar Ramachandra <artagnon@gmail.com> 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.

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

```
