emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Charles Philip Chan <cpchan@bell.net>
To: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Store org-files in a git repository?
Date: Fri, 7 Sep 2012 20:26:45 -0400	[thread overview]
Message-ID: <BLU0-SMTP98E0AC23DB7C066066C044BBAE0@phx.gbl> (raw)
In-Reply-To: <CACHMzOF1LNSJ25j6OmiJXEDhxzTQpLabRUpw4HLhCSAMf9D5fA@mail.gmail.com> (Marcelo de Moraes Serpa's message of "Fri, 7 Sep 2012 18:57:53 -0500")

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]

Marcelo de Moraes Serpa <celoserpa@gmail.com> writes:

Hello Marcelo and Moritz:

> I have not done yet, but I do use git for my org repo; however, I
> commit every 6 hours via cron (and the commit message is a timestamp).

I have my org repo under git too. However, instead of a cron job, I use
an after-save-hook:

#+BEGIN_SRC emacs-lisp
;;Git integration
(defun git-commit ()
  (when (eq major-mode 'org-mode)
      (shell-command "git commit -a -m 'Auto commit.'")))

      (add-hook 'after-save-hook 'git-commit)
#+END_SRC

Also, I am not too sure how practical Moritz's idea is. In order to get
that fine level of commit, org-mode will have to save the file after
each operation.

Cheers,
Charles

-- 
There are no threads in a.b.p.erotica,  so there's no  gain in using a
threaded news reader.
(Unknown source)

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2012-09-08  0:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07 23:28 Store org-files in a git repository? Moritz Ulrich
2012-09-07 23:57 ` Marcelo de Moraes Serpa
2012-09-08  0:26   ` Charles Philip Chan [this message]
2012-09-08  8:45 ` Achim Gratz
2012-09-10 22:23   ` Moritz Ulrich
2012-09-11  2:18     ` Marcelo de Moraes Serpa
2012-09-11 18:11       ` Achim Gratz
2012-09-14 11:15     ` Bernt Hansen
2012-09-12 14:18 ` Bastien
2012-09-12 16:52   ` Samuel Wales
2012-09-13 18:05     ` Marcelo de Moraes Serpa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BLU0-SMTP98E0AC23DB7C066066C044BBAE0@phx.gbl \
    --to=cpchan@bell.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).