{"thread":{"id":"1961","subject":"[PATCH] Fix git-pull output message","startedAt":"2005-09-28T10:02:38Z","lastAt":"2005-09-29T08:48:56Z","messageCount":4,"participants":["Robert Watson","Junio C Hamano","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"9417","messageId":"72499e3b05092803027175bab0@mail.gmail.com","threadId":"1961","inReplyTo":null,"subject":"[PATCH] Fix git-pull output message","fromName":"Robert Watson","fromEmail":"robert.oo.watson@gmail.com","sentAt":"2005-09-28T10:02:38Z","receivedAt":"2005-09-28T10:02:38Z","isPatch":true,"sender":{"key":"robert.oo.watson@gmail.com","avatar":null},"body":"(git)$ git-pull\nFetching refs/heads/master from\nhttp://www.kernel.org/pub/scm/git/git.git using http\n* committish: 3cc35e29ec252d0dca1139106fbaa70cb9ad6ef1\n  branch 'master' of http://www.kernel.org/pub/scm/git/git\n* refs/heads/origin: same as branch 'master' of\nhttp://www.kernel.org/pub/scm/git/git\nAlready up-to-date. Yeeah!\n\nNotice that the git.git directory is truncated.  It seems the\nintension is to truncate at the .git\ndirectory level.  The following patch fixes it.\n\ndiff --git a/git-fetch.sh b/git-fetch.sh\n--- a/git-fetch.sh\n+++ b/git-fetch.sh\n@@ -70,7 +70,7 @@ append_fetch_head () {\n     *)\n        note_=\"$remote_name of \" ;;\n     esac\n-    remote_1_=$(expr \"$remote_\" : '\\(.*\\)\\.git/*$') &&\n+    remote_1_=$(expr \"$remote_\" : '\\(.*/\\)\\.git/*$') &&\n        remote_=\"$remote_1_\"\n     note_=\"$note_$remote_\"\n"},{"id":"9418","messageId":"7v64slxxri.fsf@assigned-by-dhcp.cox.net","threadId":"1961","inReplyTo":"72499e3b05092803027175bab0@mail.gmail.com","subject":"Re: [PATCH] Fix git-pull output message","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-28T11:00:33Z","receivedAt":"2005-09-28T11:00:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Robert Watson <robert.oo.watson@gmail.com> writes:\n\n> Notice that the git.git directory is truncated.  It seems the\n> intension is to truncate at the .git directory level.\n\nc5434dead6a52a48c520dfa3d8ed24dc3673ab1a commit introduced this\nbehaviour, and we kept it ever since.\n\nIt may look a bit weird when it is applied to git.git/, but the\nintention is to shorten the log message without losing much\ninformation.  \".../torvalds/linux-2.6.git\" is similarly\nshortened to \".../torvalds/linux-2.6\".\n\nYou can see 'git log' output in the kernel repository and look\nfor commit log messages of merge commits, and notice all those\nrepository names with trailing \".git\" stripped.\n"},{"id":"9426","messageId":"Pine.LNX.4.58.0509280823260.3308@g5.osdl.org","threadId":"1961","inReplyTo":"72499e3b05092803027175bab0@mail.gmail.com","subject":"Re: [PATCH] Fix git-pull output message","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-09-28T15:29:46Z","receivedAt":"2005-09-28T15:29:46Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 28 Sep 2005, Robert Watson wrote:\n> \n> Notice that the git.git directory is truncated.  It seems the\n> intension is to truncate at the .git\n> directory level.  The following patch fixes it.\n\nNo, the intention really is to remove the \".git\" at the end. At least \nthat's how I use it.\n\nI like seeing my merges say\n\n    Merge branch 'for-linus' from master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband\n\neven though the _real_ directory was \".../infiniband.git/\", simply because \nthe \".git\" doesn't really add any extra information when you're already in \ngit.\n\n_outside_ of git, the \".git\" tells you something: it tells you that you're \nentering a git archive. But when merging in git, that part is kind of \ntaken for granted, isn't it?\n\nThis also matches what \"git-receive-pack\" and \"git-upload-pack\" does:\n\n\t...\n        /* chdir to the directory. If that fails, try appending \".git\" */\n        if (chdir(dir) < 0) {\n                if (chdir(mkpath(\"%s.git\", dir)) < 0)\n                        die(\"unable to cd to %s\", dir);\n        }\n\n        /* If we have a \".git\" directory, chdir to it */\n        chdir(\".git\");\n\t...\n\nNote how it _both_ will append \".git\" to the directory name (if it can't \nfind one without \".git\" _and_ will try to chdir to a \".git\" directory \n_within_ the directory name.\n\nSo if you use the native pack ssh interfaces, you really can say\n\n\tgit pull master.kernel.org:.../infiniband\n\nbecause the tools (well, the \"native pack\" ones - not the http/rsync/scp\nones) will automatically DTRT.\n\n\t\tLinus\n"},{"id":"9471","messageId":"72499e3b05092901484731450a@mail.gmail.com","threadId":"1961","inReplyTo":"Pine.LNX.4.58.0509280823260.3308@g5.osdl.org","subject":"Re: [PATCH] Fix git-pull output message","fromName":"Robert Watson","fromEmail":"robert.oo.watson@gmail.com","sentAt":"2005-09-29T08:48:56Z","receivedAt":"2005-09-29T08:48:56Z","isPatch":true,"sender":{"key":"robert.oo.watson@gmail.com","avatar":null},"body":"On 9/28/05, Linus Torvalds <torvalds@osdl.org> wrote:\n>\n>\n> On Wed, 28 Sep 2005, Robert Watson wrote:\n> >\n> > Notice that the git.git directory is truncated.  It seems the\n> > intension is to truncate at the .git\n> > directory level.  The following patch fixes it.\n>\n> No, the intention really is to remove the \".git\" at the end. At least\n> that's how I use it.\n>\n> I like seeing my merges say\n>\n>     Merge branch 'for-linus' from master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband\n>\n> even though the _real_ directory was \".../infiniband.git/\", simply because\n> the \".git\" doesn't really add any extra information when you're already in\n> git.\n>\n> _outside_ of git, the \".git\" tells you something: it tells you that you're\n> entering a git archive. But when merging in git, that part is kind of\n> taken for granted, isn't it?\n>\n> This also matches what \"git-receive-pack\" and \"git-upload-pack\" does:\n>\n>         ...\n>         /* chdir to the directory. If that fails, try appending \".git\" */\n>         if (chdir(dir) < 0) {\n>                 if (chdir(mkpath(\"%s.git\", dir)) < 0)\n>                         die(\"unable to cd to %s\", dir);\n>         }\n>\n>         /* If we have a \".git\" directory, chdir to it */\n>         chdir(\".git\");\n>         ...\n>\n> Note how it _both_ will append \".git\" to the directory name (if it can't\n> find one without \".git\" _and_ will try to chdir to a \".git\" directory\n> _within_ the directory name.\n>\n> So if you use the native pack ssh interfaces, you really can say\n>\n>         git pull master.kernel.org:.../infiniband\n>\n> because the tools (well, the \"native pack\" ones - not the http/rsync/scp\n> ones) will automatically DTRT.\n>\n>                 Linus\n>\n\nNow, I understand it.  Thanks Linus and Junio.\n\nRobertoo\n"}]}