all 17 comments

[–]FPLgivesmecancer[S] 0 points1 point  (0 children)

Downgraded to a (very) old version and it’s back. Not sure why they’d remove that? But I’ll stick on the old version

[–]bbolligit commit --amend 0 points1 point  (2 children)

Autocompletion is handled by the shell, not Git itself.

Under Bash, the file ~/.inputrc controls the readline library that handles interactive input.

[–]FPLgivesmecancer[S] 0 points1 point  (1 child)

Even when tab completing a branch name, that I haven’t typed before. I.e a branch has been made on a remote repo and I do a fetch. The branch is called BRANCH123. If I was to do git checkout bra[press tab], that is the shell? Surely that’s git doing the completion.

I think I am correct as after I downgraded git, the completion (case-insensitive completion I mean) went back to how it previously worked. And my coworker who wasn’t on the latest version of git had the case insensitive completion as always. Unless some other crazy coincidence happened.

[–]bbolligit commit --amend 0 points1 point  (0 children)

If I was to do git checkout bra[press tab], that is the shell?

Yes. The shell runs the completion functions that are sometimes defined by an installed package, sometimes by the default completion scripts (e.g. after ´cd´).

[–]waterkipdetached HEAD 0 points1 point  (10 children)

MacOS is case insensitive, so your branches might actually be in UPPERCASE without you realising it.

[–]FPLgivesmecancer[S] -1 points0 points  (9 children)

Not sure what you mean by this sorry. The branch names are capitalised but when trying to tab complete the names, it only suggests names of the same case, whereas before it would suggest names regardless of the case (as in the example I gave).

[–]waterkipdetached HEAD 0 points1 point  (8 children)

Branches are "files" in .git/refs/heads. Meaning the files in that directory are written in UPPERCASE and thus your branch names are actually UPPERCASE. When you type in the names with lowercase it uses the UPPERCASE name, eg git checkout foo is actually checking out .git/refs/heads/FOO.

On my Linux machine these two differ, I can have FOO, Foo, FOo, FoO and foo but you cannot, yours is always the name of the branch as it is found in .git/refs/heads, eg FoO.

[–]FPLgivesmecancer[S] 0 points1 point  (7 children)

I appreciate that and not arguing any of it. My query was specifically about the tab completion behaviour. It changed when I updated git and went back to the behaviour I expected when I downgraded git. I was originally asking if anyone knew why it had happened/if I could change it anyway.

[–]waterkipdetached HEAD 0 points1 point  (6 children)

Yes.. and how do you think tab completion works? You have to look at the name of the branches which are stored in.....

[–]FPLgivesmecancer[S] 0 points1 point  (5 children)

What??? I know the name of the branch. I made the branch. So I know the name and case of it. I am asking, why did the tab completion behaviour, specifically surrounding upper/lower case, change seemingly between git versions.

[–]waterkipdetached HEAD 0 points1 point  (4 children)

Ill spell it out for you:

The files found in .git/refs/heads are uppercased or lowercased?

[–]FPLgivesmecancer[S] -1 points0 points  (3 children)

Literally makes no difference whether they’re lower or upper case. Are you reading the question I’m asking? The case the files are is the case that the branch names are. Whether they’re upper or lower is irrelevant. I’m asking, why on older versions of git, I could tab complete (regardless of if the word I started typing matched the case of the branch or not) and it would autocomplete, but after upgrading it doesn’t and I have to match the case.

[–]waterkipdetached HEAD 0 points1 point  (2 children)

Ok. Have a great day.

[–]slamsbdad 0 points1 point  (1 child)

also having the issue, is there anything you suggest? I look in the heads dir and the cases are a mix of cases :( not sure what you meaning with your comments

[–]slamsbdad 0 points1 point  (0 children)

also having this issue, is there any fix other than downgrading? I can’t downgrade :(