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

gccd doesn't work if no output specified #12023

Closed
mark2185 opened this issue Nov 4, 2023 · 4 comments
Closed

gccd doesn't work if no output specified #12023

mark2185 opened this issue Nov 4, 2023 · 4 comments
Assignees
Labels
Area: plugin Issue or PR related to a plugin Bug Something isn't working Status: needs repro Bug that doesn't have a reproduction Topic: alias Pull Request or issue regarding aliases

Comments

@mark2185
Copy link
Contributor

mark2185 commented Nov 4, 2023

Describe the bug

According to the comments in the gccd function, gccd git@github.com:ohmyzsh/ohmyzsh.git should work, but I get this:

Cloning into 'ohmyzsh'...
remote: Enumerating objects: 31651, done.
remote: Counting objects: 100% (2566/2566), done.
remote: Compressing objects: 100% (307/307), done.
remote: Total 31651 (delta 2429), reused 2327 (delta 2259), pack-reused 29085
Receiving objects: 100% (31651/31651), 10.30 MiB | 9.36 MiB/s, done.
Resolving deltas: 100% (16526/16526), done.
gccd:cd:9: no such file or directory: local

I'm pretty sure it was introduced in this commit.

Steps to reproduce

  1. Enable plugin git
  2. Run gccd git@github.com:ohmyzsh/ohmyzsh.git

Expected behavior

I expect to be positioned in the cloned repository.

Screenshots and recordings

No response

OS / Linux distribution

Linux lapitopi 6.5.9-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 26 Oct 2023 00:52:20 +0000 x86_64 GNU/Linux

Zsh version

5.9

Terminal emulator

Kitty, guake

If using WSL on Windows, which version of WSL

None

Additional context

I tried debugging it, but I'm not very well versed in the cipher called zsh so I'm opening up an issue instead.

@mcornella mcornella added Bug Something isn't working Area: plugin Issue or PR related to a plugin Topic: alias Pull Request or issue regarding aliases Status: needs repro Bug that doesn't have a reproduction labels Nov 4, 2023
@mcornella mcornella self-assigned this Nov 4, 2023
@mcornella
Copy link
Member

Hi Luka, thanks for the report. I can't actually reproduce this, could you run the same command again with trace enabled and post the output?

functions -t gccd
gccd git@github.com:ohmyzsh/ohmyzsh.git

@mark2185
Copy link
Contributor Author

mark2185 commented Nov 4, 2023

Here's the output

 $> gccd git@github.com:ohmyzsh/ohmyzsh.git
+gccd:2> local repo=local
+gccd:5> git clone --recurse-submodules git@github.com:ohmyzsh/ohmyzsh.git
Cloning into 'ohmyzsh'...
remote: Enumerating objects: 31651, done.
remote: Counting objects: 100% (2566/2566), done.
remote: Compressing objects: 100% (302/302), done.
remote: Total 31651 (delta 2429), reused 2332 (delta 2264), pack-reused 29085
Receiving objects: 100% (31651/31651), 10.30 MiB | 6.59 MiB/s, done.
Resolving deltas: 100% (16526/16526), done.
+gccd:9> [[ -d git@github.com:ohmyzsh/ohmyzsh.git ]]
+gccd:9> cd local
gccd:cd:9: no such file or directory: local

And here's with an additional argument

$> gccd git@github.com:ohmyzsh/ohmyzsh.git asdffff
+gccd:2> local repo=local
+gccd:5> git clone --recurse-submodules git@github.com:ohmyzsh/ohmyzsh.git asdffff
Cloning into 'asdffff'...
remote: Enumerating objects: 31651, done.
remote: Counting objects: 100% (2570/2570), done.
remote: Compressing objects: 100% (309/309), done.
remote: Total 31651 (delta 2431), reused 2329 (delta 2261), pack-reused 29081
Receiving objects: 100% (31651/31651), 10.30 MiB | 8.33 MiB/s, done.
Resolving deltas: 100% (16526/16526), done.
+gccd:9> [[ -d asdffff ]]
+gccd:9> cd asdffff
+_ksi_report_pwd:0> print -nu 13 '\e]7;kitty-shell-cwd://lapitopi/tmp/asdffff\a'

@carlosala
Copy link
Member

carlosala commented Nov 5, 2023

@mcornella indeed, I can reproduce. The difference is setopt extendedglob.
https://asciinema.org/a/619368
There're some # in the pattern that make it not usable for notextendedglob.
Maybe setting setopt localoptions extendedglob before assigning repo?

@mcornella
Copy link
Member

Indeed that was the issue. Fixed in b6bb133.

QwertyMax pushed a commit to QwertyMax/ohmyzsh that referenced this issue Nov 8, 2023
fdelacruz pushed a commit to fdelacruz/ohmyzsh that referenced this issue Jan 21, 2024
jmussmann pushed a commit to jmussmann/oh-my-zsh that referenced this issue Feb 17, 2024
pull bot pushed a commit to kis87988/ohmyzsh that referenced this issue Mar 27, 2024
lukaselmer pushed a commit to lukaselmer/ohmyzsh that referenced this issue Apr 16, 2024
cschuyle pushed a commit to cschuyle/ohmyzsh that referenced this issue Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: plugin Issue or PR related to a plugin Bug Something isn't working Status: needs repro Bug that doesn't have a reproduction Topic: alias Pull Request or issue regarding aliases
Projects
Archived in project
Development

No branches or pull requests

3 participants