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

Fish's handling of ^ still annoying to git users #1873

Closed
lmsurpre opened this issue Jan 2, 2015 · 10 comments
Closed

Fish's handling of ^ still annoying to git users #1873

lmsurpre opened this issue Jan 2, 2015 · 10 comments
Assignees
Labels
enhancement release notes Something that is or should be mentioned in the release notes
Milestone

Comments

@lmsurpre
Copy link

lmsurpre commented Jan 2, 2015

There was a change made in the past so that a caret '^' will only redirect stderr if it is the first character of a token:
#168

Today, I was trying to perform a multiple-point branch compare as described at
http://git-scm.com/book/en/v2/Git-Tools-Revision-Selection#idp25327712

The '^' was the first syntax I used. I didn't understand why it wasn't working.
After experimenting with the options some more, I finally found my clue from the following error message from git:
"fatal: ambiguous argument 'staging': both revision and filename"

Fish was redirecting the stderr to a file with the name of my branch and so git was showing me just the log of the first branch instead of showing the difference.

Not sure if anything can/should be done about it, but thought I would report it anyway.

Also note that the same syntax is used in the rev-list command as mentioned by @aeosynth at #81 (comment)

@ridiculousfish
Copy link
Member

Any ideas here are appreciated.

@ridiculousfish ridiculousfish added this to the fish-future milestone Jan 2, 2015
@hauleth
Copy link
Contributor

hauleth commented Jan 7, 2015

Instead of ^ you can use ~. The only solution I see is to create builtin that will disable some special chars, but IMHO it will be über complicated.

@lmsurpre
Copy link
Author

lmsurpre commented Jan 7, 2015

Or maybe "^" could only redirect when it is a standalone token?

@hauleth
Copy link
Contributor

hauleth commented Jan 7, 2015

IMHO shell should use context free grammar

Łukasz Jan Niemier

Dnia 7 sty 2015 o godz. 15:31 lmsurpre notifications@github.com napisał(a):

Or maybe "^" could only redirect when it is a standalone token?


Reply to this email directly or view it on GitHub.

@ghost
Copy link

ghost commented Jan 7, 2015

You can implement it that way with a context free grammar.

@ridiculousfish
Copy link
Member

An example of the problematic syntax is git log ^refA refB

@hauleth
Copy link
Contributor

hauleth commented Jan 7, 2015

That a^b, a ^b, a^ b and a ^ b will be different? I think not. You can use A~<n> (i.e. A^^^ is equal to A~3) in simple cases. In more complex cases it's better to use commit hash.

@rocketraman
Copy link
Contributor

From the recently referenced duplicate issue which is a slightly different input than previously discussed here:

# git log 1608450^
Expected a string, but instead found end of the statement
fish: git log 1608450^

If the hash value contains non-numeric values, the command works fine:

git log c9ba59f^

@ridiculousfish
Copy link
Member

ridiculousfish commented May 8, 2016

This seems like a regression relative to #81

@ridiculousfish ridiculousfish modified the milestones: 2.3.1, fish-future, next-2.x Jun 12, 2016
@ridiculousfish
Copy link
Member

Now a number followed by a caret is never a redirection. Thanks for reporting this!

@faho faho added the release notes Something that is or should be mentioned in the release notes label Jun 12, 2016
@faho faho mentioned this issue Aug 17, 2016
@krader1961 krader1961 modified the milestones: fish 2.4.0, next-2.x Sep 3, 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
enhancement release notes Something that is or should be mentioned in the release notes
Projects
None yet
Development

No branches or pull requests

6 participants