{"thread":{"id":"1611","subject":"suggestion: store the URL somewhere in .git/","startedAt":"2005-08-22T20:08:40Z","lastAt":"2005-08-23T05:16:36Z","messageCount":4,"participants":["Jeff Carr","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7620","messageId":"430A30C8.3080908@linuxmachines.com","threadId":"1611","inReplyTo":null,"subject":"suggestion: store the URL somewhere in .git/","fromName":"Jeff Carr","fromEmail":"jcarr@linuxmachines.com","sentAt":"2005-08-22T20:08:40Z","receivedAt":"2005-08-22T20:08:40Z","isPatch":false,"sender":{"key":"jcarr@linuxmachines.com","avatar":null},"body":"It would be nice if the URL could be stored somewhere in .git/ This\nmakes it a lot easier to update repositories because you don't always\nhave to go and track down where you got it in the first place. Something\nlike this perhaps:\n\n~$ cat .git/location\nrsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/\n~$ git-pull-script\n\nThen something like below could be added to handle that easy enough.\n\nJeff\n\n\n--- git-pull-script.orig\t2005-07-31 22:23:50.000000000 -0700\n+++ git-pull-script\t2005-08-22 13:01:22.000000000 -0700\n@@ -4,13 +4,24 @@\n # cogito.]\n #\n\n+LOCATION=\"$@\"\n+\n+if [ ! $LOCATION ]\n+then\n+\tif [ -f .git/location ]\n+\tthen\n+\t\tLOCATION=`cat .git/location`\n+\tfi\n+fi\n+\n . git-sh-setup-script || die \"Not a git archive\"\n-. git-parse-remote \"$@\"\n+. git-parse-remote \"$LOCATION\"\n merge_name=\"$_remote_name\"\n\n-git-fetch-script \"$@\" || exit 1\n+git-fetch-script \"$LOCATION\" || exit 1\n\n git-resolve-script \\\n \t\"$(cat \"$GIT_DIR\"/HEAD)\" \\\n \t\"$(cat \"$GIT_DIR\"/FETCH_HEAD)\" \\\n \t\"Merge $merge_name\"\n+\n"},{"id":"7621","messageId":"Pine.LNX.4.63.0508222217310.695@wgmdd8.biozentrum.uni-wuerzburg.de","threadId":"1611","inReplyTo":"430A30C8.3080908@linuxmachines.com","subject":"Re: suggestion: store the URL somewhere in .git/","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-08-22T20:18:06Z","receivedAt":"2005-08-22T20:18:06Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 22 Aug 2005, Jeff Carr wrote:\n\n> It would be nice if the URL could be stored somewhere in .git/ This\n> makes it a lot easier to update repositories because you don't always\n> have to go and track down where you got it in the first place.\n\nThis is why your original target (when you clone) is stored as \"origin\".\n\nHth,\nDscho\n"},{"id":"7637","messageId":"430A7FE6.4010801@linuxmachines.com","threadId":"1611","inReplyTo":"Pine.LNX.4.63.0508222217310.695@wgmdd8.biozentrum.uni-wuerzburg.de","subject":"Re: suggestion: store the URL somewhere in .git/","fromName":"Jeff Carr","fromEmail":"jcarr@linuxmachines.com","sentAt":"2005-08-23T01:46:14Z","receivedAt":"2005-08-23T01:46:14Z","isPatch":false,"sender":{"key":"jcarr@linuxmachines.com","avatar":null},"body":"On 08/22/2005 01:18 PM, Johannes Schindelin wrote:\n> Hi,\n> \n> On Mon, 22 Aug 2005, Jeff Carr wrote:\n> \n> \n>>It would be nice if the URL could be stored somewhere in .git/ This\n>>makes it a lot easier to update repositories because you don't always\n>>have to go and track down where you got it in the first place.\n> \n> \n> This is why your original target (when you clone) is stored as \"origin\".\n\nOK. I rsync'ed the repository directly so a origin file wasn't created.\nThat explains that. So my small \"feature\" request reduces to adding\nsomething like this to git-pull-script. Thanks, Jeff\n\n\ndiff --git a/git-pull-script b/git-pull-script\n--- a/git-pull-script\n+++ b/git-pull-script\n@@ -1,10 +1,20 @@\n #!/bin/sh\n #\n+ORIGIN=\"$@\"\n+\n+if [ ! $ORIGIN ]\n+then\n+\tif [ -f .git/branches/origin ]\n+\tthen\n+\t\tORIGIN=`cat .git/branches/origin`\n+\tfi\n+fi\n+\n . git-sh-setup-script || die \"Not a git archive\"\n-. git-parse-remote \"$@\"\n+. git-parse-remote \"$ORIGIN\"\n merge_name=\"$_remote_name\"\n\n-git-fetch-script \"$@\" || exit 1\n+git-fetch-script \"$ORIGIN\" || exit 1\n\n git-resolve-script \\\n \t\"$(cat \"$GIT_DIR\"/HEAD)\" \\\n"},{"id":"7640","messageId":"7vslx1xmff.fsf@assigned-by-dhcp.cox.net","threadId":"1611","inReplyTo":"430A7FE6.4010801@linuxmachines.com","subject":"Re: suggestion: store the URL somewhere in .git/","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-23T05:16:36Z","receivedAt":"2005-08-23T05:16:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff Carr <jcarr@linuxmachines.com> writes:\n\n> So my small \"feature\" request reduces to adding\n> something like this to git-pull-script. Thanks, Jeff\n\nSomebody else earlier asked for fetch and pull to default to\n\"origin\" URL, and the necessary change is already in the\nproposed updates branch.\n"}]}