From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.37227.1615217626252584881 for ; Mon, 08 Mar 2021 07:33:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bpFCbi51; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615217625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+hNS69sbkIk39y8jlpbd5h9ky3+NzY658WfRzAsygnk=; b=bpFCbi5132YGh2MroBIJMOAKUmUyHHhShqmEMZ3TvaZ0q7wZ5LBvQCWEd7XqTfy/zTPt09 JPxLnsTxOs8RR5lSMPvMjlDv3n9GAnz/BE5iuD38Ifc4EB7iiRLOXsgolMFki6A9cWCbeN HN4E6aZPNUVrhx/MItTehzV5myqp0IU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-90-TccfQVC3P1uobdimRuUqlA-1; Mon, 08 Mar 2021 10:33:38 -0500 X-MC-Unique: TccfQVC3P1uobdimRuUqlA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63B2A108BD08; Mon, 8 Mar 2021 15:33:37 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-175.ams2.redhat.com [10.36.112.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6E4660C17; Mon, 8 Mar 2021 15:33:35 +0000 (UTC) Subject: =?UTF-8?B?UmU6IOWbnuWkjTogW2VkazItZGV2ZWxdIE5ldyBZZWFyLCBOZXcgUFIgVGhyZWFk?= To: devel@edk2.groups.io, ray.ni@intel.com, Rebecca Cran , "gaoliming@byosoft.com.cn" , "bret.barkelew@microsoft.com" References: <006401d713b9$3c862220$b5926660$@byosoft.com.cn> <51f102b9-4f37-2d1a-1dc5-94f6f7b2b3fb@nuviainc.com> From: "Laszlo Ersek" Message-ID: Date: Mon, 8 Mar 2021 16:33:35 +0100 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Hi Ray, On 03/08/21 13:26, Ni, Ray wrote: > > >> -----Original Message----- >> From: Rebecca Cran >> Sent: Monday, March 8, 2021 10:43 AM >> To: Ni, Ray ; devel@edk2.groups.io; gaoliming@byosoft.com.cn; bret.barkelew@microsoft.com >> Subject: Re: 回复: [edk2-devel] New Year, New PR Thread >> >> It was discussed in the recent Community Meeting last week. >> >> Now that the stable tag has been created, I believe it's moving forward >> as the highest priority task (behind, for example, converting the line >> endings from Windows to UNIX). > > Converting the line endings will cause "git blame" useless because > every line of code now is changed by someone who changes the line endings. it doesn't make git-blame useless, just a bit less comfortable. For example, with master being at 59a3ccb09e7a, assume you run: git blame -- BaseTools/Scripts/ConvertFceToStructurePcd.py and you get an output snippet like ef529e6ab7c31 (Liming Gao 2018-07-17 11:42:21 +0800 528) for i in range(len(info_list)-1,-1,-1): ef529e6ab7c31 (Liming Gao 2018-07-17 11:42:21 +0800 529) if len(info_list[i]) == 0: ef529e6ab7c31 (Liming Gao 2018-07-17 11:42:21 +0800 530) info_list.remove(info_list[i]) d79b63c64f58a (Leif Lindholm 2019-09-18 22:41:08 +0100 531) for i in (inf_list, title_all, header_list): d79b63c64f58a (Leif Lindholm 2019-09-18 22:41:08 +0100 532) i.sort() ef529e6ab7c31 (Liming Gao 2018-07-17 11:42:21 +0800 533) return keys,title_all,info_list,header_list,inf_list Assume you are curious about the "sort" invocation, so you run git show d79b63c64f58a But that only tells you: commit d79b63c64f58ac47e570e8d2e9b090525f7e8efd Author: Leif Lindholm Date: Wed Sep 18 22:41:08 2019 +0100 BaseTools: correct line endings for ConvertFce Python script Cc: Bob Feng Cc: Liming Gao Signed-off-by: Leif Lindholm Reviewed-by: Bob Feng Reviewed-by: Liming Gao Acked-by: Ard Biesheuvel Reviewed-by: Philippe Mathieu-Daude So what can we do in this case? Simple: run git blame "as of the direct parent" of commit d79b63c64f58a: git blame d79b63c64f58a^ -- BaseTools/Scripts/ConvertFceToStructurePcd.py Then you get: ef529e6ab7c31 (Liming Gao 2018-07-17 11:42:21 +0800 506) for i in range(len(info_list)-1,-1,-1): ef529e6ab7c31 (Liming Gao 2018-07-17 11:42:21 +0800 507) if len(info_list[i]) == 0: ef529e6ab7c31 (Liming Gao 2018-07-17 11:42:21 +0800 508) info_list.remove(info_list[i]) cfb29d2bda57b (Fan, ZhijuX 2019-04-15 16:55:01 +0800 509) for i in (inf_list, title_all, header_list): cfb29d2bda57b (Fan, ZhijuX 2019-04-15 16:55:01 +0800 510) i.sort() ef529e6ab7c31 (Liming Gao 2018-07-17 11:42:21 +0800 511) return keys,title_all,info_list,header_list,inf_list And this time you can run: git show cfb29d2bda57b which gives you the commit you are after: commit cfb29d2bda57baa344bded40cf12af81b13e8a40 Author: Fan, ZhijuX Date: Mon Apr 15 16:55:01 2019 +0800 BaseTools:update ConvertFceToStructurePcd.py with the char order PCD name. BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1718 BaseTools\Scripts\ConvertFceToStructurePcd.py Update script to sort the PCD order base on PcdName, then base on Pcd field name. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan Reviewed-by: Liming Gao This command sequence can be repeated as many times as necessary. git-blame gives you a commit, run git-show to check the commit. If the commit is not relevant (i.e., you need to run earlier), re-run git-blame on the same file, but at the *direct parent commit* of the previously used commit, using the caret (^) notation. It also works if files are renamed (or code is moved between files). In that case, "git-show" will tell you the original file name, so when you run git-blame on the parent commit, you can use the original file name too. Thanks Laszlo