Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zsh hanging when tab completing add/checkout #417

Closed
wants to merge 4 commits into from

Conversation

joshzcold
Copy link

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:

  • add changed files
  • add a new file they want to track in source control.

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

2022-05-07.11.56.36.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
Copy link
Author

joshzcold commented May 7, 2022

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
Copy link
Author

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

@joshzcold
Copy link
Author

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
Copy link
Member

@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
Copy link

jc00ke commented May 25, 2022

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

fish has a similar problem. fish, version 3.4.1

@TheLocehiliosan TheLocehiliosan changed the base branch from master to develop June 3, 2022 20:33
@TheLocehiliosan
Copy link
Member

@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
Copy link
Member

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
Copy link
Author

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

@TheLocehiliosan
Copy link
Member

@joshzcold Congratulations 🎉 Thanks for the contribution.

@jc00ke
Copy link

jc00ke commented Jul 8, 2022

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

Best reason ever... congrats! 🎊🎉✨

@kun-codes
Copy link

can this PR be merged now? @TheLocehiliosan

@TheLocehiliosan
Copy link
Member

TheLocehiliosan commented Jan 21, 2023

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

thanks @TheLocehiliosan

TheLocehiliosan added a commit that referenced this pull request Jan 23, 2023
* Support spaces in distro/distro-family (#432)
* Fix zsh hanging when tab completing add/checkout (#417)
* Add yadm-untracked script to contributed files (#418)
* Fix documentation typos (#425)
* Support docker-like OCI engines for dev testing (#431)
@jc00ke
Copy link

jc00ke commented Jan 23, 2023

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
Copy link
Member

@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
Copy link
Member

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

@jc00ke - Could you post your information in #359 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants