From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wNTQHMSiKGKDTQAAgWs5BA (envelope-from ) for ; Wed, 09 Mar 2022 13:51:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UFNHGsSiKGLqhgAA9RJhRA (envelope-from ) for ; Wed, 09 Mar 2022 13:51:16 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DBC9E29E58 for ; Wed, 9 Mar 2022 13:51:15 +0100 (CET) Received: from localhost ([::1]:37932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRvmc-0002oB-AB for larch@yhetil.org; Wed, 09 Mar 2022 07:51:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRvmR-0002lT-8Q for guix-patches@gnu.org; Wed, 09 Mar 2022 07:51:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRvmQ-0006S3-Kz for guix-patches@gnu.org; Wed, 09 Mar 2022 07:51:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRvmQ-0001Qk-G7 for guix-patches@gnu.org; Wed, 09 Mar 2022 07:51:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54293] [WIP] home: Add home-git-service-type Resent-From: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Mar 2022 12:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54293 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Maxime Devos Cc: 54293@debbugs.gnu.org Received: via spool by 54293-submit@debbugs.gnu.org id=B54293.16468302225444 (code B ref 54293); Wed, 09 Mar 2022 12:51:02 +0000 Received: (at 54293) by debbugs.gnu.org; 9 Mar 2022 12:50:22 +0000 Received: from localhost ([127.0.0.1]:58784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRvli-0001Pd-AW for submit@debbugs.gnu.org; Wed, 09 Mar 2022 07:50:22 -0500 Received: from mail-tycjpn01olkn2064.outbound.protection.outlook.com ([40.92.99.64]:50926 helo=JPN01-TYC-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRvlc-0001PE-7K for 54293@debbugs.gnu.org; Wed, 09 Mar 2022 07:50:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ahvkKPVLHatWs/AlYsTcZzzf4rLyqSYjKuJU7/C3FtmTzLAiHkW1xGSeB3Iry5IBKKl50tjV0zt/cCvb8DR3H43VQPi64NSiZgAjofI1XyxEJ89AwEurS02eFAaBlL9kf73xOBzza4zeNEjw7lUBmXUcQfgSaRMwegvvk5exMmxOU0p5AO5gUMynwQ+Tr6vSKakg43+im+y9KBYMliDdakVpIc1cVrzQ1+S02qBVwDDLxxMzSH82c/sIkdPCik+jZ/aYHs8gh3AU4aEAnD7pEzycyl0GgQqkhlDYTobstmg4Fcsi8t/y7XNLeLjSzAKTG9m1DGAv4BJI6bvu2lJUoQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oCyZkkZSHG1nuxFcOyCTASFSh190WwR8yBbX3hX1BoY=; b=UMXIDp0aj3u8/a+EsqJzQ1EIrcNHvs3ulnYsJSmxlO4db2XPz4Gy3t6zWNau2a3OjtVNSWZbTKjAqSInnuoOZjRzrgrozcU5nyFnODfMICCB07T0GP7GWw7CjdwCrx0Yq9lXsj2yyn0egWRwZl7MrU3h+WXPHf5w0BXqsg+ZBHhQxMTA+DENGckhr5ruoOYke1Z3ke/FVUMKTqpLEheefJJi5jnBl8dW8aO3uvji1TXI7zJfvn6sdSmr8Qd+vpZ8kN5pu72Q5xDOEBONnm1V29EfEV2+2AFT42bY9RF2Bziyed8xVItM5oBKhVWTNaqEgHBfYE4zQPBvZGMNlYxfWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oCyZkkZSHG1nuxFcOyCTASFSh190WwR8yBbX3hX1BoY=; b=lji6wfZDTe1DcEerhAV5Ddpafm1stBtrTt+cYM/IWbOI5SPLjozt3ySElE2vE0iYByCDIA9/j6lUlU1A/xXr7IUoU19qOlE+/236Txpu17nwy49vVjqzB6KWLCIZdSAJiyexumEnN2onL70XkaHS52Yzmgu9V5bppTAZTfX1tvDgS3SM2hn9N3bMUl6x0NErLYt8zKgrB7/BG86qlpqi/2n9zVufcTTm45B2p/5f9NmtwOKYsEwmM68hGc6n57cXrRrrZ1NFof4224vEO6iaPEGny4zamoKe1ai1isZISznUF8ajjiXvuN0fNCKApH1u0rYL1TSL3OBUomR+o1eLYw== Received: from TYCP286MB1897.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:11e::13) by OSZP286MB2305.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:187::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Wed, 9 Mar 2022 12:50:04 +0000 Received: from TYCP286MB1897.JPNP286.PROD.OUTLOOK.COM ([fe80::51f5:8561:6bc0:1f64]) by TYCP286MB1897.JPNP286.PROD.OUTLOOK.COM ([fe80::51f5:8561:6bc0:1f64%5]) with mapi id 15.20.5038.027; Wed, 9 Mar 2022 12:50:04 +0000 From: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= References: <4802fd5bd14e6d73ca8205edab1e38580db7dd0c.camel@telenet.be> Date: Wed, 09 Mar 2022 20:50:06 +0800 In-Reply-To: <4802fd5bd14e6d73ca8205edab1e38580db7dd0c.camel@telenet.be> (Maxime Devos's message of "Mon, 07 Mar 2022 19:11:16 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TMN: [L0JBa6jxaKSMHk5OyOnfi8Lw1glQgv+YH2TFvWKut3HVMB6MQ7x8P5fvXslU9xcK] X-ClientProxiedBy: HK2PR02CA0153.apcprd02.prod.outlook.com (2603:1096:201:1f::13) To TYCP286MB1897.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:11e::13) X-Microsoft-Original-Message-ID: <87mthz2su9.fsf@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a113fb2-3e0b-4755-21fa-08da01cb5526 X-MS-TrafficTypeDiagnostic: OSZP286MB2305:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4nvGUn+y/D/oX5Bj9BYwvBGDxE/JCYaGVy2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2KXHiUjOZhljExWdG8ff14VkmMyBvTu6Xm49AXCozXgYZnYNT3u/Ol7AePFZAETgRoVD8NwW4XqAU6oJj+JnWKV1yvk3xkwtnU84J+s/Y92PdYrgh/IzGwS00L1+Jje8iehorFl1Y/nGU9Q6zaoe79bEjWcwXjbjpY8Pvyy+IgbDrVU3eUqbXavLyh9d5Cle6DANXRUvqQGcM9CIjDocDIdBXT9zQ/YFQJJYRl2rmfazn0Mv9ueU6DtaUToW4PigX/YciO6KSIxQlpqTM+Ul/GO2/wLieAtun7dLTNZldiOMMsoiudWihdTh5p1EWjennNV/7LWH2dNAJt4iOuTTe/ADksKthci87IgmXq85j12l67/8I0g8OqddJHsAmopOGTfgnKxmFESeolYTwsGNCrYyv/nVdA0N9AvrJ4ZXZZ7P3nBEiSOQdHHYSNjuV5M4MGoZD75A7frQ20ArezDgfBhchgMIBhO9D/Mb9iGRcDodL37/yt9rtefMoQLLA/ptcFeXwNjyaN3qwB2daBKFA1ts5I+bOzNaHGWsoey hCMNvKVD6XBef+5foO+pQE57GlUifR55a7zKajmsauYwPOiCAgL3nYLcg/uiP/AW9AZlm0i12ovz8jAqfl/QvA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a113fb2-3e0b-4755-21fa-08da01cb5526 X-MS-Exchange-CrossTenant-AuthSource: TYCP286MB1897.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2022 12:50:04.7238 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZP286MB2305 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646830276; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=oCyZkkZSHG1nuxFcOyCTASFSh190WwR8yBbX3hX1BoY=; b=JOi91QnHHKYuZHFlHlvR2oPV3G2k/g9DGS+pqVroGDCGx3DBgj7Ff4dKT2T4mrzk4vkKtJ D5NzdYcYeRJv5cHv75BTAFRu6ROmAafCbFRWMcih0ORqTolypMGVQTWEp1h6EwSyyaBHbW wFseRWoUtLKAkD41x0Fc7LDzkecJjsAStgrYNGFVy21zQZOJ7Z8ZT4t4pQ4+0S/iMyHjnN z3kCiRBKzHKD4XyZNMeFOJJp1f39N5q5g0MEU7E5zUQ++pnCUZOLBE84e5ZlXs5vyhNxeN x3eZFHE5IbkgxoHk+PXbDWgDcQFrJl/u7X7AirTi3yiZw/njPswQASmN4Rlo3Q== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1646830276; a=rsa-sha256; cv=fail; b=G0QhjzJ80zrS42fk+qdXBH6Mjw08F/PPjn5PnMQyoiDYENA2KJVVfqCnmCy69Fk7CUS8wj anZ1Y+PajTCTSB9t0wgdd+qyom5Bra1krTsXnryycyyr/t3kTvJJ4n1RhPQZBc2r8ruedM I12MZTEsYQEkFX0uFTK5lJv7M50hZS8V3AdnuSgRtJT3C0o8IGO+kb5uelNnF9Sg7daijH gaKyikdGi1wYsLUhWGqq2afsSQD9JSgja62Ss6/8z1OZ+IF7AREHvB+rSUOc95kqEu0vkZ 2mwuSCcJH7isYg68gw/ZyWpQIXbD9iMFX1P9GdvUEm59NkQ4k7iVISVWMre35A== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=outlook.com header.s=selector1 header.b=lji6wfZD; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.89 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=outlook.com header.s=selector1 header.b=lji6wfZD; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: DBC9E29E58 X-Spam-Score: 7.89 X-Migadu-Scanner: scn0.migadu.com X-TUID: HlqXwyZHUNlE (lines begin with '>>' are from my previous mail.) Maxime Devos writes: >> I made 'options' an sexp value since there are so many git options >> (see 'man git-config'). > This can be solved with an escape hatch like openssh-configuration's > 'extra-content' and by adding support for new options on an on-demand > basis. If there are lots of options, that just means there's lot to > do, I think. > [...] > Instead of this ad-hoc alist structure, how about introducing some > structure with records, like done for other Guix services, e.g. > 'openssh-configuration' and 'guix-configuration'? > [...] > To elaborate a little, I think the following options are the most > important to support: > user.name, user.email, commiter.name, committer.email > smtp things (for git send-email, important for contributing to guix) > pgp things (important for being a committer in guix) Yes, add a proper record structure will make documentation and type check more viable. I'll try later.. >> I can also symlink the generated gitconfig into ~/.gitconfig, but >> with 'GIT_CONFIG_SYSTEM' it can be used together with hand maintained >> ~/.gitconfig. > The GIT_CONFIG_SYSTEM is less stateful, I like it. There are multiple > variables like these though: GIT_CONFIG_GLOBAL, GIT_CONFIG_SYSTEM and > GIT_CONFIG. My guess is that GIT_CONFIG_GLOBAL would be appropriate > here. Set GIT_CONFIG_GLOBAL will shadow ~/.gitconfig, while GIT_CONFIG_SYSTEM is applied before ~/.gitconfig, so that user can have some out-of guix managed options in ~/.gitconfig if they really want (maybe password?). > =E5=AE=8B=E6=96=87=E6=AD=A6 schreef op ma 07-03-2022 om 22:51 [+0800]: >> Hello, with: >> --8<---------------cut here---------------start------------->8--- >> (service home-git-service-type >> =C2=A0(home-git-configuration >> =C2=A0 (options '((user (name "foo") >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (email "foo@bar.com")))))) [...] > > How about providing an option for passwords? E.g., > > (home-git-configuration > (user (git-user-info > (name "Foobar") > (e-mail "Foobar ") > (signing-key "some PGP fingerprint))) > (secrets-file "/home/foo/the-password") > (smtp (git-smtp-configuration > #;(password "12345") ; not recommended, use 'secrets-file' ins= tead > ...)) > > (with some appropriate documentation) > > secrets-file (not interned in the store): > =20 > # I don't remember the exact option name > smtp.password =3D Foobaz > > the produced .gitconfig would include a line > > [include] > path =3D /home/foo/the-password Um, I can get it with sexp options: --8<---------------cut here---------------start------------->8--- (options '((include (path "/home/foo/the-password")) (include (path "/home/foo/another-file")))) --8<---------------cut here---------------end--------------->8--- Or if with proper record fields, I'd like to keep the original git variables names in scheme too: --8<---------------cut here---------------start------------->8--- (user.name "Foobar") (user.email "foo@bar.com") (include.path (list "/home/foo/the-password" "/home/foo/another-file")) (sendemail.smtpPass "12345" ) --8<---------------cut here---------------end--------------->8--- But with record field name, I don't know how to encode variables with subsection (eg: url..insteadOf): [url "https://mirror.sjtu.edu.cn/git/guix.git"] insteadof =3D https://git.savannah.gnu.org/git/guix.git The subsection name may not be a valid scheme variable name... I'll update this patch with adding doc and proper record fields for some important options later, thank you!