News for hackers. Stuff that matters.
Re:Etckeeper lets you store changes in /etc to git by deelowe on Sunday April 28, 2013 @06:24PM (#5623045)
Is there something like this that works for arbitrary files or directories? Basically, I'd like to have something that monitors files and/or directories for changes and then stores the diffs in git possibly via a cron job or a daemon using inotify? Anything analogous to this would be great.

I've contemplated writing something like this myself many times, but time is just not something I have a lot of these days.

Re:Etckeeper lets you store changes in /etc to git by dfc on Sunday April 28, 2013 @07:47PM (#5623354)
At first I thought this was a cute lead up to git-annex and then I realized it was a straight forward question and that you want incremental diffs. You should take a look at git-annex[1] one of joey's other projects if the diff feature is not a deal breaker.

"git-annex allows managing files with git, without checking the file contents into git. While that may seem paradoxical, it is useful when dealing with files larger than git can currently easily handle, whether due to limitations in memory, time, or disk space.

git-annex is designed for git users who love the command line. For everyone else, the git-annex assistant turns git-annex into an easy to use folder synchroniser."

The only joeyh project that I use more than git-annex or etckeeper is moreutils.[2] (Obviously I'm not including joey's enormous contributions to Debian) Included in moreutils:

  chronic: runs a command quietly unless it fails
  combine: combine the lines in two files using boolean operations
  ifdata: get network interface info without parsing ifconfig output
  ifne: run a program if the standard input is not empty
  isutf8: check if a file or standard input is utf-8
  lckdo: execute a program with a lock held
  mispipe: pipe two commands, returning the exit status of the first
  parallel: run multiple jobs at once
  pee: tee standard input to pipes
  sponge: soak up standard input and write to a file
  ts: timestamp standard input
  vidir: edit a directory in your text editor
  vipe: insert a text editor into a pipe
  zrun: automatically uncompress arguments to command
The only program that I never have a use for is ts, I use tai64n[3] from djb.

[1] http://git-annex.branchable.com/

[2] http://joeyh.name/code/moreutils/

[3] http://cr.yp.to/daemontools/tai64n.html

Re:Etckeeper lets you store changes in /etc to git by joeyh on Sunday April 28, 2013 @09:43PM (#5623656)
Recently the git-annex assistant has gained the ability to check selected files directly into git, so you can have your diffs too if you want them.

http://git-annex.branchable.com/design/assistant/blog/day_22...

Re:Etckeeper lets you store changes in /etc to git by ibrahima on Sunday April 28, 2013 @07:33PM (#5623304)
http://sparkleshare.org/ is sort of a Dropbox clone backed by git, that might be what you want. There are a few other things in this space but Sparkleshare, by virtue of aiming to replace Dropbox, is the most polished IMO. There's also this script called gitwatch that does pretty much exactly what you want without the GUI: https://github.com/n3v1k/gitwatch . I guess if you don't need to push to a remote repository automatically this would be the better option (and you can easily stick in push/pull in the right place in the bash script if you want).