Skip to content
forked from renard/git-meta

Handle file meta information within git

Notifications You must be signed in to change notification settings

rlaboiss/git-meta

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

git-meta(1)

NAME

git-meta - Handle file meta information within git

SYNOPSIS

git-meta [ options ] command

DESCRIPTION

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.

All informations are stored in a .gitmeta file managed itself by git.

Using git hooks may automate the backup and restore process.

OPTIONS

--data DATA

Set the git-meta database file (default: '.gitmeta').

-f|--force

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.

-h|--help

Display help screen.

-a|--add-to-git

Add database to the git commit list.

-O|--owner

Store symbolic file ownership to the database.

-o|--numeric-owner

Store numeric file ownership to the database.

-P|--skip-perms

Skip file perms during restore.

-M|--skip-mtime

Skip file mtime during store/restore operations. The mtime is not written into the database.

-U|--skip-user

Skip file owner during restore.

-G|--skip-group

Skip group owner during restore.

-i|--ignore BRANCH

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.

COMMANDS

get

Store metadata to database.

set

Restore metadata from database.

dump

Dump metadata from database.

init

Create hooks in git hooks directory.

DATABASE FORMAT

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.

Dictionnary format

The key is composed of the full filename path starting from the git repository root.

Each values are:

  • mode: the file permissions in decimal format.

  • mtime: the file mtime in seconds since Epoch.

  • uid: the file owner (in numerical or symbolic format).

  • gid: the file group (in numerical or symbolic format).

File ownership

File ownership (both owner and group) are either:

  • Not stored at all if neighter the '-o' nor '-O' 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.

  • Stored in symbolic format if '-O' is given. This option should be used if symbolic ownership are the same in all systems (for keeping track of '/etc' changes for example).

  • Stored in numerical format if '-o' is given. This option should be used if numerical ownerships are the same in all systems.

USING WITH GIT HOOKS

Manual use git-meta is not that much handy. It can be configured to be used directly withing githooks(5), specially pre-commit for the backup and post-merge for the restore.

pre-commit example

#!/bin/sh

git meta -a get || true

post-merge example

#!/bin/sh

git meta set || true

SEE ALSO

git(1), githooks(5).

HISTORY

2014/04/24

Add ignore option

2014/03/02

Rewite script in python

2011/09/11

Add init command.

2011/03/26

First public release.

BUGS

No time to include bugs, command actions might seldom lead astray user’s assumption.

AUTHORS

git-meta is written by Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>.

Copyright © 2011-2014 Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>.

About

Handle file meta information within git

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 61.8%
  • Roff 38.2%