threads / discuss / 9592

Suprising error message from "git clone"

Subject: Suprising error message from "git clone"

## tl;dr

4 messages between Aug 20, 2007 and Aug 20, 2007.

replies: 3people: 2as markdown or json

Matthieu Moy· Aug 20, 2007, 14:45 UTC · lore
Hi,
I got a suprising error message:
$ cd /tmp/
$ git clone ~/some/repository
Initialized empty Git repository in /tmp/repository/.git/
Warning: -l asked but cannot hardlink to /home/moy/some/repository/.git
114 blocks
$ 

I understand that git found the path to be local, and tried to hardlink, but it shouldn't say "-l asked", since I didn't ask for it.

Either the message should be changed to stg like "Warning: cannot hardlink to %s" or it should just be skipped if -l was not actually provided.

-- 
Matthieu
Junio C Hamano· Aug 20, 2007, 20:40 UTC · re: Matthieu Moy · lore

Re: Suprising error message from "git clone"

Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 6 quoted lines
> I got a suprising error message:
>
> $ cd /tmp/
> $ git clone ~/some/repository
> Initialized empty Git repository in /tmp/repository/.git/
> Warning: -l asked but cannot hardlink to /home/moy/some/repository/.git

Yup, we already discussed when we switched to defaulting to -l, but nobody cared enough to get around to patch the warning.

Untested but something like this should suffice...
By the way, could you possibly drop Mail-Followup-To: please?
 git-clone.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index e4a9ac4..18003ab 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -99,6 +99,7 @@ origin_override=
 use_separate_remote=t
 depth=
 no_progress=
+local_explicitly_asked_for=
 test -t 1 || no_progress=--no-progress
 while
 	case "$#,$1" in
@@ -109,6 +110,7 @@ while
 	*,--na|*,--nak|*,--nake|*,--naked|\
 	*,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
 	*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local)
+	  local_explicitly_asked_for=yes
 	  use_local_hardlink=yes ;;
 	*,--no-h|*,--no-ha|*,--no-har|*,--no-hard|*,--no-hardl|\
 	*,--no-hardli|*,--no-hardlin|*,--no-hardlink|*,--no-hardlinks)
@@ -281,7 +283,8 @@ yes)
 			then
 				rm -f "$GIT_DIR/objects/sample"
 				l=l
-			else
+			elif test -n "$local_explicitly_asked_for"
+			then
 				echo >&2 "Warning: -l asked but cannot hardlink to $repo"
 			fi
 		fi &&
Matthieu Moy· Aug 20, 2007, 21:13 UTC · re: Junio C Hamano · lore

Re: Suprising error message from "git clone"

Junio C Hamano <gitster@pobox.com> writes:
> Untested but something like this should suffice...
Jest tested, it works fine.
> By the way, could you possibly drop Mail-Followup-To: please?

Err, what's the problem with it? I don't wish to receive duplicate, and I ask your mailer not to do so. I don't care too much if the header is not honnored, but what you have to do is just to followup without bothering about it.

Show 35 quoted lines
>  git-clone.sh |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/git-clone.sh b/git-clone.sh
> index e4a9ac4..18003ab 100755
> --- a/git-clone.sh
> +++ b/git-clone.sh
> @@ -99,6 +99,7 @@ origin_override=
>  use_separate_remote=t
>  depth=
>  no_progress=
> +local_explicitly_asked_for=
>  test -t 1 || no_progress=--no-progress
>  while
>  	case "$#,$1" in
> @@ -109,6 +110,7 @@ while
>  	*,--na|*,--nak|*,--nake|*,--naked|\
>  	*,-b|*,--b|*,--ba|*,--bar|*,--bare) bare=yes ;;
>  	*,-l|*,--l|*,--lo|*,--loc|*,--loca|*,--local)
> +	  local_explicitly_asked_for=yes
>  	  use_local_hardlink=yes ;;
>  	*,--no-h|*,--no-ha|*,--no-har|*,--no-hard|*,--no-hardl|\
>  	*,--no-hardli|*,--no-hardlin|*,--no-hardlink|*,--no-hardlinks)
> @@ -281,7 +283,8 @@ yes)
>  			then
>  				rm -f "$GIT_DIR/objects/sample"
>  				l=l
> -			else
> +			elif test -n "$local_explicitly_asked_for"
> +			then
>  				echo >&2 "Warning: -l asked but cannot hardlink to $repo"
>  			fi
>  		fi &&
>
>
-- 
Matthieu
Junio C Hamano· Aug 20, 2007, 21:25 UTC · re: Matthieu Moy · lore

Re: Suprising error message from "git clone"

Matthieu Moy <Matthieu.Moy@imag.fr> writes:
Show 5 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Untested but something like this should suffice...
>
> Jest tested, it works fine.
Thanks.
Show 6 quoted lines
>> By the way, could you possibly drop Mail-Followup-To: please?
>
> Err, what's the problem with it? I don't wish to receive duplicate,
> and I ask your mailer not to do so. I don't care too much if the
> header is not honnored, but what you have to do is just to followup
> without bothering about it.
For example, your response had this:
    Mail-Followup-To: Junio C Hamano <gitster@pobox.com>,
	    git <git@vger.kernel.org>

Suppose somebody else who read your message on the git list has something to say to _YOU_. Maybe he is pointing out some of the problems in _your_ thinking. He may not mind me hearing what he tells you, but he is primarily talking to you.

Although in practice I tend to pay attention to whatever is said on the git mailing list, I certainly do not want _my_ address on the To: header of such a response. He wants to talk to _you_, not me, and I process mails addressed "To: " me, and then only when I have enough time to do so move on to other messages.

You either (1) stole time from me by forcing his message addressed "To: " me, or (2) if the person who responded to your message were kind and careful enough to "fix" the header so that the message is addressed to you and demoting me to the Cc: list, then you stole time from him.

With (1) you are being rude against me, and with (2) you are being rude against whoever responds to you.

Please don't.

Filtering duplicates on the receiving end in your mailbox should not be too much of a hassle, either.

← back to recent threads