From owner-freebsd-git@freebsd.org Fri Feb 5 11:04:43 2021 Return-Path: Delivered-To: freebsd-git@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 2FB825448DB for ; Fri, 5 Feb 2021 11:04:43 +0000 (UTC) (envelope-from adridg@freebsd.org) Received: from lb3-smtp-cloud8.xs4all.net (lb3-smtp-cloud8.xs4all.net [194.109.24.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.xs4all.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXCHG5Znmz4rll for ; Fri, 5 Feb 2021 11:04:42 +0000 (UTC) (envelope-from adridg@freebsd.org) Received: from cust-d4a83f22 ([IPv6:fc0c:c11d:cecc:f58a:eaa1:c0:9d8f:c143]) by smtp-cloud8.xs4all.net with ESMTPA id 7yullOiOwW4yN7yumleq5p; Fri, 05 Feb 2021 12:04:40 +0100 From: Adriaan de Groot To: freebsd-git@freebsd.org Subject: Re: Referencing git commit in the comment of Bugzilla Date: Fri, 05 Feb 2021 12:04:33 +0100 Message-ID: <2268670.THHZn3L5Ee@beastie.bionicmutton.org> Organization: FreeBSD In-Reply-To: <20210205.094644.1159184285479762732.yasu@utahime.org> References: <20210205.094644.1159184285479762732.yasu@utahime.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3763654.kAAoriTUSa"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-CMAE-Envelope: MS4xfPOyqdDZL4iJQQruO+fp0KXKW8UhpunxAIeNskxq6J9TSFbzQZ+A500rHYPrTc/EDHThPAdoCq0WvSsXKeAmPzcjKuoIroBQJfEIK31YAVc+9DPbaVTe FB82e8nYKkBGZCnmlBfmJrsEM9XIYLuJsjnRKJxDVVsXChRcDHqTwtM6VNls9ISqFnkZEzO9fO3S0ptNOfbGtMvZIsKOSCO6B/YP14WhmD1rqO/fxznUE7wJ IpQBPgTJAgaXR68gdEaycT6lnHa+0ELVBN6sn8CCApTjlCFSzNTCpsIY8AkTFaAl X-Rspamd-Queue-Id: 4DXCHG5Znmz4rll X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL]; local_wl_from(0.00)[freebsd.org] X-BeenThere: freebsd-git@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion of git use in the FreeBSD project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2021 11:04:43 -0000 --nextPart3763654.kAAoriTUSa Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Adriaan de Groot To: freebsd-git@freebsd.org Cc: Yasuhiro Kimura Subject: Re: Referencing git commit in the comment of Bugzilla Date: Fri, 05 Feb 2021 12:04:33 +0100 Message-ID: <2268670.THHZn3L5Ee@beastie.bionicmutton.org> Organization: FreeBSD In-Reply-To: <20210205.094644.1159184285479762732.yasu@utahime.org> References: <20210205.094644.1159184285479762732.yasu@utahime.org> On Friday, 5 February 2021 01:46:44 CET Yasuhiro Kimura wrote: > Doc and src have already migrated to git and ports will follow soon. > In this situation it's quite possbile that bug reporter wants to > reference git commit in the comment of bug report submitted to > Bugzilla. Then is there standard(?) way to do it? As for subversion > syntax such as "base r123456" or "ports r778899" is provided. And I > expect similar one is provided for git. Since a "git commit" has a hash, there is no nice number-that-always-goes-up to specify a commit; there **is** the hash, though, which might be b8a9c4c3b78aa58e289dd9212f399e3f6af690b0 That is a long and annoying string, and since *usually* there are no collisions, git provides "short hash" notation: a unique prefix of the commit hash is enough. In the specific repository I'm working in, b8a9c4c3b is enough: 9 characters instead of 40. In a different repo (FreeBSD ports, as it happens), asking for a short hash (of a different commit) gives me be24aaa957c8 so 12 characters. The commit before that one was ef537e763f17 which shows there is no nice number-that-always-goes-up property. To get the hash, use (for instance) `git log -1`; to get the shorter one, use `git log -1 --abbrev-commit`. You could add an alias ("slog", for short-log) adding `--abbrev-commit` if you always want to see the short hash; do note that the short hash can become *longer* later in history if a prefix collision does happen. [ade] --nextPart3763654.kAAoriTUSa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQGzBAABCAAdFiEEhrjttu2OP5apuuy1z93JbxKxkVwFAmAdJkEACgkQz93JbxKx kVyAlwwArG0BhNzmB8dXEgirR/ydWDypKNzrwSwsvcJGqRJqHbx/k1vjU8aF+Ebh zh2YRRJXRuXmf3ptj/sjcBdnV43Dl/bLrivZVZeeafq7Yv0ReMsf0orTAolC+sw+ I1vyxPjpTNellu4bVgn9MsN1OBMVmcXj/7w+2glJexiJqn3DaFrp9EQkmFDJ3pUy DeOvKAX4tovLfZpuCUaaCdJZVAwEPC0y1aAemGF/BFfGlAGD0n3rRmgZ/KDEh1x2 iZkod3V+9t/k7tPnOvkMKtZaitBce8NbgFsjlFy+4CSdjY89rhvnkG0cO8hSacSu 0uMTAHn6tHVHoairy+H/puu+4xSTFdrSRe8fU2DDPfHBG2L/BrwfNycCjv/VTTFo WsRnh81VD/7pNe6NofZyZBBVl0rLcokUAh9TzKBNlIZ6CZTGXFcVBzXQtazmXW+c EKx+PW5MAt5wUrsHm7ZTfi7qJ/zvoCG5yb/HESoFj/J7Way4bsE7zgKo5wyBndTD N10a2pS/ =RUZh -----END PGP SIGNATURE----- --nextPart3763654.kAAoriTUSa--