git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-checkout doesn't understand -- separator

From
Junio C Hamano <junkio@cox.net>
Date
Jul 31, 2006, 10:06 UTC
Message-ID
<7vvepe6qcu.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<eakisg$e6j$1@sea.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
Show 7 quoted lines
> git-checkout doesn't understand '--' as a separator between <branch> (which
> is optional, but you can always write HEAD), and <path>...
>
>   1144:jnareb@roke:~/git> git checkout HEAD^ -- gitweb/gitweb.cgi
>   git-checkout-index: -- is not in the cache
>
> Strange...
Perhaps...
diff --git a/git-checkout.sh b/git-checkout.sh
index 5613bfc..580a9e8 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -67,6 +67,10 @@ while [ "$#" != "0" ]; do
 			set x "$arg" "$@"
 			shift
 		fi
+		case "$1" in
+		--)
+			shift ;;
+		esac
 		break
 		;;
     esac
Previous: Jakub Narebski
Message 2 of 2 in “git-checkout doesn't understand -- separator”
  1. Jakub NarebskiJul 31, 2006
  2. Junio C HamanoJul 31, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.