Re: git fetch over ssh trouble

Subsystems: the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: git fetch over ssh trouble

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:51

"J. Bruce Fields" [off-list ref] writes:
Any idea why this is happening?:

bfields@pickle:git$ git fetch linux-nfs
Password:
/usr/local/bin/git-parse-remote: line 145: test: !=: unary operator
expected
Ouch.

I wonder what should happen when you do not have anything
defined for "linus-nfs" shorthand.  Should it fetch HEAD?
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 1122c83..12023d2 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -82,6 +82,7 @@ get_remote_default_refs_for_push () {
 # a merge candidate
 expand_refs_wildcard () {
 	first_one=yes
+	test "$#" = 0 && echo empty
 	for ref
 	do
 		lref=${ref#'+'}

Re: git fetch over ssh trouble

From: J. Bruce Fields <hidden>
Date: 2016-06-15 22:42:51

On Thu, Jan 25, 2007 at 09:24:42PM -0800, Junio C Hamano wrote:
"J. Bruce Fields" [off-list ref] writes:
quoted
Any idea why this is happening?:

bfields@pickle:git$ git fetch linux-nfs
Password:
/usr/local/bin/git-parse-remote: line 145: test: !=: unary operator
expected
Ouch.

I wonder what should happen when you do not have anything
defined for "linus-nfs" shorthand.
Oops; I didn't notice that!
Should it fetch HEAD?
In my case I'd want it to either default to what I actually wanted
(+refs/heads/*:refs/remotes/linux-nfs/*), or just fail with something
helpful:

	"Nothing to fetch"?
	"No refspec given, and no default fetch configured for linux-nfs"?
	"What do you want me to fetch?"?

I don't know.
quoted hunk
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 1122c83..12023d2 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -82,6 +82,7 @@ get_remote_default_refs_for_push () {
 # a merge candidate
 expand_refs_wildcard () {
 	first_one=yes
+	test "$#" = 0 && echo empty
 	for ref
 	do
 		lref=${ref#'+'}
Yep, now it does nothing much more quietly....

--b.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help