From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: org files and projects nested git repositories Date: Fri, 01 Jan 2016 07:33:47 -0500 Message-ID: References: <87oad6ldqv.fsf@plantarum.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEyu1-0003i1-8b for emacs-orgmode@gnu.org; Fri, 01 Jan 2016 07:33:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aEyty-0002dt-Si for emacs-orgmode@gnu.org; Fri, 01 Jan 2016 07:33:53 -0500 Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:33877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEyty-0002do-MH for emacs-orgmode@gnu.org; Fri, 01 Jan 2016 07:33:50 -0500 Received: by mail-qg0-x231.google.com with SMTP id 6so136825781qgy.1 for ; Fri, 01 Jan 2016 04:33:50 -0800 (PST) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: orgmode list , Tyler Smith On 2016-01-01 at 05:02, Alan Schmitt wrote: > Hello Ken, >> >> On my system this is a git repository and a cron (or actually >> LaunchAgent since I'm on OS X) does a =git commit -a >> = every night. > > I'm very interested about this. Could you please share your LaunchAgent > configuration file? I miss the simpler days of cron, but when in Rome or on OS X... The following is ~/Library/LaunchAgents/com.kenmankoff.orggit.plist Label com.kenmankoff.orggit ProgramArguments /Users/mankoff/bin/orggitcommit.sh RunAtLoad StartInterval 86400 Which runs the following shell script: #!/usr/bin/env bash cd ~/Documents/Org/ /usr/local/bin/git commit -a -m "`/bin/date +%Y-%m-%d\ %T`" Run the following 1x: cd ~/Library/LaunchAgents/ launchctl load com.kenmankoff.orggit Then in my Org folder, =git lg= (aliased to git log --graph --pretty=format:'%C(red)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad)' --abbrev-commit --date=short) shows: * 926cfa9 - 2015-12-30 12:51:55 (2015-12-30) * cac0191 - 2015-12-22 08:53:39 (2015-12-22) * be839e2 - 2015-12-20 01:32:03 (2015-12-20) * 9a68231 - 2015-12-17 09:26:40 (2015-12-17) * 9782112 - 2015-12-16 09:26:36 (2015-12-16) * d7df50c - 2015-12-15 21:27:53 (2015-12-15) * 635a0fa - 2015-12-15 17:41:55 (2015-12-15) * 72cafc1 - 2015-12-14 11:08:48 (2015-12-14) So you can see things get checked in to git about once every few days, unless my laptop is closed a lot like it just was over the holidays. If you wanted more frequent commits, LaunchAgents can run every time a file in a folder is saved. If that is too often, a middle ground could be to run the bash script every time a file is saved, but have that script only do the commit if it has been >12 or >24 hours, using the "find -newer" command, for example. Or only if >n lines have changed (from git diff). -k.