bug#58813: [PATCH 3/5] teams: Add a configure-git action.

2023-04-23 Thread Maxim Cournoyer
Hi Liliana,

Liliana Marie Prikler  writes:

> Am Sonntag, dem 23.04.2023 um 12:04 -0400 schrieb Maxim Cournoyer:
>> * etc/git/gitconfig: Augment configuration template with useful
>> options to
>> allow for auto-configuration.
>> * etc/teams.scm.in (configure-git): New procedure.
>> (main): Register it and add documentation.
> I think configure-git is somewhat out of scope inside teams.scm.  We do
> already tell people to set up their push hooks, so we probably ought to
> solve this via documentation (or a separate dedicated script) as well.

You're right that it feels a bit out of place.  The other idea I had was
to add it as a Makefile target.  This one would have the benefit of
being smart about when to re-run the command (if the gitconfig or
pre-push files changed).

Would that fit better?

> Otherwise LGTM.

OK!  Thanks for weighing in.

-- 
Thanks,
Maxim





bug#58813: [PATCH 3/5] teams: Add a configure-git action.

2023-04-23 Thread Liliana Marie Prikler
Am Sonntag, dem 23.04.2023 um 12:04 -0400 schrieb Maxim Cournoyer:
> * etc/git/gitconfig: Augment configuration template with useful
> options to
> allow for auto-configuration.
> * etc/teams.scm.in (configure-git): New procedure.
> (main): Register it and add documentation.
I think configure-git is somewhat out of scope inside teams.scm.  We do
already tell people to set up their push hooks, so we probably ought to
solve this via documentation (or a separate dedicated script) as well.

Otherwise LGTM.

Cheers





bug#58813: [PATCH 3/5] teams: Add a configure-git action.

2023-04-23 Thread Maxim Cournoyer
* etc/git/gitconfig: Augment configuration template with useful options to
allow for auto-configuration.
* etc/teams.scm.in (configure-git): New procedure.
(main): Register it and add documentation.
---
 etc/git/gitconfig | 15 +++
 etc/teams.scm.in  | 12 +++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/etc/git/gitconfig b/etc/git/gitconfig
index c9ebdc8fa8..0b6984a05f 100644
--- a/etc/git/gitconfig
+++ b/etc/git/gitconfig
@@ -1,5 +1,20 @@
+[commit]
+gpgsign = true
+
 [diff "scheme"]
xfuncname = "^(\\(define.*)$"
 
 [diff "texinfo"]
xfuncname = "^@node[[:space:]]+([^,]+).*$"
+
+[format]
+useAutoBase = true
+thread = shallow
+
+[pull]
+rebase = true
+
+[sendemail]
+to = guix-patc...@gnu.org
+headerCmd = etc/teams.scm cc-members-header-cmd
+thread = no
diff --git a/etc/teams.scm.in b/etc/teams.scm.in
index 408db8b7d5..8203446446 100644
--- a/etc/teams.scm.in
+++ b/etc/teams.scm.in
@@ -36,8 +36,9 @@
  (ice-9 regex)
  (ice-9 match)
  (ice-9 rdelim)
+ (git)
  (guix ui)
- (git))
+ (guix build utils))
 
 (define-record-type 
   (make-team id name description members scope)
@@ -702,6 +703,11 @@ (define (patch->teams patch-file)
(find-team-by-scope (apply diff-revisions
   (git-patch->revisions patch-file)
 
+(define (configure-git)
+  "Automate the required Git configurations for the Guix project."
+  (invoke "git" "config" "include.path" "../etc/git/gitconfig")
+  (copy-file "etc/git/pre-push" ".git/hooks/pre-push"))
+
 
 (define (main . args)
   (match args
@@ -719,6 +725,8 @@ (define (main . args)
  (list-members (find-team team-name) (current-output-port)
"X-Debbugs-Cc: "))
(patch->teams patch-file)))
+(("configure-git")
+ (configure-git))
 (("get-maintainer" patch-file)
  (apply main "list-members" (patch->teams patch-file)))
 (("list-teams" . args)
@@ -739,6 +747,8 @@ (define (main . args)
   cc teams related to files changed between revisions or in a patch file
   cc-members-header-cmd 
   cc-members variant for use with 'git send-email --header-cmd'
+  configure-git
+  automatically configure your Git checkout for Guix
   list-teams
   list teams and their members
   list-members 
-- 
2.39.2