{"id":30,"date":"2010-03-29T09:37:32","date_gmt":"2010-03-29T13:37:32","guid":{"rendered":"http:\/\/galencharlton.com\/blog\/?p=30"},"modified":"2010-03-29T09:37:32","modified_gmt":"2010-03-29T13:37:32","slug":"git-repo-law-1-save-the-time-of-the-puller","status":"publish","type":"post","link":"https:\/\/galencharlton.com\/blog\/2010\/03\/git-repo-law-1-save-the-time-of-the-puller\/","title":{"rendered":"Git repo law #1: save the time of the puller"},"content":{"rendered":"<p><em>Apologies to Ranganathan.<\/em><\/p>\n<p>Say you have a Git repository you want to publish, and you&#8217;ve set up a <a href=\"https:\/\/git.wiki.kernel.org\/index.php\/Gitweb\">Gitweb<\/a> for it at <code>http:\/\/git.example.com\/?p=myrepo.git;a=summary<\/code>.\u00a0 So far, so good: others can browse your commits and download packages and tarballs.\u00a0 Suppose you&#8217;ve also configured <code><a href=\"http:\/\/www.ru.kernel.org\/pub\/software\/scm\/git\/docs\/git-daemon.html\">git-daemon(1)<\/a><\/code> to publish the repo using the Git protocol.\u00a0 Great!\u00a0 Now suppose you&#8217;ve told the world to go to <code>http:\/\/git.example.com<\/code>.  The world looks at what you have wrought, and then asks: How can we clone your repository?<\/p>\n<p>Even assuming that you&#8217;ve used the default options in your <code>git-daemon<\/code> configuration, the Git clone URL could be any of the following depending on where your OS distribution&#8217;s packagers decided to put things:<\/p>\n<ul>\n<li><code>git:\/\/git.example.com\/myrepo<\/code><\/li>\n<li><code>git:\/\/git.example.com\/myrepo.git<\/code><\/li>\n<li><code>git:\/\/git.example.com\/git\/myrepo<\/code><\/li>\n<li><code>git:\/git.example.com\/git\/myrepo.git<\/code><\/li>\n<li>and there are even more possibilities if you did tweak the config<\/li>\n<\/ul>\n<p>The rub is that Gitweb doesn&#8217;t know and can&#8217;t know until you tell it.\u00a0 If you don&#8217;t tell it, somebody who wants to clone your repo and who is looking at the Gitweb page can only guess.\u00a0 If they guess wrong a few times, they may give up.<\/p>\n<p>Fortunately, the solution is easy: to make the Git clone URL display in your Gitweb, go to the repository&#8217;s base directory and create a new file called <code>cloneurl<\/code> and enter the correct clone URL(s), one per line.  While you&#8217;re at it, make sure that the <code>description<\/code> file is accurate as well.<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-30\" class=\"share-twitter sd-button share-icon\" href=\"https:\/\/galencharlton.com\/blog\/2010\/03\/git-repo-law-1-save-the-time-of-the-puller\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li><a href=\"#\" class=\"sharing-anchor sd-button share-more\"><span>More<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><div class=\"sharing-hidden\"><div class=\"inner\" style=\"display: none;\"><ul><li class=\"share-tumblr\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-tumblr sd-button share-icon\" href=\"https:\/\/galencharlton.com\/blog\/2010\/03\/git-repo-law-1-save-the-time-of-the-puller\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\"><span>Tumblr<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-reddit sd-button share-icon\" href=\"https:\/\/galencharlton.com\/blog\/2010\/03\/git-repo-law-1-save-the-time-of-the-puller\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span>Reddit<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-print\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-print sd-button share-icon\" href=\"https:\/\/galencharlton.com\/blog\/2010\/03\/git-repo-law-1-save-the-time-of-the-puller\/\" target=\"_blank\" title=\"Click to print\"><span>Print<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Apologies to Ranganathan. Say you have a Git repository you want to publish, and you&#8217;ve set up a Gitweb for it at http:\/\/git.example.com\/?p=myrepo.git;a=summary.\u00a0 So far,&#8230;<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-30\" class=\"share-twitter sd-button share-icon\" href=\"https:\/\/galencharlton.com\/blog\/2010\/03\/git-repo-law-1-save-the-time-of-the-puller\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li><a href=\"#\" class=\"sharing-anchor sd-button share-more\"><span>More<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><div class=\"sharing-hidden\"><div class=\"inner\" style=\"display: none;\"><ul><li class=\"share-tumblr\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-tumblr sd-button share-icon\" href=\"https:\/\/galencharlton.com\/blog\/2010\/03\/git-repo-law-1-save-the-time-of-the-puller\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\"><span>Tumblr<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-reddit sd-button share-icon\" href=\"https:\/\/galencharlton.com\/blog\/2010\/03\/git-repo-law-1-save-the-time-of-the-puller\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span>Reddit<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-print\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-print sd-button share-icon\" href=\"https:\/\/galencharlton.com\/blog\/2010\/03\/git-repo-law-1-save-the-time-of-the-puller\/\" target=\"_blank\" title=\"Click to print\"><span>Print<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[4,17],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3gJ9y-u","_links":{"self":[{"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/posts\/30"}],"collection":[{"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":3,"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/posts\/30\/revisions"}],"predecessor-version":[{"id":33,"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/posts\/30\/revisions\/33"}],"wp:attachment":[{"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/media?parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/categories?post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/galencharlton.com\/blog\/wp-json\/wp\/v2\/tags?post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}