From owner-freebsd-current@freebsd.org Thu Dec 24 21:52:33 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F418E4D25B4 for ; Thu, 24 Dec 2020 21:52:32 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D23hc6HXsz3Ml7; Thu, 24 Dec 2020 21:52:32 +0000 (UTC) (envelope-from yuripv@yuripv.dev) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 775025C007B; Thu, 24 Dec 2020 16:52:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 24 Dec 2020 16:52:31 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtledgudehhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpegjuhhr ihcurfgrnhhkohhvuceohihurhhiphhvseihuhhrihhpvhdruggvvheqnecuggftrfgrth htvghrnhepffehvdekgeeijeevledvfffgveeuvefggfejhfelueeuveetvddvvdfgieet ffetnecukfhppeeluddrvdegtddruddvgedrudehkeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeihuhhrihhpvheshihurhhiphhvrdguvghv X-ME-Proxy: Received: from [192.168.1.6] (unknown [91.240.124.158]) by mail.messagingengine.com (Postfix) with ESMTPA id 2104D108005B; Thu, 24 Dec 2020 16:52:29 -0500 (EST) Subject: Re: referencing one commit in another for git To: Warner Losh , Jan Beich Cc: Alan Somers , Rick Macklem , FreeBSD Current References: From: Yuri Pankov Message-ID: Date: Fri, 25 Dec 2020 00:52:28 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4D23hc6HXsz3Ml7 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2020 21:52:33 -0000 Warner Losh wrote: > On Wed, Dec 23, 2020 at 6:22 PM Jan Beich wrote: > >> Warner Losh writes: >> >>> On Wed, Dec 23, 2020, 3:21 PM Alan Somers wrote: >>> >>>> On Wed, Dec 23, 2020 at 3:16 PM Rick Macklem >> wrote: >>>> >>>>> Hi, >>>>> >>>>> So I just did my first git commit. Pretty scary, but it looks ok. >>>>> >>>>> Now, how do I reference one commit in another related >>>>> commit's log? >>>>> >>>>> By the long winded hash or ?? >>>>> >>>>> I'm not sure if I should ask here or on the git mailing list, >>>>> but I figured this isn't a technical git question... >>>>> >>>>> Thanks for any help with this, rick >>>>> >>>> >>>> Yeah, you should use the full hash. For temporary references, like >> during >>>> a code review, you can use the first "several" digits of the hash. >> For a >>>> project of FreeBSD's size, "several" is probably 11-13. But in >> permanent >>>> contexts, like commit logs, you should use the full hash. When somebody >>>> views the commit on a platform like Github, Github will automatically >> turn >>>> it into a hyperlink, and display only the first "several" digits. >>>> >>> >>> >>> For MFCs we are recommending the first 11. I think this will likely >> suffice >>> and matches the git client behavior. >> >> Mercurial defaults to 12 digit abbreviation. Git abbreviates linux, >> freebsd-legacy, freebsd-ports repos on GitHub to 12 digit. >> > > I've updated to 12. That sounds like a good number of digits...Thanks. I think the common way is to use `git rev-parse --short `, though we are likely to recommend increasing the core.abbrev value which sets the minimum length of unique prefix (default is 4).