{"thread":{"id":"5963","subject":"Signed git-tag doesn't find default key","startedAt":"2006-10-20T09:04:17Z","lastAt":"2006-10-20T19:21:58Z","messageCount":3,"participants":["Andy Parkins","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"29308","messageId":"200610201004.17263.andyparkins@gmail.com","threadId":"5963","inReplyTo":null,"subject":"Signed git-tag doesn't find default key","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-10-20T09:04:17Z","receivedAt":"2006-10-20T09:04:17Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"Hello,\n\nI did this:\n\n$ git tag -s adp-sign-tag\ngpg: skipped \"Andy Parkins <andyparkins@gmail.com>\": secret key not available\ngpg: signing failed: secret key not available\nfailed to sign the tag with GPG.\n\nI believe the problem is that I have used the comment field in my key's UID \ndefinition.\n\n$ gpg --list-keys andy\npub   1024D/4F712F6D 2003-08-14\nuid                  Andy Parkins (Google) <andyparkins@gmail.com>\n\nSo when git-tag looks for \"Andy Parkins <andyparkins@gmail.com>\"; it's not \nfound.  The answer is (I think) to search only on the email address when \nlooking for a key.  I've simply changed git-tag to have\n\nusername=$(git-repo-config user.email)\n\nHowever, this is clearly wrong as what it actually wants is the committer \nemail.  Am I safe to simply process the $tagger variable to extract it?\n\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIEE\nandyparkins@gmail.com\n"},{"id":"29387","messageId":"Pine.LNX.4.64.0610200922170.3962@g5.osdl.org","threadId":"5963","inReplyTo":"200610201004.17263.andyparkins@gmail.com","subject":"Re: Signed git-tag doesn't find default key","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-10-20T16:32:17Z","receivedAt":"2006-10-20T16:32:17Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 20 Oct 2006, Andy Parkins wrote:\n> \n> I did this:\n> \n> $ git tag -s adp-sign-tag\n> gpg: skipped \"Andy Parkins <andyparkins@gmail.com>\": secret key not available\n> gpg: signing failed: secret key not available\n> failed to sign the tag with GPG.\n\nI would suggest one of two things:\n\n - specify the signing entity explicitly:\n\n\tgit tag -u \"andyparkins@gmail.com\" adp-sign-tag\n\n - or just add a new alternate user ID to match the full git user ID.\n\nCurrently, your pgp key has the full ID \"Andy Parkins (Google) \n<andyparkins@gmail.com>\", and the way gpg matches ID's, that will _not_ \nmatch an ID of \"Andy Parkins <andyparkins@gmail.com>\"\n\nBut you can just do something like\n\n\tgpg --edit-key andyparkins@gmail.com\n\nand then do an \"adduid\", and then add your UID _without_ the \"(Google)\" in \nthere, and that should solve all your problems.\n\n> So when git-tag looks for \"Andy Parkins <andyparkins@gmail.com>\"; it's not \n> found.  The answer is (I think) to search only on the email address when \n> looking for a key.  I've simply changed git-tag to have\n> \n> username=$(git-repo-config user.email)\n> \n> However, this is clearly wrong as what it actually wants is the committer \n> email.  Am I safe to simply process the $tagger variable to extract it?\n\nYou're probably better off with something like\n\n\tgit var GIT_COMMITTER_IDENT | sed 's/\\(.*\\)<\\(.*\\)>\\(.*\\)/\\2/'\n\nwhich should work, but see above: I think you literally are better off \njust adding an alias to your PGP key that doesn't have the comment field.\n\nThat said, I've never understood why gpg matches on the comment field. \nDammit, it _should_ find the key anyway. Stupid program.\n\n\t\tLinus\n"},{"id":"29410","messageId":"200610202021.58157.andyparkins@gmail.com","threadId":"5963","inReplyTo":"Pine.LNX.4.64.0610200922170.3962@g5.osdl.org","subject":"Re: Signed git-tag doesn't find default key","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-10-20T19:21:58Z","receivedAt":"2006-10-20T19:21:58Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Friday 2006, October 20 17:32, Linus Torvalds wrote:\n\n> and then do an \"adduid\", and then add your UID _without_ the \"(Google)\" in\n> there, and that should solve all your problems.\n\nYeah, obviously that's one way; and while it doesn't really matter to me, it \nseems poor form that git doesn't work with gpg as it is.  While one could of \ncourse use the \"-u\" switch, if that is the answer, then why bother with \nhaving the \"-s\" switch at all?\n\n> You're probably better off with something like\n>\n> \tgit var GIT_COMMITTER_IDENT | sed 's/\\(.*\\)<\\(.*\\)>\\(.*\\)/\\2/'\n\nI've actually settled on:\n\n: ${username:=$(expr \"z$tagger\" : 'z.*<\\(.*\\)>')}\n\nIn git-tag.sh.\n\n> That said, I've never understood why gpg matches on the comment field.\n> Dammit, it _should_ find the key anyway. Stupid program.\n\nI think it's doing the right thing unfortunately.  If you search on any part\n \"Andy Parkins\"\n \"<andyparkins@gmail.com>\"\n \"andyparkins@gmail.com\"\n \"andyparkins\"\nIt finds it fine; the only thing it doesn't find is\n \"Andy Parkins <andyparkins@gmail.com>\"\nWhich I suppose is fair enough, as it's a fairly specific format to be \nsearching for.\n\nI'm going to advocate my change of only searching on the email address for \nfinding the key - there shouldn't be two keys with the same email address \nanyway, so there shouldn't be a danger of ambiguity of key.  Also, it deals \nwith the case when someone has entered a different name in git and in their \ngpg UID.  For example, I would think it shouldn't be a problem that I like to \nbe called \"Andy\" on the git list, and yet want my key to say \"A. D. \nParkins\", \"Andrew Parkins\" or \"Sparky McFly\". \n\nNow, I think I've written my name far, far too many times in this email.\n\n\nSparky McFly\n-- \nDr Andrew Parkins, M Eng (Hons), AMIEE\nandyparkins@gmail.com\n"}]}