From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.3123.1588817500968641168 for ; Wed, 06 May 2020 19:11:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=K3hq+4ot; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: bob.c.feng@intel.com) IronPort-SDR: GvFvR7oUosQXxNAGYcZhq6U2pmvxu+MmraUJ6n3K8UxIoNC2I6S14v3+qtaaKmZpqVhMz7RGtG UY0AgbfPyMSA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2020 19:11:40 -0700 IronPort-SDR: e7uYNhjcuy08PvaR0IYleFnqV0+P4jf7h7YicJvc7u2G+l0NHHcvq9FvU8OlKZC2j52b6Uf3z3 tLrHb69enHIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,361,1583222400"; d="scan'208";a="249131320" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by orsmga007.jf.intel.com with ESMTP; 06 May 2020 19:11:40 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 6 May 2020 19:11:30 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.170) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 6 May 2020 19:11:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KhjFmMUpchp3eQVMknas9UwFmmb1wv2bpKJYtteeXIiOFuyAaWpGaEOEk4aQQw82ZdBAEM7CTWO1OLj2QmboCWFuH4ho7mUZsQe2acTYbzR/Q+nWTCFXeU5n9dmD82J/Q/2cFxvCowy2klXetREF60bQxhxBIIfULtTDxbjH5ZrSgOsG1GO7IgqrpsUkWtcAVAHYL0NUGKjNxNNC+RDMMNlpHgPXZJYSMx3+GiUz68zkzNutcvaShMzkSri0B64KFwl3QJlLluDOFK3n3zKIIInm2OJ88ymhPAPVUS8kbDjh2LeQaU5aN/d8hytOjZf8TZhDsyVdhL+CuoiWHQS/Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pII9NA6rvvWycyTDIDe3PRiBi47aAsosRkVHcSJ2iPw=; b=H7rEd9ec6GlZElHLB1Eb7D6bqHmWkP305XDc0LOSyslsgGQYm34Sh+ti/h+CKolFR8zMc0OwtB9A+7bICDaY+m/zDfALk8T6TeAfP+bz4AU2kVBFE14uJQGKzeF6Th9CHREvgjI4vSiww6kwvbwpdjj7aYLg5KfZBjdTzxY0Dt7e0QO3AOJzRcwAUNCkttzHycT+l1DmqcKCfKunUBaTfqvIF0z2nTnPQKNe3x/twQmkEsbBY1MYgpqZbAKQ/yZ4YzkvBPJUvn6bQk4MuhzpNDAXFrlIDfzqs/ZviOP3t7GsmUUmTDQPucamsYcSdKz1S+QDoAFFBbmqAWKEVa7y9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pII9NA6rvvWycyTDIDe3PRiBi47aAsosRkVHcSJ2iPw=; b=K3hq+4otOvxltXBNpb4IcmiraWHv9354xkRamo3Io3Ki0GcFaARacL2sF65Lggc69/wkZJx9QA+6r92EMD3qEIrtDjAfS3QAN+i6mDbti4385oPtn0uEiB0mo6p3wqJDEE3NF3D5SX0P6pJVWM9JEyV2pU//6jjKsfvTg+8d/o8= Received: from BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) by BN6PR11MB3924.namprd11.prod.outlook.com (2603:10b6:405:7a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Thu, 7 May 2020 02:11:38 +0000 Received: from BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::2d53:d47c:1269:d601]) by BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::2d53:d47c:1269:d601%6]) with mapi id 15.20.2958.030; Thu, 7 May 2020 02:11:38 +0000 From: "Bob Feng" To: "devel@edk2.groups.io" , "lersek@redhat.com" , "Gao, Liming" CC: "leif@nuviainc.com" , "rebecca@bsdio.com" Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools: add repo name option to SetupGit.py Thread-Topic: [edk2-devel] [PATCH 1/1] BaseTools: add repo name option to SetupGit.py Thread-Index: AQHWH/NfKcIrB3dyIUGfDqEjoSNIZqiZpyKAgAE8DwCAAGXRgIAAoJhA Date: Thu, 7 May 2020 02:11:38 +0000 Message-ID: References: <20200501200044.16648-1-rebecca@bsdio.com> <20200506103148.GK21486@vanye> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b84a544b-55a9-4422-d180-08d7f22bf9ae x-ms-traffictypediagnostic: BN6PR11MB3924: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 03965EFC76 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XY98XR3Xa10AVQfp42qRo2quyi8WdhpuUJdt3txqUPGZla7lrW2U2RSTPiDnxSmotWEk//Wz39A9Oys8Pl7O1/xOmFzyb8Jk6qMAbzq8AXUlS8GcdoM/1GCftYEdeh39holah7zONySRvhy/xSlaUr5vrRiRrhaEpx2yaz2CTfWqjSgJykHyez6u3f5WBvX5KrqnBpkTQflzhnT/wNuTLz8+GR7UrLtyFGqT9r39n04K+emCKgz+6LMlpGXk73yG5n9A4OkGutoltdfZSb4vyKb4FPQNwp0XSew8tNcGY6HtsbaEWmRiz1GeVV4iejbkfUdCR3XvxHVv7kVV7A1h3ZlkxgHVCi/XlrBtqcm2GdPab+R1wVK4EEPPGrXXAIP1jf9FWWpjW9z4W07RxCr+CguPo4+Tearcr85d03LpeiiGIe7r502Jq4JZlcQZEWJajX8R9ZuwfcAWB5M4cHsGKu1tE2Jg7kvZFkn+hCGt0RJas4uMYPkGN4zyon0EQRrNA/BLkU4MPeSKzRk87/qjuVb0XtloKZsWTi8cdGcwZxiTzcr0/7a3r3AbN2yPUjtr/xZKVkjxVgb+8/fAv36tf+lixWbkYP0UVBCkh9IZth4= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB0068.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(366004)(136003)(39860400002)(376002)(346002)(396003)(33430700001)(8936002)(76116006)(66946007)(6636002)(2906002)(64756008)(66446008)(83290400001)(83310400001)(83320400001)(83280400001)(186003)(66556008)(26005)(9686003)(55016002)(33440700001)(66476007)(8676002)(83300400001)(54906003)(33656002)(53546011)(52536014)(7696005)(4326008)(316002)(6506007)(86362001)(966005)(110136005)(5660300002)(71200400001)(478600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: x7sGSBrb7pIX5Vg5xE0XobgmAhDKM3tBxf9vVhMCtuTsPnWE2TEgLpQIcCtMG3QUUoyoWrX+mfQx1wlSzbeGL/jFZSjGExlmw/18VQPWupDFQ/YZB6qfAmLzLq5FqnHknyPwsOW66bbPJHNtFXg+ohlhhIv9j1gWrWhDWbIIY1rWHsvoP3iEWmIymITgho4nE/x8yHC4YVZrRXSgtlo/tAX8Ve39VX5LI8fB9u32JplKECw0sVn/M8kHTlgGYa05TcrVejI6h09tLtegs3TzH9KttauEHAp4RZHudNHbWsMiVJnorgBXuG8/nAGK1rQGmfEv0S6YJeCF4NY6O/jcjQXGYl8Q+MfQVkLo1DUolkSdIeH43A9RCcifEV+8Uhczq2cUMDitVZAZaHaOf3SA1Kqnwvia39WKJAmUdlylGqTljN/8evO2x5XhzjhpBIOQKMaDhcciTvz7UMGpPN1zGoB/7iPJ5dFtxhXBThtxQPtfFnqE3uWBCM5oCEeLbjfuZN5Cpz5ZE9dkbZriPzS8cES6SSzn42UQMazY78iywnYB+JJdd11/p8ShCk4ldS9I4UL5adbLsqCP/+TtNb45nlNBBo8evuMCEMa3R7PJcTY/SHy1d3QcCrU1/WFSz7LsDOmqbcl2mHlnQNKnn9SoN1CPcla0SdU2XjEcjqCA5l8Pe9L2PDveyVTS1WyonO6sJWDGfm2qxSaD0m7eKI3uOI3wbog1LSkzyeWKQWEaRC5GYieHLvCCbW4gFtqB/ONzygaGvArHJEcxGHP6RKjmZc4bH6a5iaHwTl8T+wtuNzY= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b84a544b-55a9-4422-d180-08d7f22bf9ae X-MS-Exchange-CrossTenant-originalarrivaltime: 07 May 2020 02:11:38.0947 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: BY0v7XDqCZ9WfzvMwLF91YPPkB0cVD8YkxRzkIaQ+R9R7iI5QSopqY8vB3JDC0Knk9iZkc6yIIGrJuF4np9iIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB3924 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch looks good for me. Reviewed-by: Bob Feng -----Original Message----- From: devel@edk2.groups.io On Behalf Of Laszlo Erse= k Sent: Thursday, May 7, 2020 12:36 AM To: Feng, Bob C ; Gao, Liming Cc: devel@edk2.groups.io; leif@nuviainc.com; rebecca@bsdio.com Subject: Re: [edk2-devel] [PATCH 1/1] BaseTools: add repo name option to S= etupGit.py On 05/06/20 12:31, Leif Lindholm wrote: > On Tue, May 05, 2020 at 17:40:35 +0200, Laszlo Ersek wrote: >> CC Leif >> >> On 05/01/20 22:00, Rebecca Cran wrote: >>> Allow users who didn't clone one of the TianoCore repos from a=20 >>> canonical URL to specify the name of the repo (edk2, edk2-platforms=20 >>> or edk2-non-osi) when running SetupGit.py to allow them to configure= =20 >>> their repo properly. >>> >>> The new option is: >>> >>> -n repo, --name repo set the repo name to configure for, if not >>> detected automatically >>> >>> Signed-off-by: Rebecca Cran >>> Cc: Bob Feng >>> Cc: Liming Gao >=20 > I did consider this scenario when writing the code, but couldn't=20 > decide on a method for overriding, and wasn't 100% it wasn't just a=20 > theoretical issue. This solution looks sensible. > Reviewed-by: Leif Lindholm Thanks! Bob, Liming, can one of you please ACK and also merge this patch? Thanks, Laszlo >=20 > As a sidenote - now this exists, it could make sense to also add=20 > options for overriding 'list' and 'prefix'. >=20 > / > Leif >=20 >>> --- >>> Tested with: >>> pylama : no new issues detected >>> Option tested: >>> -n : correctly said a parameter was needed >>> -n edk2 : configured the repo for edk2 >>> -n edk2-foo : errored out with a list of repo names >>> -n edk2-platforms : updated the configuration for edk2-platforms >>> >>> Note the error block in __main__ if the upstream isn't found is=20 >>> redundant, since it already errors out and exits in get_upstream. >>> >>> BaseTools/Scripts/SetupGit.py | 12 +++++++++--- >>> 1 file changed, 9 insertions(+), 3 deletions(-) >>> >>> diff --git a/BaseTools/Scripts/SetupGit.py=20 >>> b/BaseTools/Scripts/SetupGit.py index e320ba2f887e..4416111ac0a5=20 >>> 100644 >>> --- a/BaseTools/Scripts/SetupGit.py >>> +++ b/BaseTools/Scripts/SetupGit.py >>> @@ -106,10 +106,11 @@ def fuzzy_match_repo_url(one, other): >>> return False >>> >>> >>> -def get_upstream(url): >>> +def get_upstream(url, name): >>> """Extracts the dict for the current repo origin.""" >>> for upstream in UPSTREAMS: >>> - if fuzzy_match_repo_url(upstream['repo'], url): >>> + if (fuzzy_match_repo_url(upstream['repo'], url) or >>> + upstream['name'] =3D=3D name): >>> return upstream >>> print("Unknown upstream '%s' - aborting!" % url) >>> sys.exit(3) >>> @@ -143,6 +144,11 @@ if __name__ =3D=3D '__main__': >>> help=3D'overwrite existing settings conflicti= ng with program defaults', >>> action=3D'store_true', >>> required=3DFalse) >>> + PARSER.add_argument('-n', '--name', type=3Dstr, metavar=3D'repo', >>> + choices=3D['edk2', 'edk2-platforms', 'edk2-no= n-osi'], >>> + help=3D'set the repo name to configure for, i= f not ' >>> + 'detected automatically', >>> + required=3DFalse) >>> PARSER.add_argument('-v', '--verbose', >>> help=3D'enable more detailed output', >>> action=3D'store_true', @@ -156,7 +162,7 @@ if= = =20 >>> __name__ =3D=3D '__main__': >>> >>> URL =3D REPO.remotes.origin.url >>> >>> - UPSTREAM =3D get_upstream(URL) >>> + UPSTREAM =3D get_upstream(URL, ARGS.name) >>> if not UPSTREAM: >>> print("Upstream '%s' unknown, aborting!" % URL) >>> sys.exit(7) >>> >> >> >> >> >=20 >=20 >=20