TheLocehiliosan / yadm

Yet Another Dotfiles Manager
https://yadm.io/
GNU General Public License v3.0
4.92k stars 176 forks source link

Fix zsh hanging when tab completing add/checkout #417

Closed joshzcold closed 1 year ago

joshzcold commented 2 years ago

What does this PR do?

Replaces built in git add completion that hangs on the ${HOME} with a combination yadm status ls completion that should be good enough for users to:

What issues does this PR fix or reference?

359

[A list of related issues / pull requests.]

Previous Behavior

Typing yadm add <TAB> would hang in the zsh terminal as it tries to git-add_complete thousands of files

New Behavior

yadm add <TAB> is now a resolvable completion

https://user-images.githubusercontent.com/36175703/167266174-12a91eb2-4791-4206-9fd3-5a2ce6cca8ee.mp4

Have tests been written for this change?

No

Have these commits been signed with GnuPG?

Yes


Please review yadm's Contributing Guide for best practices.

joshzcold commented 2 years ago

One issue with the script is that it seems to duplicate the porcelain output. Im sure there is some zsh completion flag,arg that needs to be put in. image

joshzcold commented 2 years ago

Fixed the duplicates by removing the "description" from the completion script. image

joshzcold commented 2 years ago

Added back in the descriptions as I found that this line in my config was the culprit and not the function itself zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'

TheLocehiliosan commented 2 years ago

@joshzcold - Thank you for this contribution. I'm not a zsh user, so contributions like this are very appreciated. I'll try to do a few rudimentary tests myself, and look to publish this change.

If there are any other zsh users out there that could help test this for me, I'd appreciate that too.

jc00ke commented 2 years ago

I'm seeing this in fish 3.3.1 on Ubuntu Jammy. I just upgraded Ubuntu today so maybe I was running an older version of yadm or fish, not sure.

I'm happy to help debug!

zzhaolei commented 2 years ago

fish has a similar problem. fish, version 3.4.1

TheLocehiliosan commented 2 years ago

@joshzcold - I was attempting to merge this PR today, but your commits signatures are not verified.

image

The error says, "No user is associated with the committer email." Can you resolve this issue? You can see the verification status in your own repo here: https://github.com/joshzcold/yadm/commits/master

TheLocehiliosan commented 2 years ago

The error says, "No user is associated with the committer email." Can you resolve this issue?

I've resolved this by signing these commits myself. I've merged these changes into the develop branch, and will publish them with the next release.

joshzcold commented 2 years ago

Thank you 👍. Had a baby and lost track of time.

TheLocehiliosan commented 2 years ago

@joshzcold Congratulations 🎉 Thanks for the contribution.

jc00ke commented 2 years ago

Thank you 👍. Had a baby and lost track of time.

Best reason ever... congrats! 🎊🎉✨

kun-codes commented 1 year ago

can this PR be merged now? @TheLocehiliosan

TheLocehiliosan commented 1 year ago

can this PR be merged now? @TheLocehiliosan

@throwaway69420-69420 Yes, it's been too long without a release. I'll publish the development branch during the next week.

kun-codes commented 1 year ago

thanks @TheLocehiliosan

jc00ke commented 1 year ago

I'm still seeing this issue in fish. Should I open up a new issue?

It hangs on <tab> where the arrow is pointing.

image

TheLocehiliosan commented 1 year ago

@jc00ke - Thanks for reporting, I'll just reopen this issue. I'm not a fish user myself, but maybe I'll have to get familiar. I was mostly depending on others to support that shell.

TheLocehiliosan commented 1 year ago

Actually, I didn't realize this was a PR.

@jc00ke - Could you post your information in https://github.com/TheLocehiliosan/yadm/issues/359 ?