You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
escaping ^ with a \ works fine (same as escaping {} as {} in a find command for instance).
I don't really see this as a bug, but it might be wise to add these to the FAQ.
Another option might be to get the parser to fallback on ^ when a redirection does not make sense (syntactically) but it might lead to tricky situations where depending on the rest of the line the user cannot easily guess if his ^ will be escaped or not.
May be simply add to the error message the suggestion about escaping ^ ...
This kind of sucks, quoting or escaping is annoying because I never remember to do it.
I know that the existing redirection characters are treated the same way in existing shells, but given that this is a new redirection character I think it should get some special handling to make this existing usage work.
@schwa, you'll be glad to know that this particular case has been fixed as #168 . ^ is now only a redirection if it is the first character in a token, which is never used in git.
Activity
ridiculousfish commentedon Jun 8, 2012
^ is a redirection (like |) for I believe stderr. So this is behaving as designed.
You can defeat it through quotes: git checkout "HEAD^"
Leaving this bug open because it is annoying. Anyone please chime in if you have an idea for fixing this.
soli commentedon Jun 9, 2012
escaping ^ with a \ works fine (same as escaping {} as {} in a find command for instance).
I don't really see this as a bug, but it might be wise to add these to the FAQ.
Another option might be to get the parser to fallback on ^ when a redirection does not make sense (syntactically) but it might lead to tricky situations where depending on the rest of the line the user cannot easily guess if his ^ will be escaped or not.
May be simply add to the error message the suggestion about escaping ^ ...
mpe commentedon Jun 13, 2012
This kind of sucks, quoting or escaping is annoying because I never remember to do it.
I know that the existing redirection characters are treated the same way in existing shells, but given that this is a new redirection character I think it should get some special handling to make this existing usage work.
martinklepsch commentedon Aug 3, 2012
#168 seems to be a dupe of this
schwa commentedon Apr 20, 2013
Unfortunately this is a "back to bash" show stopper for me.
ridiculousfish commentedon Apr 20, 2013
@schwa, you'll be glad to know that this particular case has been fixed as #168 . ^ is now only a redirection if it is the first character in a token, which is never used in git.
Closing this - I think the current behavior satisfies everyone.
aeosynth commentedon May 24, 2013
git does use
^as the first character in some places:https://www.kernel.org/pub/software/scm/git/docs/git-rev-list.html#_description
dag commentedon May 24, 2013
Not sure I like this fix, feels vaguely similar to the bash behavior for unmatched wildcards?
danieljames commentedon May 24, 2013
For what it's worth, subversion uses
^as a short cut for the top of the repository, e.g.Although I don't find it a burden to quote it.