{"thread":{"id":"43204","subject":"[PATCH] Use new .git/config for storing \"origin\" shortcut repository","startedAt":"2006-11-26T09:15:58Z","lastAt":"2006-11-26T13:30:59Z","messageCount":5,"participants":["Andy Parkins","Jakub Narebski","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"298545","messageId":"7vvel2va9d.fsf@assigned-by-dhcp.cox.net","threadId":"43204","inReplyTo":"200611260856.03057.andyparkins@gmail.com","subject":"Re: [PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-26T09:15:58Z","receivedAt":"2006-11-26T09:15:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andy Parkins <andyparkins@gmail.com> writes:\n\n> 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>\n> This is in git-clone; the config is empty.  What is there to overwrite?\n\nThe entry you wrote in the previous iteration in the same loop,\nperhaps?\n"},{"id":"294028","messageId":"200611260935.43762.andyparkins@gmail.com","threadId":"43204","inReplyTo":"7vvel2va9d.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-11-26T09:35:43Z","receivedAt":"2006-11-26T09:35:43Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"Rather than use a separate config .git/remotes/ for remote shortcuts, this\npatch adds the analogous definitions to .git/config using git-repo-config\ncalls.\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---\nOops; you're absolutely right.  I'd not realised that it was the add operation\nthat needed the special syntax rather than the replace.\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..19a5a63 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.g9fd7\n"},{"id":"294320","messageId":"ekbnr6$naq$2@sea.gmane.org","threadId":"43204","inReplyTo":"200611260935.43762.andyparkins@gmail.com","subject":"Re: [PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-26T09:49:01Z","receivedAt":"2006-11-26T09:49:01Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Andy Parkins wrote:\n\n> +               git-repo-config remote.\"$origin\".url \"$repo\" ^$ &&\n\nIs this needed? As of now git supports I think only one URL entry per remote\nanyway...\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"297971","messageId":"200611261210.52154.andyparkins@gmail.com","threadId":"43204","inReplyTo":"ekbnr6$naq$2@sea.gmane.org","subject":"[PATCH] Use new .git/config for storing \"origin\" shortcut repository","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-11-26T12:10:52Z","receivedAt":"2006-11-26T12:10:52Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"Rather than use a separate config .git/remotes/ for remote shortcuts, this\npatch adds the analagous definitions to .git/config using git-repo-config\ncalls.\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---\nYou're absolutely correct; fixed.  This patch replaces the previous (again).\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..7e5dc0f 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.g9fd7\n"},{"id":"295098","messageId":"Pine.LNX.4.63.0611261429420.30004@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43204","inReplyTo":"200611261210.52154.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-26T13:30:59Z","receivedAt":"2006-11-26T13:30:59Z","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\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\nYou do not need the \"^$\" here: this _is_ the first entry. I would even \nargue that this _has_ to replace whatever might be there (could be \nintroduced by some bogus templates, for example), since the first fetch \nentry has a special meaning for pull.\n\nCiao,\nDscho\n"}]}