{"thread":{"id":"10621","subject":"[PATCH] Add support for # in URLs in git-remote (was: Re: [PATCH] New script: git-changelog.perl - revised)","startedAt":"2007-11-03T15:26:19Z","lastAt":"2007-11-13T23:56:33Z","messageCount":3,"participants":["Ronald Landheer-Cieslak","Johannes Schindelin","Josh Triplett"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"58147","messageId":"67837cd60711030826q6b3b5c00l5b228531ab6a323e@mail.gmail.com","threadId":"10621","inReplyTo":null,"subject":"[PATCH] Add support for # in URLs in git-remote (was: Re: [PATCH] New script: git-changelog.perl - revised)","fromName":"Ronald Landheer-Cieslak","fromEmail":"ronald@landheer-cieslak.com","sentAt":"2007-11-03T15:26:19Z","receivedAt":"2007-11-03T15:26:19Z","isPatch":true,"sender":{"key":"ronald@landheer-cieslak.com","avatar":"https://gravatar.com/avatar/5acb7195551996209b4511ffbbbcf8e13389789352b1a5173e7d6cbee734b53f?d=mp&s=160"},"body":"The attached patch adds support for # signs in URLs passed to git-remote add.\nThe suggestion that, in stead of putting a # in the URL I should set\nup a new public repository with just the topic branch in it triggers a\nreaction of dismay in me: to me, Git is a fast and resource-sparing\nSCM and setting up a second repository just for publishing a branch\nseems more than awkward to me - it's a waste of space and a waste of\n(my) time.\n\nSo I've taken a look at the git-remote code and added a small patch to\nsupport # signs in git-remote add URLs\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\nThis makes git-remote add behave as if whatever comes after the # in\nthe URL was passed as a -t option. Other options are still allowed, so\nwith # in the URL, nothing else changes\n\nHTH\n\nrlc\n\nOn Nov 3, 2007 9:58 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> On Sat, 3 Nov 2007, Ronald Landheer-Cieslak wrote:\n> > On Nov 3, 2007 4:36 AM, Andreas Ericsson <ae@op5.se> wrote:\n> > > Ronald Landheer-Cieslak wrote:\n> > > >\n> > > > This is also available through git at\n> > > > git://vlinder.landheer-cieslak.com/git/git.git#topic/git-log-changelog\n> > > >\n> > >\n> > > This mode of specifying a repository + branch was just thoroughly shot\n> > > down in a list discussion, and git certainly doesn't grok it. I'd be a\n> > > happier fella if you didn't use it.\n> > >\n> > Is there a canonical way to specify both the location and the branch\n> > in one shot, then?\n>\n> Yes.  Create a repository containing only that branch, as \"master\", and\n> point people to that repository.\n\n-- \nRonald Landheer-Cieslak\nSoftware Architect\nhttp://www.landheer-cieslak.com/\nNew White Paper: \"Three Good Reasons to Plan Ahead\"\n\n\ncommit 9aa00ba7096d050bb62e48334a400270afd65735\nAuthor: Ronald Landheer-Cieslak <ronald@landheer-cieslak.com>\nDate:   Sat Nov 3 10:47:00 2007 -0400\n\n    Support # in URLs and interpret them as tracking branches\n\ndiff --git a/git-remote.perl b/git-remote.perl\nindex d13e4c1..6b26523 100755\n--- a/git-remote.perl\n+++ b/git-remote.perl\n@@ -271,7 +271,12 @@ sub show_remote {\n }\n \n sub add_remote {\n-\tmy ($name, $url, $opts) = @_;\n+\tmy ($name, $url_, $opts) = @_;\n+\n+\tmy ($url, $branch) = split(/#/, $url_);\n+\t$opts->{'track'} ||= [];\n+\tpush @{$opts->{'track'}}, $branch if ($branch);\n+\n \tif (exists $remote->{$name}) {\n \t\tprint STDERR \"remote $name already exists.\\n\";\n \t\texit(1);\n"},{"id":"58148","messageId":"Pine.LNX.4.64.0711031526060.4362@racer.site","threadId":"10621","inReplyTo":"67837cd60711030826q6b3b5c00l5b228531ab6a323e@mail.gmail.com","subject":"Re: [PATCH] Add support for # in URLs in git-remote (was: Re: [PATCH] New script: git-changelog.perl - revised)","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-03T15:27:22Z","receivedAt":"2007-11-03T15:27:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 3 Nov 2007, Ronald Landheer-Cieslak wrote:\n\n> The attached patch adds support for # signs in URLs passed to git-remote \n> add.\n\nNACK!\n\nPlease be polite enough to read up on the _many_ emails on this list about \nthis very subject.\n\nNot doing so just _wastes_ our time.\n\nSorry for being so harsh, but this very subject easily cost me 20 hours in \ntotal(!) in the last few weeks.\n\nCiao,\nDscho\n"},{"id":"59779","messageId":"473A39B1.7050709@freedesktop.org","threadId":"10621","inReplyTo":"Pine.LNX.4.64.0711031526060.4362@racer.site","subject":"Re: [PATCH] Add support for # in URLs in git-remote (was: Re: [PATCH] New script: git-changelog.perl - revised)","fromName":"Josh Triplett","fromEmail":"josh@freedesktop.org","sentAt":"2007-11-13T23:56:33Z","receivedAt":"2007-11-13T23:56:33Z","isPatch":true,"sender":{"key":"josh@joshtriplett.org","avatar":"https://avatars.githubusercontent.com/u/162737?v=4"},"body":"Johannes Schindelin wrote:\n> On Sat, 3 Nov 2007, Ronald Landheer-Cieslak wrote:\n>> The attached patch adds support for # signs in URLs passed to git-remote \n>> add.\n> \n> NACK!\n> \n> Please be polite enough to read up on the _many_ emails on this list about \n> this very subject.\n> \n> Not doing so just _wastes_ our time.\n> \n> Sorry for being so harsh, but this very subject easily cost me 20 hours in \n> total(!) in the last few weeks.\n\nPerhaps this should go in the Git FAQ at\nhttp://git.or.cz/gitwiki/GitFaq .  Does your message with Message-ID\n<Pine.LNX.4.64.0710162228560.25221@racer.site>, subject \"Re:\nremote#branch\", accurately describe the full problem with using #,\nnamely that refs can contain #?\n\nAny other problems besides not having the ability to reference more\nthan one branch with this syntax?\n\n- Josh Triplett\n\n"}]}