all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: 宋文武 <iyzsong@outlook.com>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 54293@debbugs.gnu.org
Subject: [bug#54293] [WIP] home: Add home-git-service-type
Date: Wed, 09 Mar 2022 20:50:06 +0800	[thread overview]
Message-ID: <TYCP286MB1897E2E996F847CF73C617D3A30A9@TYCP286MB1897.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <4802fd5bd14e6d73ca8205edab1e38580db7dd0c.camel@telenet.be> (Maxime Devos's message of "Mon, 07 Mar 2022 19:11:16 +0100")

(lines begin with '>>' are from my previous mail.)

Maxime Devos <maximedevos@telenet.be> 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?).


> 宋文武 schreef op ma 07-03-2022 om 22:51 [+0800]:
>> Hello, with:
>> --8<---------------cut here---------------start------------->8---
>> (service home-git-service-type
>>  (home-git-configuration
>>   (options '((user (name "foo")
>>                    (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 <foo@bar.com>")
>            (signing-key "some PGP fingerprint)))
>    (secrets-file "/home/foo/the-password")
>    (smtp (git-smtp-configuration
>            #;(password "12345") ; not recommended, use 'secrets-file' instead
>            ...))
>
> (with some appropriate documentation)
>
> secrets-file (not interned in the store):
>   
>   # I don't remember the exact option name
>   smtp.password = Foobaz
>
> the produced .gitconfig would include a line
>
>   [include]
>     path = /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.<base>.insteadOf):

  [url "https://mirror.sjtu.edu.cn/git/guix.git"]
    insteadof = 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!




  reply	other threads:[~2022-03-09 12:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 14:51 [bug#54293] [WIP] home: Add home-git-service-type 宋文武
2022-03-07 17:58 ` Maxime Devos
2022-03-09 12:18   ` 宋文武
2022-03-07 18:01 ` Maxime Devos
2022-03-07 18:12   ` Maxime Devos
2022-03-07 18:02 ` Maxime Devos
2022-03-07 18:04 ` Maxime Devos
2022-03-07 18:11 ` Maxime Devos
2022-03-09 12:50   ` 宋文武 [this message]
2022-03-12 22:27     ` Maxime Devos
2022-03-12  2:22 ` [bug#54293] [PATCH v2] " iyzsong
2022-03-12  9:51   ` Maxime Devos
2022-03-12  9:54   ` Maxime Devos
2022-03-29 13:56     ` [bug#54293] [WIP] " Ludovic Courtès
2022-03-12  9:58   ` [bug#54293] [PATCH v2] " Maxime Devos
2022-03-12 10:02   ` Maxime Devos
2022-03-12 10:03   ` Maxime Devos
2022-03-12 10:11   ` Maxime Devos
2022-03-12 10:12   ` Maxime Devos
2022-03-12 10:21   ` Maxime Devos
2022-03-12 10:24   ` Maxime Devos
2022-03-12 10:26   ` Maxime Devos
2022-03-12 10:31   ` Maxime Devos
2022-03-12 10:39   ` Maxime Devos
2022-05-21 13:47   ` [bug#54293] [WIP] " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=TYCP286MB1897E2E996F847CF73C617D3A30A9@TYCP286MB1897.JPNP286.PROD.OUTLOOK.COM \
    --to=iyzsong@outlook.com \
    --cc=54293@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.