unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch and git
@ 2011-10-03 17:38 Tom Prince
  2011-10-04 15:28 ` Adam Wolfe Gordon
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Prince @ 2011-10-03 17:38 UTC (permalink / raw)
  To: notmuch

I know that having an exclude option for notmuch has been discussed a
number of times. I have wanted such a feature to be able to ignore the
.git directroy, since I keep my mail in a git repository. I recently
discovered a workaround.

If you make .git a text file containing
===== .git ====
gitdir: .notmuch/git
===============
and move the .git directory to .notmuch/git, git will behave as if it is
a normal repository, and notmuch will ignore .notmuch/git. notmuch will
warn once about .git not being a mail file, but since it is static, it
won't warn about it every time one does 'notmuch new'.

  Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: notmuch and git
  2011-10-03 17:38 notmuch and git Tom Prince
@ 2011-10-04 15:28 ` Adam Wolfe Gordon
  0 siblings, 0 replies; 2+ messages in thread
From: Adam Wolfe Gordon @ 2011-10-04 15:28 UTC (permalink / raw)
  To: Tom Prince; +Cc: notmuch

On Mon, Oct 3, 2011 at 11:38, Tom Prince <tom.prince@ualberta.net> wrote:
> I know that having an exclude option for notmuch has been discussed a
> number of times. I have wanted such a feature to be able to ignore the
> .git directroy, since I keep my mail in a git repository. I recently
> discovered a workaround.
>
> If you make .git a text file containing
> ===== .git ====
> gitdir: .notmuch/git
> ===============
> and move the .git directory to .notmuch/git, git will behave as if it is
> a normal repository, and notmuch will ignore .notmuch/git. notmuch will
> warn once about .git not being a mail file, but since it is static, it
> won't warn about it every time one does 'notmuch new'.

I use another workaround, which doesn't require anything in the
notmuch directory:

I initialized a bare repository in /home/adam/.mailgit by running git
init --bare.  Then in my scripts I do:

export GIT_WORK_TREE=/home/adam/mail
cd /home/adam/.mailgit
git ... (any git commands you want)

Git uses the directory specified by GIT_WORK_TREE as the working tree
(where the actual files are), and the current directory as a bare
repository containing just the git metadata.

Because there's nothing git-related in /home/adam/mail, notmuch is
completely unaware of git.

-- 
Adam Wolfe Gordon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-04 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 17:38 notmuch and git Tom Prince
2011-10-04 15:28 ` Adam Wolfe Gordon

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.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).