emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Conditional .gitignore for org-mode files
@ 2015-04-26 22:39 David Dynerman
  2015-04-27 15:11 ` Richard Lawrence
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Dynerman @ 2015-04-26 22:39 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi all,

Sorry in advance, this might be more of a git question than an org-mode
question, but I thought someone on this list might know the answer.

Is it possible to conditionally gitignore certain files based on files
that are being tracked?

What I'd like is something like the following gitignore logic:

if filename.org is tracked by git:
   ignore filename.tex, filename.html

If this isn't possible, does anyone have any nice setups for ignoring
exported versions of org-mode files?

Thanks,
David



   

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

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

* Re: Conditional .gitignore for org-mode files
  2015-04-26 22:39 Conditional .gitignore for org-mode files David Dynerman
@ 2015-04-27 15:11 ` Richard Lawrence
  2015-04-27 15:11 ` Samuel Loury
  2015-07-21 20:58 ` Grant Rettke
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Lawrence @ 2015-04-27 15:11 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: David Dynerman

Hi David,

David Dynerman <david@block-party.net> writes:

> Sorry in advance, this might be more of a git question than an org-mode
> question, but I thought someone on this list might know the answer.
>
> Is it possible to conditionally gitignore certain files based on files
> that are being tracked?
>
> What I'd like is something like the following gitignore logic:
>
> if filename.org is tracked by git:
>    ignore filename.tex, filename.html
>
> If this isn't possible, does anyone have any nice setups for ignoring
> exported versions of org-mode files?

Unfortunately, I don't know how to do what you asked, but what I tend to
do in this situation is to run my exports in a build/ subdirectory, and
then add

build*

to my .gitignore.  Maybe that would work for you?

Best,
Richard

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

* Re: Conditional .gitignore for org-mode files
  2015-04-26 22:39 Conditional .gitignore for org-mode files David Dynerman
  2015-04-27 15:11 ` Richard Lawrence
@ 2015-04-27 15:11 ` Samuel Loury
  2015-07-21 20:58 ` Grant Rettke
  2 siblings, 0 replies; 4+ messages in thread
From: Samuel Loury @ 2015-04-27 15:11 UTC (permalink / raw)
  To: David Dynerman, emacs-orgmode

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

Dear David,
David Dynerman <david@block-party.net> writes:

> What I'd like is something like the following gitignore logic:
>
> if filename.org is tracked by git:
>    ignore filename.tex, filename.html
>
> If this isn't possible, does anyone have any nice setups for ignoring
> exported versions of org-mode files?

The manual of gitignore indicates that gitignore don't handle other
behaviors than pattern matching.

--8<---------------cut here---------------start------------->8---
man gitignore
--8<---------------cut here---------------end--------------->8---

My workaround is simply to gather org files into a same directory and
add git ignore rules for each kind of generated file.

--8<---------------cut here---------------start------------->8---
*.html
*.tex
*.ps
*.pdf
--8<---------------cut here---------------end--------------->8---

Hope that helps,
-- 
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* Re: Conditional .gitignore for org-mode files
  2015-04-26 22:39 Conditional .gitignore for org-mode files David Dynerman
  2015-04-27 15:11 ` Richard Lawrence
  2015-04-27 15:11 ` Samuel Loury
@ 2015-07-21 20:58 ` Grant Rettke
  2 siblings, 0 replies; 4+ messages in thread
From: Grant Rettke @ 2015-07-21 20:58 UTC (permalink / raw)
  To: David Dynerman; +Cc: emacs-orgmode@gnu.org

Say you add ignore for all generated files like mentioned. That will
cover what you need because you can `git add --force' file patterns
that are on the ignore list.
Grant Rettke
--
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
“All creativity is an extended form of a joke.” --Kay
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Sun, Apr 26, 2015 at 5:39 PM, David Dynerman <david@block-party.net> wrote:
> Hi all,
>
> Sorry in advance, this might be more of a git question than an org-mode
> question, but I thought someone on this list might know the answer.
>
> Is it possible to conditionally gitignore certain files based on files
> that are being tracked?
>
> What I'd like is something like the following gitignore logic:
>
> if filename.org is tracked by git:
>    ignore filename.tex, filename.html
>
> If this isn't possible, does anyone have any nice setups for ignoring
> exported versions of org-mode files?
>
> Thanks,
> David
>
>
>
>

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

end of thread, other threads:[~2015-07-21 20:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-26 22:39 Conditional .gitignore for org-mode files David Dynerman
2015-04-27 15:11 ` Richard Lawrence
2015-04-27 15:11 ` Samuel Loury
2015-07-21 20:58 ` Grant Rettke

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