{"thread":{"id":"5654","subject":"[PATCH] Fetch: get the remote branches to merge from the branch properties.","startedAt":"2006-09-22T23:41:17Z","lastAt":"2006-09-23T00:53:21Z","messageCount":4,"participants":["Santi Béjar","Junio C Hamano","Santi"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"27430","messageId":"874puza2qq.fsf@gmail.com","threadId":"5654","inReplyTo":null,"subject":"[PATCH] Fetch: get the remote branches to merge from the branch properties.","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2006-09-22T23:41:17Z","receivedAt":"2006-09-22T23:41:17Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"If in branch \"foo\" and this in config:\n\n[branch \"foo\"]\n       merge=bar\n\n\"git fetch\": fetch from the default repository and program the \"bar\"\n             branch to be merged with pull.\n\nSigned-off-by: Santi Béjar <sbejar@gmail.com>\n---\n Documentation/config.txt |    4 ++++\n git-parse-remote.sh      |   13 ++++++++++---\n 2 files changed, 14 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex fa20e28..b4de243 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -122,6 +122,10 @@ apply.whitespace::\n branch.<name>.remote::\n        When in branch <name>, it tells `git pull` which remote to fetch.\n\n+branch.<name>.merge::\n+       When in branch <name>, it tells `git fetch` the remote branch to be\n+       merged.\n+\n pager.color::\n        A boolean to enable/disable colored output when the pager is in\n        use (default is true).\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 187f088..0b14606 100755\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -86,9 +86,12 @@ get_remote_default_refs_for_push () {\n \n # Subroutine to canonicalize remote:local notation.\n canon_refs_list_for_fetch () {\n-\t# Leave only the first one alone; add prefix . to the rest\n+\t# Leave the branches in branch.${curr_branch}.merge alone,\n+\t# or the first one; add prefix . to the rest\n \t# to prevent the secondary branches to be merged by default.\n-\tdot_prefix=\n+\tcurr_branch=$(git-symbolic-ref HEAD | sed -e 's|^refs/heads/||')\n+\tmerge_branches=$(git-repo-config --get-all \"branch.${curr_branch}.merge\")\n+\t[ -z \"$merge_branches\" ] && merge_branches=$1\n \tfor ref\n \tdo\n \t\tforce=\n@@ -101,6 +104,11 @@ canon_refs_list_for_fetch () {\n \t\texpr \"z$ref\" : 'z.*:' >/dev/null || ref=\"${ref}:\"\n \t\tremote=$(expr \"z$ref\" : 'z\\([^:]*\\):')\n \t\tlocal=$(expr \"z$ref\" : 'z[^:]*:\\(.*\\)')\n+\t\tdot_prefix=.\n+\t\tfor merge_branch in $merge_branches\n+\t\tdo\n+\t\t    [ \"$remote\" = \"$merge_branch\" ] && dot_prefix= && break\n+\t\tdone\n \t\tcase \"$remote\" in\n \t\t'') remote=HEAD ;;\n \t\trefs/heads/* | refs/tags/* | refs/remotes/*) ;;\n@@ -120,7 +128,6 @@ canon_refs_list_for_fetch () {\n \t\t   die \"* refusing to create funny ref '$local_ref_name' locally\"\n \t\tfi\n \t\techo \"${dot_prefix}${force}${remote}:${local}\"\n-\t\tdot_prefix=.\n \tdone\n }\n \n-- \n1.4.2.1.g4b5cd\n"},{"id":"27435","messageId":"7vac4rxvep.fsf@assigned-by-dhcp.cox.net","threadId":"5654","inReplyTo":"874puza2qq.fsf@gmail.com","subject":"Re: [PATCH] Fetch: get the remote branches to merge from the branch properties.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-23T00:45:50Z","receivedAt":"2006-09-23T00:45:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"> If in branch \"foo\" and this in config:\n>\n> [branch \"foo\"]\n>        merge=3Dbar\n>\n> \"git fetch\": fetch from the default repository and program the \"bar\"\n>              branch to be merged with pull.\n>\n\nYour patch has a very strange whitespace damage in it, and I am\nnot talking about quoted-printable encoding.\n\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index fa20e28..b4de243 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -122,6 +122,10 @@ apply.whitespace::\n>  branch.<name>.remote::\n>         When in branch <name>, it tells `git pull` which remote to fetc=\n> h.\n>\n\nA tab in context before \"When\" is expanded into spaces, and the\nempty line in the context does not have the leading SP.\n\n> +branch.<name>.merge::\n> +       When in branch <name>, it tells `git fetch` the remote branch t=\n> o be\n> +       merged.\n> +\n\nI suspect you wanted to start the new line with a leading tab\nbefore \"When\" but it is expanded into spaces here.\n\nHowever, the diff for the other file in the same patch does not\nhave this problem.\n\nNo need to resend, as I hand-applied it to a new topic, but I am\na bit curious why one diff is broken when the other one is not\nin the same e-mail message.\n"},{"id":"27436","messageId":"8aa486160609221747s7859c6b6jb7164abe72b74e80@mail.gmail.com","threadId":"5654","inReplyTo":"874puza2qq.fsf@gmail.com","subject":"Re: [PATCH] Fetch: get the remote branches to merge from the branch properties.","fromName":"Santi","fromEmail":"sbejar@gmail.com","sentAt":"2006-09-23T00:47:01Z","receivedAt":"2006-09-23T00:47:01Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"2006/9/23, Santi Béjar <sbejar@gmail.com>:\n> If in branch \"foo\" and this in config:\n>\n> [branch \"foo\"]\n>        merge=bar\n>\n> \"git fetch\": fetch from the default repository and program the \"bar\"\n>              branch to be merged with pull.\n>\n> Signed-off-by: Santi Béjar <sbejar@gmail.com>\n\nJust to comments (it's late here):\n\n.- the branch.foo.merge must be the same as specified in the remotes/$remote.\n\n.- I've already found a bug (it's late and I need to sleep, sorry).\nThis must only be done for the default repository (origin, or in\nbranch.foo.remote).\n\nSanti\n"},{"id":"27437","messageId":"8aa486160609221753k413319f4n5fb46dcef4898292@mail.gmail.com","threadId":"5654","inReplyTo":"7vac4rxvep.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Fetch: get the remote branches to merge from the branch properties.","fromName":"Santi","fromEmail":"sbejar@gmail.com","sentAt":"2006-09-23T00:53:21Z","receivedAt":"2006-09-23T00:53:21Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"> Your patch has a very strange whitespace damage in it, and I am\n> not talking about quoted-printable encoding.\n\nLast minute hand-editing, sorry. Did I already say it is very late here? :(\n\n   Santi\n"}]}