public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha•warpmail.net>
To: Sebastian Schubert <schubert.seb@googlemail•com>
Cc: git@vger•kernel.org
Subject: Re: more fancy ignoring of files ('if' in .gitignore?)
Date: Tue, 27 Oct 2009 10:56:02 +0100	[thread overview]
Message-ID: <4AE6C3B2.9050601@drmicha.warpmail.net> (raw)
In-Reply-To: <200910271030.54571.schubert.seb@googlemail.com>

Sebastian Schubert venit, vidit, dixit 27.10.2009 10:30:
> 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?

No.

You can script around it by making e.g. your build process (which
generated pdf/eps from fig) add a specific foo.pdf etc to .gitignore.

In fact, at the the time you add a fig to your repo you should add (&
commit) corresponding lines to .gitignore. This is the common approach.

Alternatively, you can update your ignore with

rm -f .gitignore;find . -name \*.fig | while read i;do echo -e
${i%fig}pdf "\n" ${i%fig}eps >>.gitignore;done

if you have no other ignore patterns in there. (This is q&d, adjust if
you have spaces in file names or such.)

Michael

  reply	other threads:[~2009-10-27  9:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-27  9:30 more fancy ignoring of files ('if' in .gitignore?) Sebastian Schubert
2009-10-27  9:56 ` Michael J Gruber [this message]
2009-10-27 10:00 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AE6C3B2.9050601@drmicha.warpmail.net \
    --to=git@drmicha$(echo .)warpmail.net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=schubert.seb@googlemail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox