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"))
This commit is contained in:
Tom Willemse 2013-05-19 23:05:31 +02:00
parent d2db2dfb53
commit e2c303c420

View file

@ -28,6 +28,9 @@
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:export (main)) #:export (main))
(define config-exclusion-list '()
"A list of strings naming the repositories to be left alone.")
(define (storage-dir xdg-env fallback) (define (storage-dir xdg-env fallback)
(let ((xdg (getenv xdg-env))) (let ((xdg (getenv xdg-env)))
(string-append (string-append
@ -149,11 +152,12 @@ gitto [options]
(define (update-config) (define (update-config)
(for-each (lambda (repo) (for-each (lambda (repo)
(write-config (unless (member (repo-name repo) config-exclusion-list)
(merge-config (repo-name repo) (write-config
(read-config (repo-location repo)) (merge-config (repo-name repo)
global-config) (read-config (repo-location repo))
(string-append (repo-location repo) "/.git/config"))) global-config)
(string-append (repo-location repo) "/.git/config"))))
repositories)) repositories))
(define option-spec (define option-spec