{"thread":{"id":"7616","subject":"[PATCH] git-clone: Error meaningfully on failed HTTP fetches of HEAD","startedAt":"2007-04-11T22:05:19Z","lastAt":"2007-04-12T00:38:11Z","messageCount":4,"participants":["Martin Langhoff","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"39144","messageId":"11763291192402-git-send-email-martin@catalyst.net.nz","threadId":"7616","inReplyTo":null,"subject":"[PATCH] git-clone: Error meaningfully on failed HTTP fetches of HEAD","fromName":"Martin Langhoff","fromEmail":"martin@catalyst.net.nz","sentAt":"2007-04-11T22:05:19Z","receivedAt":"2007-04-11T22:05:19Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"A common problem when cloning over http is that the repo has\na symlink for HEAD, and apache refuses to serve symlinks by\ndefault.\n\nWithout this patch, the clone succeeds as a \"bare\" and \"HEADless\"\nclone, but does not give any indication that things have gone\nwrong.\n\nA bare clone that fails to fetch HEAD will still complete\n\"successfully\". I'm not sure if that's expected/desired. Is a\nHEADless repo valid in any situation?\n\nSigned-off-by: Martin Langhoff <martin@catalyst.net.nz>\n---\n git-clone.sh |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex 513b574..ef8cd26 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -65,6 +65,11 @@ Perhaps git-update-server-info needs to be run there?\"\n \trm -fr \"$clone_tmp\"\n \thttp_fetch \"$1/HEAD\" \"$GIT_DIR/REMOTE_HEAD\" ||\n \trm -f \"$GIT_DIR/REMOTE_HEAD\"\n+\n+\tif test -z \"$bare\" && test ! -f \"$GIT_DIR/REMOTE_HEAD\"\n+\tthen\n+\t\tdie \"Could not retrieve $1/HEAD - perhaps it is a symlink?\"\n+\tfi\n }\n \n quiet=\n-- \n1.5.1.106.ga32037\n"},{"id":"39168","messageId":"7vwt0imoc3.fsf@assigned-by-dhcp.cox.net","threadId":"7616","inReplyTo":"11763291192402-git-send-email-martin@catalyst.net.nz","subject":"Re: [PATCH] git-clone: Error meaningfully on failed HTTP fetches of HEAD","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-04-12T00:24:44Z","receivedAt":"2007-04-12T00:24:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Langhoff <martin@catalyst.net.nz> writes:\n\n> A common problem when cloning over http is that the repo has\n> a symlink for HEAD, and apache refuses to serve symlinks by\n> default.\n>\n> Without this patch, the clone succeeds as a \"bare\" and \"HEADless\"\n> clone, but does not give any indication that things have gone\n> wrong.\n>\n> A bare clone that fails to fetch HEAD will still complete\n> \"successfully\". I'm not sure if that's expected/desired. Is a\n> HEADless repo valid in any situation?\n\nYou would get \"fatal: Not a git repository\".  Why not default to\n'master' (if found) and issue a warning?\n"},{"id":"39169","messageId":"461D7D36.4000407@catalyst.net.nz","threadId":"7616","inReplyTo":"7vwt0imoc3.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-clone: Error meaningfully on failed HTTP fetches of HEAD","fromName":"Martin Langhoff","fromEmail":"martin@catalyst.net.nz","sentAt":"2007-04-12T00:28:38Z","receivedAt":"2007-04-12T00:28:38Z","isPatch":true,"sender":{"key":"martin@laptop.org","avatar":null},"body":"Junio C Hamano wrote:\n>> A bare clone that fails to fetch HEAD will still complete\n>> \"successfully\". I'm not sure if that's expected/desired. Is a\n>> HEADless repo valid in any situation?\n> \n> You would get \"fatal: Not a git repository\".  Why not default to\n> 'master' (if found) and issue a warning?\n\nAnd if not found die() for real...? Ok. I'll rework and resend.\n\ncheers,\n\n\n\nm\n-- \n-----------------------------------------------------------------------\nMartin @ Catalyst .Net .NZ  Ltd, PO Box 11-053, Manners St,  Wellington\nWEB: http://catalyst.net.nz/           PHYS: Level 2, 150-154 Willis St\nOFFICE: +64(4)916-7224  UK: 0845 868 5733 ext 7224  MOB: +64(21)364-017\n      Make things as simple as possible, but no simpler - Einstein\n-----------------------------------------------------------------------\n"},{"id":"39173","messageId":"7vk5wimnpo.fsf@assigned-by-dhcp.cox.net","threadId":"7616","inReplyTo":"461D7D36.4000407@catalyst.net.nz","subject":"Re: [PATCH] git-clone: Error meaningfully on failed HTTP fetches of HEAD","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-04-12T00:38:11Z","receivedAt":"2007-04-12T00:38:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Langhoff <martin@catalyst.net.nz> writes:\n\n> Junio C Hamano wrote:\n>>> A bare clone that fails to fetch HEAD will still complete\n>>> \"successfully\". I'm not sure if that's expected/desired. Is a\n>>> HEADless repo valid in any situation?\n>> \n>> You would get \"fatal: Not a git repository\".  Why not default to\n>> 'master' (if found) and issue a warning?\n>\n> And if not found die() for real...? Ok. I'll rework and resend.\n\nYeah, after making sure we have 'master' there, though ;-).\n"}]}