-
Notifications
You must be signed in to change notification settings - Fork 3
/
git-meta.1
289 lines (287 loc) · 5.95 KB
/
git-meta.1
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
'\" t
.\" Title: git-meta
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 01/04/2016
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "GIT\-META" "1" "01/04/2016" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-meta \- Handle file meta information within git
.SH "SYNOPSIS"
.sp
git\-meta [ options ] command
.SH "DESCRIPTION"
.sp
Git (currently) cannot handle file system meta information such as permissions, last modification time or ownership (both user and group)\&. Here comes git\-meta to fix this in some cases where these informations are mandatory or simply useful\&.
.sp
All informations are stored in a \&.gitmeta file managed itself by git\&.
.sp
Using git hooks may automate the backup and restore process\&.
.SH "OPTIONS"
.PP
\-\-data DATA
.RS 4
Set the
git\-meta
database file (default:
\fI\&.gitmeta\fR)\&.
.RE
.PP
\-f|\-\-force
.RS 4
Force writing data even if no modification has been done in the git tree\&. By default
git\-meta
does not run if no modification has been done to prevent from massive git change set creation\&.
.RE
.PP
\-h|\-\-help
.RS 4
Display help screen\&.
.RE
.PP
\-a|\-\-add\-to\-git
.RS 4
Add database to the git commit list\&.
.RE
.PP
\-O|\-\-owner
.RS 4
Store symbolic file ownership to the database\&.
.RE
.PP
\-o|\-\-numeric\-owner
.RS 4
Store numeric file ownership to the database\&.
.RE
.PP
\-P|\-\-skip\-perms
.RS 4
Skip file perms during restore\&.
.RE
.PP
\-M|\-\-skip\-mtime
.RS 4
Skip file mtime during store/restore operations\&. The mtime is not written into the database\&.
.RE
.PP
\-U|\-\-skip\-user
.RS 4
Skip file owner during restore\&.
.RE
.PP
\-G|\-\-skip\-group
.RS 4
Skip group owner during restore\&.
.RE
.PP
\-i|\-\-ignore BRANCH
.RS 4
Branch on witch
git\-meta
is ignored\&. This is treated as a regexp\&. This option can be specified several times\&. if not specfied, values are search in the
meta\&.ignore
git configuration key\&.
.RE
.SH "COMMANDS"
.PP
get
.RS 4
Store metadata to database\&.
.RE
.PP
set
.RS 4
Restore metadata from database\&.
.RE
.PP
dump
.RS 4
Dump metadata from database\&.
.RE
.PP
init
.RS 4
Create hooks in git hooks directory\&.
.RE
.SH "DATABASE FORMAT"
.sp
The database format is quiet simple\&. It consists of a JSON dump of a dictionnary for which the file name is the key and the file attributes are the values\&. dictionnary\&.
.SS "Dictionnary format"
.sp
The key is composed of the full filename path starting from the git repository root\&.
.sp
Each values are:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mode: the file permissions in decimal format\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mtime: the file mtime in seconds since Epoch\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
uid: the file owner (in numerical or symbolic format)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
gid: the file group (in numerical or symbolic format)\&.
.RE
.SS "File ownership"
.sp
File ownership (both owner and group) are either:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Not stored at all if neighter the
\fI\-o\fR
nor
\fI\-O\fR
option is given\&. This might be used if the files ownership may change from one system to an other\&. Generally this should be used in almost all cases\&. Otherwise a large amount of changesets could pollute git commits\&. In that case the last 2 fields (both owner and group) of each record are not present in the database\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Stored in symbolic format if
\fI\-O\fR
is given\&. This option should be used if symbolic ownership are the same in all systems (for keeping track of
\fI/etc\fR
changes for example)\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Stored in numerical format if
\fI\-o\fR
is given\&. This option should be used if numerical ownerships are the same in all systems\&.
.RE
.SH "USING WITH GIT HOOKS"
.sp
Manual use git\-meta is not that much handy\&. It can be configured to be used directly withing githooks(5), specially \fBpre\-commit\fR for the backup and \fBpost\-merge\fR for the restore\&.
.SS "pre\-commit example"
.sp
.if n \{\
.RS 4
.\}
.nf
#!/bin/sh
git meta \-a get || true
.fi
.if n \{\
.RE
.\}
.SS "post\-merge example"
.sp
.if n \{\
.RS 4
.\}
.nf
#!/bin/sh
git meta set || true
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.sp
git(1), githooks(5)\&.
.SH "HISTORY"
.PP
2014/04/24
.RS 4
Add ignore option
.RE
.PP
2014/03/02
.RS 4
Rewite script in python
.RE
.PP
2011/09/11
.RS 4
Add init command\&.
.RE
.PP
2011/03/26
.RS 4
First public release\&.
.RE
.SH "BUGS"
.sp
No time to include bugs, command actions might seldom lead astray user\(cqs assumption\&.
.SH "AUTHORS"
.sp
git\-meta is written by S\('ebastien Gross <seb\(buɑƬ\(buchezwam\(buɖɵʈ\(buorg>\&.
.SH "COPYRIGHT"
.sp
Copyright \(co 2011\-2014 S\('ebastien Gross <seb\(buɑƬ\(buchezwam\(buɖɵʈ\(buorg>\&.
.sp
Relased under WTFPL (\m[blue]\fBhttp://sam\&.zoy\&.org/wtfpl/COPYING\fR\m[])\&.