{"thread":{"id":"43085","subject":"Re: [PATCH] Use new .git/config for storing \"origin\" shortcut repository","startedAt":"2006-11-26T00:03:30Z","lastAt":"2006-11-26T13:45:15Z","messageCount":6,"participants":["Andy Parkins","Johannes Schindelin","Shawn Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"297539","messageId":"200611260003.31025.andyparkins@gmail.com","threadId":"43085","inReplyTo":"ekafpm@sea.gmane.org","subject":"[PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-11-26T00:03:30Z","receivedAt":"2006-11-26T00:03:30Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"If .git/remotes/ is now deprecated, then git-clone shouldn't use it.\nThis patch adds the analogous definitions to .git/config using\ngit-repo-config calls.\n\nFor example what was previously .git/remotes/origin\n  URL: proto://host/path\n  Pull: refs/heads/master:refs/heads/origin\nIs now added to .git/config as\n  [remote \"origin\"]\n  url = proto://host/path\n  fetch = refs/heads/master:refs/heads/origin\n\nSigned-off-by: Andy Parkins <andyparkins@gmail.com>\n---\nI'm not sure if I'm correct in thinking that .git/remotes is deprecated.  If it is,\nthis patch makes git-clone use .git/config instead.\n\nPersonally I like it, I think there should be as small a number of places for \nconfiguring the repository as possible.\n\n\n git-clone.sh |    9 ++++-----\n 1 files changed, 4 insertions(+), 5 deletions(-)\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex 9ed4135..1057a26 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -373,9 +373,8 @@ then\n \t\t*)\torigin_track=\"$remote_top/$origin\"\n \t\t\tgit-update-ref \"refs/heads/$origin\" \"$head_sha1\" ;;\n \t\tesac &&\n-\t\techo >\"$GIT_DIR/remotes/$origin\" \\\n-\t\t\"URL: $repo\n-Pull: refs/heads/$head_points_at:$origin_track\" &&\n+\t\tgit-repo-config remote.\"$origin\".url \"$repo\" &&\n+\t\tgit-repo-config remote.\"$origin\".fetch \"refs/heads/$head_points_at:$origin_track\" &&\n \t\t(cd \"$GIT_DIR/$remote_top\" && find . -type f -print) |\n \t\twhile read dotslref\n \t\tdo\n@@ -389,8 +388,8 @@ Pull: refs/heads/$head_points_at:$origin_track\" &&\n \t\t\tthen\n \t\t\t\tcontinue\n \t\t\tfi\n-\t\t\techo \"Pull: refs/heads/${name}:$remote_top/${name}\"\n-\t\tdone >>\"$GIT_DIR/remotes/$origin\" &&\n+\t\t\tgit-repo-config remote.\"$origin\".fetch \"refs/heads/${name}:$remote_top/${name}\"\n+\t\tdone &&\n \t\tcase \"$use_separate_remote\" in\n \t\tt)\n \t\t\trm -f \"refs/remotes/$origin/HEAD\"\n-- \n1.4.4.1.gb38c-dirty\n"},{"id":"294465","messageId":"Pine.LNX.4.63.0611260141390.30004@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43085","inReplyTo":"200611260003.31025.andyparkins@gmail.com","subject":"Re: [PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-26T00:48:11Z","receivedAt":"2006-11-26T00:48:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 26 Nov 2006, Andy Parkins wrote:\n\n> -\t\t\techo \"Pull: refs/heads/${name}:$remote_top/${name}\"\n> -\t\tdone >>\"$GIT_DIR/remotes/$origin\" &&\n> +\t\t\tgit-repo-config remote.\"$origin\".fetch \"refs/heads/${name}:$remote_top/${name}\"\n> +\t\tdone &&\n\nThis hunk is wrong: \"git-repo-config remote.bla.fetch b\" will _overwrite_ \nremoter.bla.fetch. To avoid that, you have to use \"git repo-config \nremote.bla.fetch b ^$\". (The last argument is a regular expression which \nhas to be matched by the value-to-be-oreplaced.)\n\nCiao,\nDscho\n"},{"id":"295585","messageId":"20061126030209.GA29394@spearce.org","threadId":"43085","inReplyTo":"200611260003.31025.andyparkins@gmail.com","subject":"Re: [PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-26T03:02:09Z","receivedAt":"2006-11-26T03:02:09Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Andy Parkins <andyparkins@gmail.com> wrote:\n> If .git/remotes/ is now deprecated, then git-clone shouldn't use it.\n> This patch adds the analogous definitions to .git/config using\n> git-repo-config calls.\n> \n> For example what was previously .git/remotes/origin\n>   URL: proto://host/path\n>   Pull: refs/heads/master:refs/heads/origin\n> Is now added to .git/config as\n>   [remote \"origin\"]\n>   url = proto://host/path\n>   fetch = refs/heads/master:refs/heads/origin\n> \n> Signed-off-by: Andy Parkins <andyparkins@gmail.com>\n> ---\n> I'm not sure if I'm correct in thinking that .git/remotes is deprecated.  If it is,\n> this patch makes git-clone use .git/config instead.\n> \n> Personally I like it, I think there should be as small a number of places for \n> configuring the repository as possible.\n\nI agree.  There's all sorts of advantages to setting up remotes by\nthe config file.  Its also easier to load and work with in git-gui.\n:-)\n\nI've switched to the config file syntax completely, and a few folks\nI work with have done the same, citing that it is easier to have\neverything in one file.\n\n-- \n"},{"id":"296324","messageId":"7vzmaeyie6.fsf@assigned-by-dhcp.cox.net","threadId":"43085","inReplyTo":"Pine.LNX.4.63.0611260141390.30004@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-26T03:52:01Z","receivedAt":"2006-11-26T03:52:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> This hunk is wrong: \"git-repo-config remote.bla.fetch b\" will _overwrite_ \n> remoter.bla.fetch. To avoid that, you have to use \"git repo-config \n> remote.bla.fetch b ^$\". (The last argument is a regular expression which \n> has to be matched by the value-to-be-oreplaced.)\n\nYup, one of the joys of working the config file everybody seems\nto like ;-).\n"},{"id":"293826","messageId":"200611260856.03057.andyparkins@gmail.com","threadId":"43085","inReplyTo":"Pine.LNX.4.63.0611260141390.30004@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-11-26T08:56:01Z","receivedAt":"2006-11-26T08:56:01Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Sunday 2006, November 26 00:48, Johannes Schindelin wrote:\n\n> This hunk is wrong: \"git-repo-config remote.bla.fetch b\" will _overwrite_\n> remoter.bla.fetch. To avoid that, you have to use \"git repo-config\n> remote.bla.fetch b ^$\". (The last argument is a regular expression which\n> has to be matched by the value-to-be-oreplaced.)\n\nThis is in git-clone; the config is empty.  What is there to overwrite?\n\nI'll fix it anyway.\n\n\nAndy\n\n-- \nDr Andrew Parkins, M Eng (Hons), AMIEE\n"},{"id":"297133","messageId":"Pine.LNX.4.63.0611261437270.30004@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43085","inReplyTo":"7vzmaeyie6.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-26T13:45:15Z","receivedAt":"2006-11-26T13:45:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 25 Nov 2006, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > This hunk is wrong: \"git-repo-config remote.bla.fetch b\" will _overwrite_ \n> > remoter.bla.fetch. To avoid that, you have to use \"git repo-config \n> > remote.bla.fetch b ^$\". (The last argument is a regular expression which \n> > has to be matched by the value-to-be-oreplaced.)\n> \n> Yup, one of the joys of working the config file everybody seems to like \n> ;-).\n\nThe problem is: config files are ubiquitous, so you need not teach \nusers about it. On the other hand, they are just key / value stores, i.e. \nreflecting a mapping. What we want here, is a multimapping, so we use the \nwrong tool.\n\nBut sometimes it is so much more pragmatic to just take off one shoe and \nput the darned nail back into the wall than to go to the shop, buy the \nhammer, go back, put the nail in, and try to sell the hammer via eBay.\n\nBTW regarding your criticism of the config file: I agree that the write \nsupport of git-repo-config was quite brittle at the start. Which is my \nfault.\n\nHowever, we had quite some flashing out bugs in the mean time, so I am \nquite confident in the tool. Of course, what with the recent addition of a \nuser specific config file (which makes the name \"repo-config\" seem utterly \nwrong), there might be some dragons in the code.\n\nSo, it seems that the whole config writing code is a perfect opportunity \nfor people wanting to audit source code!\n\nCiao,\nDscho\n\n"}]}