From: Junio C Hamano Subject: Re: PATCH: Less fragile lookup of gpg key Date: Sat, 01 May 2010 10:18:59 -0700 Message-ID: <7vhbmr5ym4.fsf@alter.siamese.dyndns.org> References: <4BDC45EB.8090305@grant-olson.net> <4BDC561B.4030307@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Grant Olson , git@vger.kernel.org To: gitzilla@gmail.com X-From: git-owner@vger.kernel.org Sat May 01 19:19:25 2010 connect(): No such file or directory Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O8GLc-0002Mi-Qq for gcvg-git-2@lo.gmane.org; Sat, 01 May 2010 19:19:25 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753480Ab0EARTM (ORCPT ); Sat, 1 May 2010 13:19:12 -0400 Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:40719 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753295Ab0EARTI (ORCPT ); Sat, 1 May 2010 13:19:08 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id DD370AFC0F; Sat, 1 May 2010 13:19:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=to:cc:subject :references:from:date:message-id:mime-version:content-type; s= sasl; bh=U13RRWlIVzLrtaaxPQY5cKfRmRM=; b=CxkR9Bi+5b9pgd2pvGv4rU6 IUftf877doeBA/L6O82HQxG5nUBz1+mFhzaFq5dDLSv/g7WzHky1tkoXNwJJD1H0 wOVBhTg3sLyYMMU2z/SiFBKyrMotu/CODprMqKHcQVuNAPkM3NHTUoantOxNAhdQ 2LltjR4am1DmVB60n0l8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=to:cc:subject :references:from:date:message-id:mime-version:content-type; q= dns; s=sasl; b=vcKCEqk20CooMf6qbzPFg2EkU8sffvDjfMc6ZCnCNKuPAwneT az4Bh45lEme9Pr0M9PSm9rIXNO2yhzWYETB3DoJQR+R1gclDDJkxJpnJl5kEoIq0 Y7itmijw3+XgImK+KCkvc3huB6bg6EQdhAW4OkSSjW4vOLybYjrOohV2a4= Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id A7D91AFC0D; Sat, 1 May 2010 13:19:04 -0400 (EDT) Received: from pobox.com (unknown [68.225.240.211]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id E1BCDAFC0B; Sat, 1 May 2010 13:19:00 -0400 (EDT) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) X-Pobox-Relay-ID: A4921600-5545-11DF-9F10-D033EE7EF46B-77302942!a-pb-sasl-quonix.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: A Large Angry SCM writes: > Grant Olson wrote: >> When signing a tag, git will attempt to lookup your gpg key if you don't >> provide the key id. Right now, it's a little fragile. My gpg key uid >> is "Grant T. Olson (Personal Email) ". My git user >> info is "Grant T. Olson ". Things don't match >> because git doesn't have the comment. >> >> However, if I lookup just by email, things work perfectly. >> >> I think doing this would make life much easier for new users, and in the >> case that someone has an OpenPGP key without email (e.g. Ubuntu Master >> Signing Key) we can safely assume they're an expert and will either add >> the key id to their configuration or use -u instead of -s. >> >> Here's a patch that will try to lookup the user by email only if no >> signing key is provided. If there is no email, it will still fall back >> to the default generated by git. > > Why not fall back to just the email if the full lookup fails? Thanks; I like that suggestion a lot better. Grant's suggestion does not make the lookup "less fragile", but actually makes it less reliable for people with the same address with different spellings of name and want to choose which one to use per project.