From 5ec9a8c214159e9dfef0cf44669d563d55e29cd3 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sun, 10 Jul 2016 21:42:42 +0000 Subject: add rule ".". if a repo has a rule set to ".", then all files will be staged and committed. * README.org (rules): add new rule ".". (config): update example config to illustrate the "." rule. * git-difme.scm (build-stage-regex): accommodate new rule ".". --- README.org | 6 +++--- examples/config | 2 +- git-difme.scm | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index e096bf9..2fe230e 100644 --- a/README.org +++ b/README.org @@ -16,6 +16,7 @@ file types: - modified file (M). - deleted file (D). - untracked file (?). + - all files (.). the rules are defined per git repository in the config file. @@ -34,7 +35,7 @@ function: (list '("/path/to/git/repo/foo" "M" "D" "?") '("/path/to/git/repo/bar" "M") '("/path/to/git/repo/baz" "M" "?") - '("/path/to/git/repo/frb"))) + '("/path/to/git/repo/frb" "."))) #+END_SRC - for repo ~foo~, git difm will only stage and commit modified (M), @@ -43,8 +44,7 @@ function: files. - for repo ~baz~, git difm will only stage and commit modified (M) and untracked (?) files. -- for repo ~frb~, git difm will only stage and commit all types of - files. +- for repo ~frb~, git difm will stage and commit all files. ** installing diff --git a/examples/config b/examples/config index b7a2010..db8eba1 100644 --- a/examples/config +++ b/examples/config @@ -6,4 +6,4 @@ (list '("/path/to/git/repo/foo" "M" "D" "?") '("/path/to/git/repo/bar" "M") '("/path/to/git/repo/baz" "M" "?") - '("/path/to/git/repo/frb"))) + '("/path/to/git/repo/frb" "."))) diff --git a/git-difme.scm b/git-difme.scm index 9226c14..301fa54 100644 --- a/git-difme.scm +++ b/git-difme.scm @@ -130,7 +130,8 @@ the commit message will be in the following format: (define (build-stage-regex rules) "build stage regex based on RULES." (let ((regex "^")) - (cond ((null? rules) (string-append regex ".")) + (cond ((null? rules) (string-append regex "$")) + ((member "." rules) ".") (else (string-append regex "[" (string-concatenate rules) "]"))))) -- cgit v1.2.3