From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.233.1593015427937930479 for ; Wed, 24 Jun 2020 09:17:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=kT54bwSu; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: nathaniel.l.desimone@intel.com) IronPort-SDR: vfqoC0BfIq7d1oiSTQzdBH8dHcNosyFeyH+9/Qn1u69ei1RWyta9X2TPtZJWDz3XxntwIspT6v 5M/K4bEeirXA== X-IronPort-AV: E=McAfee;i="6000,8403,9662"; a="124789042" X-IronPort-AV: E=Sophos;i="5.75,275,1589266800"; d="scan'208";a="124789042" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2020 09:17:06 -0700 IronPort-SDR: nMNBNbWTHRhzwPnEKrG6WGQt/V1wHeK4KOELS8qfyHsYixCK2nMqTvxjfbz7nt2pQG0qv///am pEYFRvsqOp7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,275,1589266800"; d="scan'208";a="479316418" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by fmsmga005.fm.intel.com with ESMTP; 24 Jun 2020 09:17:05 -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, 24 Jun 2020 09:17:05 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.57) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Jun 2020 09:17:04 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eLNpSNNHd8KkWTj7b95bFG6REVCH9ZldHmh2umu9cgzeTgByMYVK+WaV5BLFGMt/k60X/vI2s21T0zswGqe3dPfwfCkZIXlFxFrNTglCeVB2tBiQ9KvEl9hY2NzlHn2qR0sShLu15gJ6uSHh+VKYP9ei6HtycTu+MHuvni2uzpn/va3mu7KKbP9SdohxY4hC2sh6QjCE8wQoyhq00yepdOynAlji8osyHkHSHSN3gFrtz4uZEabNtT4J+iPpJy2DUkDkeJB+G8+czVIPYI0/8m1XgKvpwJ9Jz2+VQW8w7qOCuNPkSqIv4AvnPUoFMcHG16tMin70k1rVGUtRHxlIMg== 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=Pxfh9d94zTvsYW6WbKHtVOHdHmwE0d9r3mU5R50FESM=; b=dSG+MajLTzt5Ll0eRBafgp1xI06xS7J7zvaovDgtknm3pw4Ppp0lbGu5nTDLzGpDN32ClbJdL1nLEou5/xb9nAx3B64d2zfRBwdwxBKnAjvqs7BvHLERImSqPiGqH2kTb0CveZ2bcOjwG+mE+fSV+SzT1Kz4ULTh9NRZxfBy+eYKhujgPYXhbfmgyTx7M5WPyTQgzXK0BEdBOfg8ueoFWYa++zRMrNaP6yzrgbJct24y5QKHSF30CJbjxFyFPD0y++4LjgfAtI5SgUNf60yLKMxs46hJkemLkHTmw4m2ApZnPr2ZyEeBDiv5l6ybI+zPsQVKQ+Fp2c94Vo8ITHPLJA== 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=Pxfh9d94zTvsYW6WbKHtVOHdHmwE0d9r3mU5R50FESM=; b=kT54bwSuAowzrHteAFPwPd4KpzBW5qq+GdAjsnSH9Te/tqzM7CDw3U+z8EUCtor1ZHEx3a/kTb+81+x1bOmLq+HiQBgIhSo9wTy9vdgpSeZ57qe8v0rpr2RmfH2pWqShN8J9jQg7HFertjFYxVtwuMMsGCl7wXRHaHJCdLsprSg= Received: from MWHPR1101MB2160.namprd11.prod.outlook.com (2603:10b6:301:5b::12) by MW3PR11MB4667.namprd11.prod.outlook.com (2603:10b6:303:53::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21; Wed, 24 Jun 2020 16:17:03 +0000 Received: from MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::889c:c0bd:5262:7c80]) by MWHPR1101MB2160.namprd11.prod.outlook.com ([fe80::889c:c0bd:5262:7c80%8]) with mapi id 15.20.3131.020; Wed, 24 Jun 2020 16:17:03 +0000 From: "Nate DeSimone" To: "Desimone, Ashley E" , "devel@edk2.groups.io" CC: "Pandya, Puja" , "Bjorge, Erik C" , "Agyeman, Prince" , "Oram, Isaac W" Subject: Re: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Do not write a local commit template when a global one is defined. Thread-Topic: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Do not write a local commit template when a global one is defined. Thread-Index: AQHWRp6Sg8cUbHpR0UeWl3zsmy82eKjn+HnA Date: Wed, 24 Jun 2020 16:17:02 +0000 Message-ID: References: <20200620010247.2577-1-ashley.e.desimone@intel.com> In-Reply-To: <20200620010247.2577-1-ashley.e.desimone@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmRlM2RjOGQtZmQxOC00MWYxLTg5ZWItNWU5NGE3YWI2NjliIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOWpWczdQZlNoVWVNVmg3b3JBTXNsRmtnRFhtS0RXRHIwTGxDajF0VXd4bjJqczRnVHlIbUhqN2ZiNjFSa09XaiJ9 dlp-reaction: no-action dlp-version: 11.2.0.6 dlp-product: dlpe-windows x-ctpclassification: CTP_NT authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [134.134.136.221] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 58c26b47-152f-4ca8-843b-08d8185a07d2 x-ms-traffictypediagnostic: MW3PR11MB4667: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:983; x-forefront-prvs: 0444EB1997 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cj6Ygw2UX9F+I+M9gmFXxs/qwicBt/m9UwDHLRzkfvkWqN1LUk+/kLlLmTTmWdFHtLFmUaLwomj/J5AwLB1/Dnpvot4caL973vatV7yzabxeV21Wj62F2FMvb28vahHCnElGunfiW13ul46FPYulOsmxUJs9BGx3tIY3uB00TS2GJKImGG5BXBfUzMTrOLoCAZbB0gxUJ76T+1phwVEN+XIgaJp7a1J91W7qq241ChdgTP+3mUeLYybD/WIH73k+UISsa5ZvqnZYCa4AC8u0WctaH0TqZOi89jJQ8aoe9lT88Ze/ZgXDzDJh+1dsRB4DbSGZDjKrs7cB4ic7BtYDig== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1101MB2160.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(366004)(376002)(346002)(396003)(39860400002)(8676002)(478600001)(33656002)(71200400001)(8936002)(76116006)(55016002)(66946007)(9686003)(86362001)(66476007)(2906002)(4326008)(66556008)(64756008)(66446008)(107886003)(186003)(5660300002)(54906003)(26005)(316002)(83380400001)(53546011)(6506007)(110136005)(52536014)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: tjsmCImgosM0oo+YbaWSLdBy6PQgVJjev3R+z0KTjf2rzyTQrQfu5+9jucqW+ogg4y/ZJpmfDmza+Le8NrhHvcGNid1HM9BXQOPQ7N+A7J+HDn3UNd4AUezgWYC2UlDVPq7orcd5TzHwkLpewKRKMHebLUHJkY4wzH/rhYtr8UVkQryRWBuV5dw2bCwAj+FML1A1iiO9ZiLiZAPrmOetvj90AHxpeSgbadakopT7YtKF0Ga17dRgI3q1XEawq/XhsItjBgfY7anxL7R9mb01dEoJuHvO7JPVe4Ge00C3Gg3S3NWc53M6ZtZgsMYihN59laynzm44lExWdiiZlBh8w/go+1pd+lFMz3wcxLbdqD9e1zelW3rJmtZRcdSdH2fXyyvTVkYnJOsRe/kzQC9r2uspGUo1vG4IjWEyhPGuHx11OtXuZL2u1LJgD3Fr+WDwzKtvM3lVK+ZeMIm3U/DTJFqm+OzBvtpayiw3/4RQFJOMnhd6blb/6b0tmlSY0Q+m MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1101MB2160.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58c26b47-152f-4ca8-843b-08d8185a07d2 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2020 16:17:02.9575 (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: +err62abcMZkit5/mbiaBmPiw1m+7QOF0eL3IdJ3bkuiB+kgr0D4EJ43uN8FU2Gtn8KxeqreNiJLhV7M4epCJCRT7kivfLlOTmY/mscCP00= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4667 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Nate DeSimone -----Original Message----- From: Desimone, Ashley E =20 Sent: Friday, June 19, 2020 6:03 PM To: devel@edk2.groups.io Cc: Desimone, Nathaniel L ; Pandya, Puja ; Bjorge, Erik C ; Agyeman, P= rince ; Oram, Isaac W Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Do not write a local commi= t template when a global one is defined. Signed-off-by: Ashley E Desimone Cc: Nate DeSimone Cc: Puja Pandya Cc: Erik Bjorge Cc: Prince Agyeman Cc: Isaac Oram --- edkrepo/common/common_repo_functions.py | 39 ++++++++++++++++--------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/edkrepo/common/common_repo_functions.py b/edkrepo/common/commo= n_repo_functions.py index 59c198f..313a1ca 100644 --- a/edkrepo/common/common_repo_functions.py +++ b/edkrepo/common/common_repo_functions.py @@ -558,21 +558,34 @@ def update_repo_commit_template(workspace_dir, repo, = repo_info, config, global_m manifest =3D edk_manifest.ManifestXml(os.path.join(workspace_dir, 'rep= o', 'Manifest.xml')) templates =3D manifest.commit_templates =20 + #Check for the presence of a gloablly defined commit template + global_template_in_use =3D False + global_gitconfig_path =3D os.path.normpath(os.path.expanduser("~/.gitc= onfig")) + with git.GitConfigParser(global_gitconfig_path, read_only=3DFalse) as = gitglobalconfig: + if gitglobalconfig.has_option(section=3D'commit', option=3D'templa= te'): + global_template =3D gitglobalconfig.get_value(section=3D'commi= t', option=3D'template') + global_template_in_use =3D True + print(COMMIT_TEMPLATE_CUSTOM_VALUE.format(repo_info.remote_nam= e)) + # Apply the template based on current manifest with repo.config_writer() as cw: - if cw.has_option(section=3D'commit', option=3D'template'): - current_template =3D cw.get_value(section=3D'commit', option= =3D'template').replace('"', '') - if not current_template.startswith(os.path.normpath(global_man= ifest_directory).replace('\\', '/')): - print(COMMIT_TEMPLATE_CUSTOM_VALUE.format(repo_info.remote= _name)) - return - - if repo_info.remote_name in templates: - template_path =3D os.path.normpath(os.path.join(global_manifes= t_directory, templates[repo_info.remote_name])) - if not os.path.isfile(template_path): - print(COMMIT_TEMPLATE_NOT_FOUND.format(template_path)) - return - template_path =3D template_path.replace('\\', '/') # Conver= t to git approved path - cw.set_value(section=3D'commit', option=3D'template', value=3D= '"{}"'.format(template_path)) + if not global_template_in_use: + if cw.has_option(section=3D'commit', option=3D'template'): + current_template =3D cw.get_value(section=3D'commit', opti= on=3D'template').replace('"', '') + if not current_template.startswith(os.path.normpath(global= _manifest_directory).replace('\\', '/')): + print(COMMIT_TEMPLATE_CUSTOM_VALUE.format(repo_info.re= mote_name)) + return + + if repo_info.remote_name in templates: + template_path =3D os.path.normpath(os.path.join(global_man= ifest_directory, templates[repo_info.remote_name])) + if not os.path.isfile(template_path): + print(COMMIT_TEMPLATE_NOT_FOUND.format(template_path)) + return + template_path =3D template_path.replace('\\', '/') # Co= nvert to git approved path + cw.set_value(section=3D'commit', option=3D'template', valu= e=3D'"{}"'.format(template_path)) + else: + if cw.has_option(section=3D'commit', option=3D'template'): + cw.remove_option(section=3D'commit', option=3D'templat= e') else: if cw.has_option(section=3D'commit', option=3D'template'): cw.remove_option(section=3D'commit', option=3D'template') --=20 2.26.2.windows.1