git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: more fancy ignoring of files ('if' in .gitignore?)

From
Paolo Bonzini <bonzini@gnu.org>
Date
Oct 27, 2009, 10:00 UTC
Message-ID
<4AE6C4BB.5060403@gnu.org>
In-Reply-To
<200910271030.54571.schubert.seb@googlemail.com>
On 10/27/2009 10:30 AM, Sebastian Schubert wrote:
Show 9 quoted lines
> Hi,
>
> I would like to ignore files if certain other files are present. In my
> special case, I want to ignore foo.pdf and foo.eps if foo.fig is
> present (both pdf and eps are generated on the fly but don't belong
> into repository). In general, I do NOT want to ignore pdf or eps. There
> are a lot of foos so I would like to have a general solution.
>
> Is this possible?
I suggesting adding to your makefile a rule like
.gitignore: $(wildcard *.fig)
	(grep -ve \.pdf$ \.eps$ .gitignore;
	for i in $^; do echo $i; done | \
		sed -n 's/fig$/eps/p; s/eps$/pdf/p') > .gitignore.tmp
	mv .gitignore.tmp .gitignore
Paolo
Previous: Michael J Gruber
Message 3 of 3 in “more fancy ignoring of files ('if' in .gitignore?)”
  1. Sebastian SchubertOct 27, 2009
  2. Michael J GruberOct 27, 2009
  3. Paolo BonziniOct 27, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.