magithub
magithub copied to clipboard
question about GIT_DIR for magithub-issue-personal-note
Thanks for magithub! This is a neat project which I'm enjoying getting familiar with.
I particularly like the magithub-issue-personal-note function. I'd love to be able to have my personal notes available on multiple machines, though. For example, it would be great if these would go in my Dropbox directory. A quick glance at the code suggests that to get my personal issue notes in a different directory, I could just change GIT_DIR. But actually doing that produces an error message and points me to https://github.com/magit/magit/wiki/Don't-set-$GIT_DIR-and-alike
So my question (most probably a feature enhancement request) is how do I get my personal issue notes to showup in a different place (e.g., in my dropbox directory instead of something like ~/.emacs.d/magithub/<org>/<repo>/notes/.
Thanks.
You should be able to give magithub-dir an appropriate value – unless I'm mistaken, it already is in .emacs.d:
(defun magithub-issue-personal-note-file (issue-or-pr)
"Return an absolute filename appropriate for ISSUE-OR-PR."
(let-alist `((repo . ,(magithub-repo (magithub-issue-repo issue-or-pr)))
(issue . ,issue-or-pr))
(expand-file-name
(format "%s/%s/notes/%d.org" .repo.owner.login .repo.name .issue.number)
magithub-dir)))
Thanks for the quick response. That clarifies things.
Is it OK to set magithub-dir to be a Dropbox directory? Would that cause problems with the cache? If so, I could rewrite magithub-issue-personal-note-file to check for a user specified notes directory.
The only effect that would have on the cache is re dropbox syncing. The cache is written to on emacs-close and every 10 minutes of idle time. If you're ok with that, then setting magithub-dir to your dropbox should be just fine :-)