{"thread":{"id":"29176","subject":"How to generate pull-request with info of signed tag","startedAt":"2011-12-16T06:35:16Z","lastAt":"2011-12-21T18:39:14Z","messageCount":12,"participants":["Aneesh Kumar K.V","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"181280","messageId":"874nx1korf.fsf@linux.vnet.ibm.com","threadId":"29176","inReplyTo":null,"subject":"How to generate pull-request with info of signed tag","fromName":"Aneesh Kumar K.V","fromEmail":"aneesh.kumar@linux.vnet.ibm.com","sentAt":"2011-12-16T06:35:16Z","receivedAt":"2011-12-16T06:35:16Z","isPatch":false,"sender":{"key":"aneesh.kumar@linux.vnet.ibm.com","avatar":"https://gravatar.com/avatar/a32cbcc7e70c8eb5a4cdbd1ea0b6c2ead382f2529cc43f51fd350767f079d92d?d=mp&s=160"},"body":"\nHi,\n\nI am using git from master branch and wanted to try the signed pull\nrequest. I have pushed the signed tag to repo.or.cz, but not sure how to\ngenerate pull request with signed tag information ? git-pull-request\ninsist on a branch on the server and put the branch details in the\npull-request text, It do add tag description but not the tag name and\nstill put \"repo-name branch\" name in the txt. Shouldn't that be\n\"repo-name tag-name\" so that one can cut-paste that in pull request ?\n\n-aneesh\n"},{"id":"181302","messageId":"7vmxasjxkv.fsf@alter.siamese.dyndns.org","threadId":"29176","inReplyTo":"874nx1korf.fsf@linux.vnet.ibm.com","subject":"Re: How to generate pull-request with info of signed tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-16T16:22:24Z","receivedAt":"2011-12-16T16:22:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com> writes:\n\n> I am using git from master branch and wanted to try the signed pull\n> request. I have pushed the signed tag to repo.or.cz, but not sure how to\n> generate pull request with signed tag information ? git-pull-request\n> insist on a branch on the server and put the branch details in the\n> pull-request text, It do add tag description but not the tag name and\n> still put \"repo-name branch\" name in the txt. Shouldn't that be\n> \"repo-name tag-name\" so that one can cut-paste that in pull request ?\n\nYeah, you are right.\n"},{"id":"181303","messageId":"7vbor8jw0h.fsf@alter.siamese.dyndns.org","threadId":"29176","inReplyTo":"874nx1korf.fsf@linux.vnet.ibm.com","subject":"Re* How to generate pull-request with info of signed tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-16T16:56:14Z","receivedAt":"2011-12-16T16:56:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com> writes:\n\n> I am using git from master branch and wanted to try the signed pull\n> request. I have pushed the signed tag to repo.or.cz, but not sure how to\n> generate pull request with signed tag information?\n\nThe correct script should grok the following command line:\n\n $ git request-pull v1.7.7.4 git://git.kernel.org/pub/scm/git/git.git v1.7.7.5\n\nand include\n\n    are available in the git repository at\n\n      git://git.kernel.org/.../git.git tag v1.7.7.5\n\n    for you to fetch changes up to 66c1...\n\nbut we didn't loosen the code that inspects the publishing repository to\nallow asking for a tag that points at an older part of the history to be\npulled.\n\nHere is an update.\n-- >8 --\nSubject: request-pull: update the \"pull\" command generation logic\n\nThe old code that insisted on asking for the tip of a branch to be pulled\nwere not updated when we started allowing for a tag to be pulled. When a\ntag points at an older part of the history and there is no branch that\npoints at the tagged commit, the script failed to say which ref is to be\npulled.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-request-pull.sh |   46 +++++++++++++++++++++++++++++++++++++---------\n 1 files changed, 37 insertions(+), 9 deletions(-)\n\ndiff --git a/git-request-pull.sh b/git-request-pull.sh\nindex c6a5b7a..7b5c777 100755\n--- a/git-request-pull.sh\n+++ b/git-request-pull.sh\n@@ -57,12 +57,40 @@ headrev=$(git rev-parse --verify \"$head\"^0) || exit\n merge_base=$(git merge-base $baserev $headrev) ||\n die \"fatal: No commits in common between $base and $head\"\n \n-find_matching_branch=\"/^$headrev\t\"'refs\\/heads\\//{\n-\ts/^.*\trefs\\/heads\\///\n-\tp\n-\tq\n-}'\n-branch=$(git ls-remote \"$url\" | sed -n -e \"$find_matching_branch\")\n+# $head is the token given from the command line. If a ref with that\n+# name exists at the remote and their values match, we should use it.\n+# Otherwise find a ref that matches $headrev.\n+find_matching_ref='\n+\tsub abbr {\n+\t\tmy $ref = shift;\n+\t\tif ($ref =~ s|refs/heads/||) {\n+\t\t\treturn $ref;\n+\t\t} elsif ($ref =~ s|refs/tags/||) {\n+\t\t\treturn \"tag $ref\";\n+\t\t} else {\n+\t\t\treturn $ref;\n+\t\t}\n+\t}\n+\n+\tmy ($exact, $found);\n+\twhile (<STDIN>) {\n+\t\tmy ($sha1, $ref, $deref) = /^(\\S+)\\s+(\\S+?)(\\^\\{\\})?$/;\n+\t\tnext unless ($sha1 eq $ARGV[1]);\n+\t\t$found = abbr($ref);\n+\t\tif ($ref =~ m|/\\Q$ARGV[0]\\E$|) {\n+\t\t\t$exact = $found;\n+\t\t\tlast;\n+\t\t}\n+\t}\n+\tif ($exact) {\n+\t\tprint \"$exact\\n\";\n+\t} elsif ($found) {\n+\t\tprint \"$found\\n\";\n+\t}\n+'\n+\n+ref=$(git ls-remote \"$url\" | perl -e \"$find_matching_ref\" \"$head\" \"$headrev\")\n+\n url=$(git ls-remote --get-url \"$url\")\n \n git show -s --format='The following changes since commit %H:\n@@ -71,7 +99,7 @@ git show -s --format='The following changes since commit %H:\n \n are available in the git repository at:\n ' $baserev &&\n-echo \"  $url${branch+ $branch}\" &&\n+echo \"  $url${ref+ $ref}\" &&\n git show -s --format='\n for you to fetch changes up to %H:\n \n@@ -81,7 +109,7 @@ for you to fetch changes up to %H:\n \n if test -n \"$branch_name\"\n then\n-\techo \"(from the branch description for $branch local branch)\"\n+\techo \"(from the branch description for $branch_name local branch)\"\n \techo\n \tgit config \"branch.$branch_name.description\"\n fi &&\n@@ -101,7 +129,7 @@ fi &&\n git shortlog ^$baserev $headrev &&\n git diff -M --stat --summary $patch $merge_base..$headrev || status=1\n \n-if test -z \"$branch\"\n+if test -z \"$ref\"\n then\n \techo \"warn: No branch of $url is at:\" >&2\n \tgit show -s --format='warn:   %h: %s' $headrev >&2\n"},{"id":"181399","messageId":"871us3l45o.fsf@linux.vnet.ibm.com","threadId":"29176","inReplyTo":"7vbor8jw0h.fsf@alter.siamese.dyndns.org","subject":"Re: Re* How to generate pull-request with info of signed tag","fromName":"Aneesh Kumar K.V","fromEmail":"aneesh.kumar@linux.vnet.ibm.com","sentAt":"2011-12-17T13:27:15Z","receivedAt":"2011-12-17T13:27:15Z","isPatch":false,"sender":{"key":"aneesh.kumar@linux.vnet.ibm.com","avatar":"https://gravatar.com/avatar/a32cbcc7e70c8eb5a4cdbd1ea0b6c2ead382f2529cc43f51fd350767f079d92d?d=mp&s=160"},"body":"On Fri, 16 Dec 2011 08:56:14 -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com> writes:\n> \n> > I am using git from master branch and wanted to try the signed pull\n> > request. I have pushed the signed tag to repo.or.cz, but not sure how to\n> > generate pull request with signed tag information?\n> \n> The correct script should grok the following command line:\n> \n>  $ git request-pull v1.7.7.4 git://git.kernel.org/pub/scm/git/git.git v1.7.7.5\n> \n> and include\n> \n>     are available in the git repository at\n> \n>       git://git.kernel.org/.../git.git tag v1.7.7.5\n> \n>     for you to fetch changes up to 66c1...\n> \n> but we didn't loosen the code that inspects the publishing repository to\n> allow asking for a tag that points at an older part of the history to be\n> pulled.\n> \n\nTested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>\n\n-aneesh\n"},{"id":"181419","messageId":"7viplfdlpb.fsf@alter.siamese.dyndns.org","threadId":"29176","inReplyTo":"871us3l45o.fsf@linux.vnet.ibm.com","subject":"Re: Re* How to generate pull-request with info of signed tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-17T19:47:44Z","receivedAt":"2011-12-17T19:47:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com> writes:\n\n> Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>\n>\n> -aneesh\n\nThanks.\n"},{"id":"181470","messageId":"87iplch79e.fsf@linux.vnet.ibm.com","threadId":"29176","inReplyTo":"7viplfdlpb.fsf@alter.siamese.dyndns.org","subject":"Re: Re* How to generate pull-request with info of signed tag","fromName":"Aneesh Kumar K.V","fromEmail":"aneesh.kumar@linux.vnet.ibm.com","sentAt":"2011-12-19T16:10:37Z","receivedAt":"2011-12-19T16:10:37Z","isPatch":false,"sender":{"key":"aneesh.kumar@linux.vnet.ibm.com","avatar":"https://gravatar.com/avatar/a32cbcc7e70c8eb5a4cdbd1ea0b6c2ead382f2529cc43f51fd350767f079d92d?d=mp&s=160"},"body":"On Sat, 17 Dec 2011 11:47:44 -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com> writes:\n> \n> > Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>\n> >\n> > -aneesh\n> \n> Thanks.\n\nIt would be nice to get the below working\n\ngit fetch git-url tag remote-tag-name:local-namespace/tag-name\n\nThat way we can make sure before merging i can cut-paste that url and\nthe local tag name i wish to store this to. And then do a git-merge.\n\n-aneesh\n"},{"id":"181482","messageId":"7vobv4mj4r.fsf@alter.siamese.dyndns.org","threadId":"29176","inReplyTo":"87iplch79e.fsf@linux.vnet.ibm.com","subject":"Re: Re* How to generate pull-request with info of signed tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-19T19:55:16Z","receivedAt":"2011-12-19T19:55:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com> writes:\n\n> It would be nice to get the below working\n>\n> git fetch git-url tag remote-tag-name:local-namespace/tag-name\n\nAFAIR \"fetch tag $v\" is a shorthand for \"fetch refs/tags/$v:refs/tags/$\"\ninvented back when Linus was the maintainer of Git. You can say\n\n $ git fetch $url refs/tags/remote-tag-name:refs/tags/whatever-tag-name-you-want\n\nto rename their tag to whatever name in your local repository.\n\nCome to think of it, the last patch I sent out on request pull was very\nwrong.  The point of the recent change to allow you to pull this way\n(notice the lack of \"tag\")\n\n    $ git pull $url $signed_tag_name\n\nis so that you do not have to contaminate your own ref namespace with tags\nthat are used to leave audit trails in the history graph.\n\n> That way we can make sure before merging i can cut-paste that url and\n> the local tag name i wish to store this to. And then do a git-merge.\n"},{"id":"181483","messageId":"7vk45smilc.fsf@alter.siamese.dyndns.org","threadId":"29176","inReplyTo":"7vobv4mj4r.fsf@alter.siamese.dyndns.org","subject":"Re: Re* How to generate pull-request with info of signed tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-19T20:06:55Z","receivedAt":"2011-12-19T20:06:55Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Come to think of it, the last patch I sent out on request pull was very\n> wrong....\n\nAnd this should fix it.\n\n-- >8 --\nSubject: [PATCH] request-pull: do not emit \"tag\" before the tagname\n\nThe whole point of the recent update to allow \"git pull $url $tagname\" is\nso that the integrator does not have to store the (signed) tag that is\nused to convey authenticity to be recorded in the resulting merge in the\nlocal repository's tag namespace.  Asking for a merge be made with \"git\npull $url tag $tagname\" defeats it.\n\nNote that the request can become ambiguous if the requestor has a branch\nwith the same name as the tag, but that is not a new problem limited to\npulling. I wouldn't mind if somebody wants to add disambiguation to the\nfind_matching_ref logic in the script as a separate patch, though.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-request-pull.sh     |    4 +---\n t/t5150-request-pull.sh |    2 +-\n 2 files changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/git-request-pull.sh b/git-request-pull.sh\nindex 7b5c777..d7ba117 100755\n--- a/git-request-pull.sh\n+++ b/git-request-pull.sh\n@@ -63,10 +63,8 @@ die \"fatal: No commits in common between $base and $head\"\n find_matching_ref='\n \tsub abbr {\n \t\tmy $ref = shift;\n-\t\tif ($ref =~ s|refs/heads/||) {\n+\t\tif ($ref =~ s|refs/heads/|| || $ref =~ s|refs/tags/||) {\n \t\t\treturn $ref;\n-\t\t} elsif ($ref =~ s|refs/tags/||) {\n-\t\t\treturn \"tag $ref\";\n \t\t} else {\n \t\t\treturn $ref;\n \t\t}\ndiff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh\nindex aec842f..da25bc2 100755\n--- a/t/t5150-request-pull.sh\n+++ b/t/t5150-request-pull.sh\n@@ -180,7 +180,7 @@ test_expect_success 'request names an appropriate branch' '\n \t\tread branch\n \t} <digest &&\n \t{\n-\t\ttest \"$branch\" = tag--full ||\n+\t\ttest \"$branch\" = full ||\n \t\ttest \"$branch\" = master ||\n \t\ttest \"$branch\" = for-upstream\n \t}\n-- \n1.7.8.370.gb3269\n"},{"id":"181560","messageId":"87liq6xwr8.fsf@linux.vnet.ibm.com","threadId":"29176","inReplyTo":"7vk45smilc.fsf@alter.siamese.dyndns.org","subject":"Re: Re* How to generate pull-request with info of signed tag","fromName":"Aneesh Kumar K.V","fromEmail":"aneesh.kumar@linux.vnet.ibm.com","sentAt":"2011-12-21T06:30:03Z","receivedAt":"2011-12-21T06:30:03Z","isPatch":false,"sender":{"key":"aneesh.kumar@linux.vnet.ibm.com","avatar":"https://gravatar.com/avatar/a32cbcc7e70c8eb5a4cdbd1ea0b6c2ead382f2529cc43f51fd350767f079d92d?d=mp&s=160"},"body":"On Mon, 19 Dec 2011 12:06:55 -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Come to think of it, the last patch I sent out on request pull was very\n> > wrong....\n> \n> And this should fix it.\n> \n> -- >8 --\n> Subject: [PATCH] request-pull: do not emit \"tag\" before the tagname\n> \n> The whole point of the recent update to allow \"git pull $url $tagname\" is\n> so that the integrator does not have to store the (signed) tag that is\n> used to convey authenticity to be recorded in the resulting merge in the\n> local repository's tag namespace.  Asking for a merge be made with \"git\n> pull $url tag $tagname\" defeats it.\n> \n> Note that the request can become ambiguous if the requestor has a branch\n> with the same name as the tag, but that is not a new problem limited to\n> pulling. I wouldn't mind if somebody wants to add disambiguation to the\n> find_matching_ref logic in the script as a separate patch, though.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  git-request-pull.sh     |    4 +---\n>  t/t5150-request-pull.sh |    2 +-\n>  2 files changed, 2 insertions(+), 4 deletions(-)\n> \n> diff --git a/git-request-pull.sh b/git-request-pull.sh\n> index 7b5c777..d7ba117 100755\n> --- a/git-request-pull.sh\n> +++ b/git-request-pull.sh\n> @@ -63,10 +63,8 @@ die \"fatal: No commits in common between $base and $head\"\n>  find_matching_ref='\n>  \tsub abbr {\n>  \t\tmy $ref = shift;\n> -\t\tif ($ref =~ s|refs/heads/||) {\n> +\t\tif ($ref =~ s|refs/heads/|| || $ref =~ s|refs/tags/||) {\n>  \t\t\treturn $ref;\n> -\t\t} elsif ($ref =~ s|refs/tags/||) {\n> -\t\t\treturn \"tag $ref\";\n>  \t\t} else {\n>  \t\t\treturn $ref;\n>  \t\t}\n> diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh\n> index aec842f..da25bc2 100755\n> --- a/t/t5150-request-pull.sh\n> +++ b/t/t5150-request-pull.sh\n> @@ -180,7 +180,7 @@ test_expect_success 'request names an appropriate branch' '\n>  \t\tread branch\n>  \t} <digest &&\n>  \t{\n> -\t\ttest \"$branch\" = tag--full ||\n> +\t\ttest \"$branch\" = full ||\n>  \t\ttest \"$branch\" = master ||\n>  \t\ttest \"$branch\" = for-upstream\n>  \t}\n\nAlso can we make .git/config remote stanza to have something like below\n\n\n     fetch = +refs/tags/*:refs/tags/abc/*\n\nso that one can do\n\n   git fetch t-remote tag-name\n\nand that get stored to abc/tag-name \n\n-aneesh\n"},{"id":"181561","messageId":"7vzkemh0de.fsf@alter.siamese.dyndns.org","threadId":"29176","inReplyTo":"87liq6xwr8.fsf@linux.vnet.ibm.com","subject":"Re: Re* How to generate pull-request with info of signed tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-21T07:03:57Z","receivedAt":"2011-12-21T07:03:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com> writes:\n\n> Also can we make .git/config remote stanza to have something like below\n>\n>\n>      fetch = +refs/tags/*:refs/tags/abc/*\n>\n> so that one can do\n>\n>    git fetch t-remote tag-name\n>\n> and that get stored to abc/tag-name \n\nYou can do whatever you want to your own config file without asking anybody.\n\nHaving said that, the point of the recent change to allow you to pull this\nway (notice the lack of \"tag\")\n\n    $ git pull $url $signed_tag_name\n\nis so that you do not have to contaminate your own ref namespace with tags\nthat are used to leave audit trails in the history graph.\n"},{"id":"181583","messageId":"87ipl9yik6.fsf@linux.vnet.ibm.com","threadId":"29176","inReplyTo":"7vzkemh0de.fsf@alter.siamese.dyndns.org","subject":"Re: Re* How to generate pull-request with info of signed tag","fromName":"Aneesh Kumar K.V","fromEmail":"aneesh.kumar@linux.vnet.ibm.com","sentAt":"2011-12-21T16:51:21Z","receivedAt":"2011-12-21T16:51:21Z","isPatch":false,"sender":{"key":"aneesh.kumar@linux.vnet.ibm.com","avatar":"https://gravatar.com/avatar/a32cbcc7e70c8eb5a4cdbd1ea0b6c2ead382f2529cc43f51fd350767f079d92d?d=mp&s=160"},"body":"On Tue, 20 Dec 2011 23:03:57 -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com> writes:\n> \n> > Also can we make .git/config remote stanza to have something like below\n> >\n> >\n> >      fetch = +refs/tags/*:refs/tags/abc/*\n> >\n> > so that one can do\n> >\n> >    git fetch t-remote tag-name\n> >\n> > and that get stored to abc/tag-name \n> \n> You can do whatever you want to your own config file without asking anybody.\n> \n> Having said that, the point of the recent change to allow you to pull this\n> way (notice the lack of \"tag\")\n> \n>     $ git pull $url $signed_tag_name\n> \n> is so that you do not have to contaminate your own ref namespace with tags\n> that are used to leave audit trails in the history graph.\n> \n\nWith an entry like below\n\n[remote \"github\"]\n        fetch = +refs/tags/*:refs/tags/origin/*\n        url = git://github.com/kvaneesh/QEMU.git\n\nwhen i do git fetch github for-anthony i get the below error\n\n[master@QEMU]$ git fetch github for-anthony\nFrom git://github.com/kvaneesh/QEMU\n * tag               for-anthony -> FETCH_HEAD\n[master@QEMU]$ less .git/config \n\nAlso trying to do\n\n[master@QEMU]$ git fetch git://github.com/kvaneesh/QEMU.git  for-anthony:aneesh/for-anthony\nerror: Trying to write non-commit object 12916047784615b7d8b879d9d39be6c1559e1b1b to branch refs/heads/aneesh/for-anthony\nFrom git://github.com/kvaneesh/QEMU\n ! [new branch]      for-anthony -> aneesh/for-anthony  (unable to update local ref)\n * [new tag]         for-anthony -> for-anthony\n\n\nI understand that replacing the above with below works. But we should\nnot be required to specify refs/tags there right ?\n\n[master@QEMU]$ git fetch git://github.com/kvaneesh/QEMU.git  refs/tags/for-anthony:refs/tags/aneesh/for-anthony\n\n-aneesh\n"},{"id":"181587","messageId":"7vobv1hir1.fsf@alter.siamese.dyndns.org","threadId":"29176","inReplyTo":"87ipl9yik6.fsf@linux.vnet.ibm.com","subject":"Re: Re* How to generate pull-request with info of signed tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-21T18:39:14Z","receivedAt":"2011-12-21T18:39:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com> writes:\n\n> With an entry like below\n>\n> [remote \"github\"]\n>         fetch = +refs/tags/*:refs/tags/origin/*\n>         url = git://github.com/kvaneesh/QEMU.git\n>\n> when i do git fetch github for-anthony i get the below error\n\nWhen you give refspecs from the command line like that, the default\nrefspec remote.github.fetch will not be used and what you configure there\nis immaterial.\n\n> [master@QEMU]$ git fetch github for-anthony\n>>From git://github.com/kvaneesh/QEMU\n>  * tag               for-anthony -> FETCH_HEAD\n\nSounds sane.\n\nDoes \"git cat-file -t FETCH_HEAD\" report \"tag\" (it should)?  After doing\nthat fetch and inspecting \"git log -p ..FETCH_HEAD\", you should be able to\ndo \"git merge FETCH_HEAD\" and it should be like you did \"git pull github\nfor-anthony\".\n\n> Also trying to do\n>\n> [master@QEMU]$ git fetch git://github.com/kvaneesh/QEMU.git  for-anthony:aneesh/for-anthony\n> error: Trying to write non-commit object 12916047784615b7d8b879d9d39be6c1559e1b1b to branch refs/heads/aneesh/for-anthony\n>>From git://github.com/kvaneesh/QEMU\n>  ! [new branch]      for-anthony -> aneesh/for-anthony  (unable to update local ref)\n>  * [new tag]         for-anthony -> for-anthony\n\nSounds sane, too.\n\n> I understand that replacing the above with below works. But we should\n> not be required to specify refs/tags there right ?\n>\n> [master@QEMU]$ git fetch git://github.com/kvaneesh/QEMU.git  refs/tags/for-anthony:refs/tags/aneesh/for-anthony\n\nIf the \"for-anthony\" name is ambiguous between branches and tags, then you\nmust disambiguate. I am guessing that the unqualified LHS \"for-anthony\" is\nfound in the branch namespace of the remote, and that is why RHS is qualified\nwith the same refs/heads/ prefix to store it to the branch namespace.\n\nOn the other hand, if \"for-anthony\" name is unambiguous, then you may have\nfound a bug. I cannot tell.\n"}]}