{"thread":{"id":"6538","subject":"git fetch over ssh trouble","startedAt":"2007-01-26T05:08:42Z","lastAt":"2007-01-26T14:23:56Z","messageCount":5,"participants":["J. Bruce Fields","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32679","messageId":"20070126050842.GA18058@fieldses.org","threadId":"6538","inReplyTo":null,"subject":"git fetch over ssh trouble","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-01-26T05:08:42Z","receivedAt":"2007-01-26T05:08:42Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"Any idea why this is happening?:\n\nbfields@pickle:git$ git fetch linux-nfs\nPassword:\n/usr/local/bin/git-parse-remote: line 145: test: !=: unary operator\nexpected\nPassword:\nerror: no such remote ref CVSROOT=bfields@cvs.citi.umich.edu\nerror: no such remote ref DBUS_SESSION_BUS_ADDRESS=unix\nerror: no such remote ref DISPLAY=\nerror: no such remote ref GTK_RC_FILES=/etc/gtk/gtkrc\nerror: no such remote ref LONG_USAGE='Usage\nerror: no such remote ref MATHPATH=\nerror: no such remote ref PATH=/usr/local/bin\nerror: no such remote ref SESSION_MANAGER=local/pickle\nerror: no such remote ref SHELLOPTS=braceexpand\nerror: no such remote ref XPSERVERLIST='\nFetch failure: ssh://linux-nfs.org/~bfields/exports/git.git\nbfields@pickle:git$\n\n--b.\n"},{"id":"32681","messageId":"7vmz462wdh.fsf@assigned-by-dhcp.cox.net","threadId":"6538","inReplyTo":"20070126050842.GA18058@fieldses.org","subject":"Re: git fetch over ssh trouble","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-26T05:24:42Z","receivedAt":"2007-01-26T05:24:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"J. Bruce Fields\" <bfields@fieldses.org> writes:\n\n> Any idea why this is happening?:\n>\n> bfields@pickle:git$ git fetch linux-nfs\n> Password:\n> /usr/local/bin/git-parse-remote: line 145: test: !=: unary operator\n> expected\n\nOuch.\n\nI wonder what should happen when you do not have anything\ndefined for \"linus-nfs\" shorthand.  Should it fetch HEAD?\n\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 1122c83..12023d2 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -82,6 +82,7 @@ get_remote_default_refs_for_push () {\n # a merge candidate\n expand_refs_wildcard () {\n \tfirst_one=yes\n+\ttest \"$#\" = 0 && echo empty\n \tfor ref\n \tdo\n \t\tlref=${ref#'+'}\n"},{"id":"32682","messageId":"20070126053400.GB18058@fieldses.org","threadId":"6538","inReplyTo":"7vmz462wdh.fsf@assigned-by-dhcp.cox.net","subject":"Re: git fetch over ssh trouble","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-01-26T05:34:00Z","receivedAt":"2007-01-26T05:34:00Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Thu, Jan 25, 2007 at 09:24:42PM -0800, Junio C Hamano wrote:\n> \"J. Bruce Fields\" <bfields@fieldses.org> writes:\n> \n> > Any idea why this is happening?:\n> >\n> > bfields@pickle:git$ git fetch linux-nfs\n> > Password:\n> > /usr/local/bin/git-parse-remote: line 145: test: !=: unary operator\n> > expected\n> \n> Ouch.\n> \n> I wonder what should happen when you do not have anything\n> defined for \"linus-nfs\" shorthand.\n\nOops; I didn't notice that!\n\n> Should it fetch HEAD?\n\nIn my case I'd want it to either default to what I actually wanted\n(+refs/heads/*:refs/remotes/linux-nfs/*), or just fail with something\nhelpful:\n\n\t\"Nothing to fetch\"?\n\t\"No refspec given, and no default fetch configured for linux-nfs\"?\n\t\"What do you want me to fetch?\"?\n\nI don't know.\n\n> \n> diff --git a/git-parse-remote.sh b/git-parse-remote.sh\n> index 1122c83..12023d2 100755\n> --- a/git-parse-remote.sh\n> +++ b/git-parse-remote.sh\n> @@ -82,6 +82,7 @@ get_remote_default_refs_for_push () {\n>  # a merge candidate\n>  expand_refs_wildcard () {\n>  \tfirst_one=yes\n> +\ttest \"$#\" = 0 && echo empty\n>  \tfor ref\n>  \tdo\n>  \t\tlref=${ref#'+'}\n> \n\nYep, now it does nothing much more quietly....\n\n--b.\n"},{"id":"32685","messageId":"7vejpi2u91.fsf@assigned-by-dhcp.cox.net","threadId":"6538","inReplyTo":"20070126053400.GB18058@fieldses.org","subject":"Re: git fetch over ssh trouble","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-26T06:10:34Z","receivedAt":"2007-01-26T06:10:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"J. Bruce Fields\" <bfields@fieldses.org> writes:\n\n>> I wonder what should happen when you do not have anything\n>> defined for \"linus-nfs\" shorthand.\n>\n> Oops; I didn't notice that!\n>\n>> Should it fetch HEAD?\n>\n> In my case I'd want it to either default to what I actually wanted\n> (+refs/heads/*:refs/remotes/linux-nfs/*), or just fail with something\n> helpful:\n>\n> \t\"Nothing to fetch\"?\n> \t\"No refspec given, and no default fetch configured for linux-nfs\"?\n> \t\"What do you want me to fetch?\"?\n>\n> I don't know.\n\nSaying \"let's grab everything\" is certainly tempting, but I\nthink it is a bit too much.  How about doing this instead, then?\n\n-- >8 --\n[PATCH] parse-remote: do not barf on a remote shorthand without any refs to fetch.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 1122c83..7e87f2e 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -81,7 +81,14 @@ get_remote_default_refs_for_push () {\n # is to help prevent randomly \"globbed\" ref from being chosen as\n # a merge candidate\n expand_refs_wildcard () {\n+\tremote=\"$1\"\n+\tshift\n \tfirst_one=yes\n+\tif test \"$#\" = 0\n+\tthen\n+\t\techo empty\n+\t\techo >&2 \"Nothing specified for fetching with remote.$remote.fetch\"\n+\tfi\n \tfor ref\n \tdo\n \t\tlref=${ref#'+'}\n@@ -132,7 +139,7 @@ canon_refs_list_for_fetch () {\n \tif test \"$1\" = \"-d\"\n \tthen\n \t\tshift ; remote=\"$1\" ; shift\n-\t\tset $(expand_refs_wildcard \"$@\")\n+\t\tset $(expand_refs_wildcard \"$remote\" \"$@\")\n \t\tis_explicit=\"$1\"\n \t\tshift\n \t\tif test \"$remote\" = \"$(get_default_remote)\"\n"},{"id":"32740","messageId":"20070126142356.GA1947@fieldses.org","threadId":"6538","inReplyTo":"7vejpi2u91.fsf@assigned-by-dhcp.cox.net","subject":"Re: git fetch over ssh trouble","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-01-26T14:23:56Z","receivedAt":"2007-01-26T14:23:56Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Thu, Jan 25, 2007 at 10:10:34PM -0800, Junio C Hamano wrote:\n> \"J. Bruce Fields\" <bfields@fieldses.org> writes:\n> \n> >> I wonder what should happen when you do not have anything\n> >> defined for \"linus-nfs\" shorthand.\n> >\n> > Oops; I didn't notice that!\n> >\n> >> Should it fetch HEAD?\n> >\n> > In my case I'd want it to either default to what I actually wanted\n> > (+refs/heads/*:refs/remotes/linux-nfs/*), or just fail with something\n> > helpful:\n> >\n> > \t\"Nothing to fetch\"?\n> > \t\"No refspec given, and no default fetch configured for linux-nfs\"?\n> > \t\"What do you want me to fetch?\"?\n> >\n> > I don't know.\n> \n> Saying \"let's grab everything\" is certainly tempting, but I\n> think it is a bit too much.\n\nYeah.\n\n> How about doing this instead, then?\n\nWorks for me, thanks!\n\nbfields@pickle:git$ git fetch linux-nfs\nPassword:\nNothing specified for fetching with remote.linux-nfs.fetch\nPassword:\n\nOh, OK, the password requests are a little excessive.  I should go\ngenerate an ssh key.\n\n--b.\n"}]}