aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-05-19 23:05:31 +0200
committerGravatar Tom Willemse2013-05-19 23:05:31 +0200
commite2c303c420944e2864eb3f12ecea02df0fbd7a7f (patch)
treecd81d16c3ff997a7fb3fee74a187ab016ddf8c98
parentd2db2dfb5329de1a5b15e5658bfd247764d0f81d (diff)
downloadgitto-e2c303c420944e2864eb3f12ecea02df0fbd7a7f.tar.gz
gitto-e2c303c420944e2864eb3f12ecea02df0fbd7a7f.zip
Add exclusion list
The variable `config-exclusion-list' can be used to specify project names that should not have their configuration overwritten by `gitto --update-config'. It is a normal list of strings which name the repositories that should be left alone, like so: (set! config-exclusion-list '("repo1" "repo2" "repo3"))
-rw-r--r--gitto/main.scm14
1 files changed, 9 insertions, 5 deletions
diff --git a/gitto/main.scm b/gitto/main.scm
index 34f9866..bd9af49 100644
--- a/gitto/main.scm
+++ b/gitto/main.scm
@@ -28,6 +28,9 @@
#:use-module (srfi srfi-1)
#:export (main))
+(define config-exclusion-list '()
+ "A list of strings naming the repositories to be left alone.")
+
(define (storage-dir xdg-env fallback)
(let ((xdg (getenv xdg-env)))
(string-append
@@ -149,11 +152,12 @@ gitto [options]
(define (update-config)
(for-each (lambda (repo)
- (write-config
- (merge-config (repo-name repo)
- (read-config (repo-location repo))
- global-config)
- (string-append (repo-location repo) "/.git/config")))
+ (unless (member (repo-name repo) config-exclusion-list)
+ (write-config
+ (merge-config (repo-name repo)
+ (read-config (repo-location repo))
+ global-config)
+ (string-append (repo-location repo) "/.git/config"))))
repositories))
(define option-spec