{"thread":{"id":"10065","subject":"[PATCH] Allow abbreviations in the first refspec to be merged","startedAt":"2007-09-28T23:34:17Z","lastAt":"2007-09-28T23:38:50Z","messageCount":2,"participants":["Daniel Barkalow","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"54301","messageId":"Pine.LNX.4.64.0709281932550.5926@iabervon.org","threadId":"10065","inReplyTo":null,"subject":"[PATCH] Allow abbreviations in the first refspec to be merged","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-09-28T23:34:17Z","receivedAt":"2007-09-28T23:34:17Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"The config item for a refspec side and the ref name that it matches\naren't necessarily character-for-character identical. We actually want\nto merge a ref by default if: there is no per-branch config, it is the\nfound result of looking for the match for the first refspec, and the\nfirst refspec is not a pattern. Beyond that, anything that\nget_fetch_map() thinks matches is fine.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\nThis fixes the configuration you gave for me, and passes all the \nusual tests.\n\n builtin-fetch.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-fetch.c b/builtin-fetch.c\nindex 2f639cc..ac68ff5 100644\n--- a/builtin-fetch.c\n+++ b/builtin-fetch.c\n@@ -102,7 +102,7 @@ static struct ref *get_ref_map(struct transport *transport,\n \t\t\t\t    remote->fetch[i].dst[0])\n \t\t\t\t\t*autotags = 1;\n \t\t\t\tif (!i && !has_merge && ref_map &&\n-\t\t\t\t    !strcmp(remote->fetch[0].src, ref_map->name))\n+\t\t\t\t    !remote->fetch[0].pattern)\n \t\t\t\t\tref_map->merge = 1;\n \t\t\t}\n \t\t\tif (has_merge)\n-- \n1.5.3.2.1107.ge9eab8-dirty\n"},{"id":"54302","messageId":"20070928233850.GY3099@spearce.org","threadId":"10065","inReplyTo":"Pine.LNX.4.64.0709281932550.5926@iabervon.org","subject":"Re: [PATCH] Allow abbreviations in the first refspec to be merged","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-09-28T23:38:50Z","receivedAt":"2007-09-28T23:38:50Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> wrote:\n> The config item for a refspec side and the ref name that it matches\n> aren't necessarily character-for-character identical.\n[snip]\n> diff --git a/builtin-fetch.c b/builtin-fetch.c\n> index 2f639cc..ac68ff5 100644\n> --- a/builtin-fetch.c\n> +++ b/builtin-fetch.c\n> @@ -102,7 +102,7 @@ static struct ref *get_ref_map(struct transport *transport,\n>  \t\t\t\t    remote->fetch[i].dst[0])\n>  \t\t\t\t\t*autotags = 1;\n>  \t\t\t\tif (!i && !has_merge && ref_map &&\n> -\t\t\t\t    !strcmp(remote->fetch[0].src, ref_map->name))\n> +\t\t\t\t    !remote->fetch[0].pattern)\n>  \t\t\t\t\tref_map->merge = 1;\n>  \t\t\t}\n>  \t\t\tif (has_merge)\n\nOoooooooooooh.  Of course.  That makes perfect sense now that I\nsee your explanation and patch.  Thanks for fixing that!  :-)\n\n-- \nShawn.\n"}]}