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

Comments

Projects
None yet
6 participants
@lmsurpre

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

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Jan 2, 2015

Member

Any ideas here are appreciated.

Member

ridiculousfish commented Jan 2, 2015

Any ideas here are appreciated.

@ridiculousfish ridiculousfish added this to the fish-future milestone Jan 2, 2015

@hauleth

This comment has been minimized.

Show comment
Hide comment
@hauleth

hauleth Jan 7, 2015

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@lmsurpre

lmsurpre Jan 7, 2015

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

lmsurpre commented Jan 7, 2015

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

@hauleth

This comment has been minimized.

Show comment
Hide comment
@hauleth

hauleth Jan 7, 2015

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jan 7, 2015

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

ghost commented Jan 7, 2015

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

@ridiculousfish

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Jan 7, 2015

Member

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

Member

ridiculousfish commented Jan 7, 2015

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

@hauleth

This comment has been minimized.

Show comment
Hide comment
@hauleth

hauleth Jan 7, 2015

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@rocketraman

rocketraman May 7, 2016

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^

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

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish May 8, 2016

Member

This seems like a regression relative to #81

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

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Jun 12, 2016

Member

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

Member

ridiculousfish commented Jun 12, 2016

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

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