summaryrefslogtreecommitdiffstats
path: root/README.org
blob: 6a5806e0e9c590eb5d754cdaa7c06a4300bcc8b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
* git-difme

#+BEGIN_QUOTE
git, do it for me
#+END_QUOTE

[[[https://git.ricketyspace.net/git-difme][repo]]]

#+BEGIN_SRC bash
git clone git://git.ricketyspace.net/git-difme.git
#+END_SRC

stages files and makes commits on a list of git repositories based on
some rules.

it always does a =git push= on each repo that it visits.

** rules
the rules specify what type of files to stage and commit.

a rule can either be a regex that matches a file or a file mod type.

the following file mod types are recognized:

   - =M= :: modified file.
   - =D= :: deleted file.
   - =?= :: untracked file.
   - =.= :: all files.

the rules are defined per git repository in the config file.

if git-difme finds already staged files, it'll commit them first
before doing anything.

** config
the config file must be at =~/.config/git-difme/config=.

the config is simply a scheme file that defines the =difme-repos=
function:

#+BEGIN_SRC scheme
(define (difme-repos)
  (list '("/path/to/git/repo/foo" "M" "D" "?")
        '("/path/to/git/repo/bar" "M")
        '("/path/to/git/repo/baz" ".")
        '("/path/to/git/repo/frb" "\\.txt" "personal/log.org" "?")
        '("/path/to/git/repo/dot" ".config/")))
#+END_SRC

- for repo ~foo~, git-difme will stage and commit modified (M), deleted
  (D) and untracked (?) files.
- for repo ~bar~, git-difme will only stage and commit modified (M)
  files.
- for repo ~baz~, git-difme will stage and commit all files (.).
- for repo ~frb~, git-difme will stage and commit all files that have
  =.txt= extension, file(s) whose path matches =personal/log.org=, and
  all untracked files (?).
- for repo ~dot~, git-difme will stage and commit all files under the
  =.config= directory.

** installing
*** the script

=git-difme= is written in [[https://gnu.org/s/guile][guile]]. first [[https://ricketyspace.net/git-difme/install-guile][install guile]], then do:

#+BEGIN_SRC bash
make git-difme
#+END_SRC

that will install the =git-difme= script at =~/.bin/git-difme=.

add =~/.bin/= to =PATH=.

*** the config file

#+BEGIN_SRC bash
make config
#+END_SRC

that will install a sample config file at =~/.config/git-difme=.

** running

#+BEGIN_SRC bash
git-difme
#+END_SRC

will do it.

** license
gnu general public license version 3 or higher.