Skip to content

question about GIT_DIR for magithub-issue-personal-note #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
emin63 opened this issue Jan 24, 2019 · 3 comments
Open

question about GIT_DIR for magithub-issue-personal-note #398

emin63 opened this issue Jan 24, 2019 · 3 comments

Comments

@emin63
Copy link

emin63 commented Jan 24, 2019

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.

@vermiculus
Copy link
Owner

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)))

@emin63
Copy link
Author

emin63 commented Jan 25, 2019

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.

@vermiculus
Copy link
Owner

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants