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

Brace expansion getting in the way in git stash apply #434

Closed
jamesgecko opened this issue Dec 10, 2012 · 9 comments
Closed

Brace expansion getting in the way in git stash apply #434

jamesgecko opened this issue Dec 10, 2012 · 9 comments
Milestone

Comments

@jamesgecko
Copy link

The following git command breaks when I use it in fish.

In fish:

 [1] ><((ˣ> g stash apply stash@{3}
 fatal: ambiguous argument 'stash@3': unknown revision or path not in the working tree.
 Use '--' to separate paths from revisions

In bash:

 bash-3.2$ git stash apply stash@{3}
 # On branch working
 # Changes not staged for commit:
 #   (use "git add <file>..." to update what will be committed)
 #   (use "git checkout -- <file>..." to discard changes in working directory)
 #
 #  modified:   spec/data/stuff.dat
 #
 # Untracked files:
 #   (use "git add <file>..." to include in what will be committed)
 #
 #  routes
 no changes added to commit (use "git add" and/or "git commit -a")
@ridiculousfish
Copy link
Member

{ and } are special characters in fish.

@j0hnsmith
Copy link

You have to use quotes git stash apply 'stash@{3}'

@ghost
Copy link

ghost commented Jan 14, 2013

Even bash has strange behaviour:

$ echo H{a}
 H{a}
$ echo H{a,b}
Ha Hb
$ echo $BASH_VERSION 
4.2.37(1)-release

@franciscolourenco
Copy link

This is a considerable inconvenience..

@KamilaBorowska
Copy link
Contributor

Perhaps it would be a good idea to use more recognizable color for symbols like { and } by default. Currently, they have very similar color to standard letters, making this even more confusing (even if those colors aren't exactly identical).

@zanchey
Copy link
Member

zanchey commented Jan 31, 2014

That sounds like it would be worth a go @xfix

@KamilaBorowska
Copy link
Contributor

It's hard to think of any particular color, but it seems that #ff87d7 works well. The alternative is green (which is often used in text editors to mark variables), but that could be confusing with the default prompt being green. I made two screenshots for comparison reasons. I don't think that any particular sets other than black on white, and white on black have to be considered here. If someone uses pink background, or something, it's possible to fix such issues with fish_config anyway.

proposal

proposal2

Please note that variables aren't highlighted on those screenshots. The proposal to improve this is available to read at #1201.

@smarzougui
Copy link

Hello,

You can do this for example:
git stash apply stash@{2}

You have to escape the "{".

@faho faho changed the title git stash apply Brace expansion getting in the way in git stash apply Aug 10, 2015
@faho
Copy link
Member

faho commented May 26, 2016

We now have tab completion that offers the properly escaped versions, so it should be easy to pick one and it should be clear that escaping is necessary. I believe this issue is fixed.

@faho faho closed this as completed May 26, 2016
@zanchey zanchey modified the milestones: 2.3.0, fish-future May 26, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants