ryuslash / git-auto-commit-mode

Automatically commit to git after each save
http://projects.ryuslash.org/git-auto-commit-mode/
GNU General Public License v3.0
167 stars 26 forks source link

Interesting! Good combo for org-mode... #3

Closed fullofcaffeine closed 5 years ago

fullofcaffeine commented 9 years ago

I created my personal information manager with Emacs and orgmode, it works extremely well and I would never change it for i.e Evernote. However, even though I have a cronjob that commits the whole org repo every hour (with the timestamp), I do miss a more fine-grained control akin to Google Docs. This might be the answer! Thanks for creating and sharing it!

Out of curiosity - Do you happen have any information on git and number of commits on a repository? I can imagine that by using this tool the number of commits in the repo will grow pretty quickly. Any consequences of having too much commits, any limits?

ryuslash commented 9 years ago

I haven't noticed any problems with regard to limits or anything. The only thing I notice is that sometimes magit can be a little slow showing the status window, but that's because I never push my changes anywhere. Right now I've got a repository with only a few org files and of which only one really gets updated a lot. It contains 414 commits now and I personally don't experience any problems with it. I had a bigger repository before, but I deleted it because I stopped using this project for a while. I didn't notice any problems then either.

I hope this helps and that my project can help you.

belugame commented 5 years ago

@fullofcaffeine Since I also use it in this combo, do you have it by chance working with hooks? I have this in my config but it does nothing. I can clock in and out without new commits being created. Do I need to "save" the file myself?

(add-hook 'org-clock-in-hook 'git-auto-commit-mode)
(add-hook 'org-clock-out-hook 'git-auto-commit-mode)
belugame commented 5 years ago

Ah, nevermind, this works for me: https://emacs.stackexchange.com/a/41049/21642

(add-hook 'org-mode-hook (lambda ()
                           (defadvice org-clock-in (after org-clock-in-after activate) (save-buffer))
                           (defadvice org-clock-out (after org-clock-out-after activate) (save-buffer))))