From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: Re: Exlude files from git log -p Date: Thu, 14 Oct 2010 20:54:57 -0400 Message-ID: <20101015005457.GA13334@sigill.intra.peff.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: git@vger.kernel.org To: Maaartin X-From: git-owner@vger.kernel.org Fri Oct 15 02:54:40 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P6YZC-00073R-4Y for gcvg-git-2@lo.gmane.org; Fri, 15 Oct 2010 02:54:38 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754411Ab0JOAyb (ORCPT ); Thu, 14 Oct 2010 20:54:31 -0400 Received: from xen6.gtisc.gatech.edu ([143.215.130.70]:46970 "EHLO peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753183Ab0JOAyb (ORCPT ); Thu, 14 Oct 2010 20:54:31 -0400 Received: (qmail 12991 invoked by uid 111); 15 Oct 2010 00:54:29 -0000 Received: from 99-108-226-0.lightspeed.iplsin.sbcglobal.net (HELO sigill.intra.peff.net) (99.108.226.0) (smtp-auth username relayok, mechanism cram-md5) by peff.net (qpsmtpd/0.40) with ESMTPA; Fri, 15 Oct 2010 00:54:29 +0000 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Thu, 14 Oct 2010 20:54:57 -0400 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Thu, Oct 14, 2010 at 08:06:26PM +0000, Maaartin wrote: > Is it possible to exclude a couple of files from the output generated by "git > log -p"? Enumerating all other files/dirs is not an option for me. Not directly. Excluding files from diffs is something that is sometimes requested, but nobody has implemented it yet. But... > Background: Some files in my repo are generated source code and often contain > quite a lot of changes. Their generation can't be done in a fully automatic > fashion and it happens that it gets forgotten; that's why I need to version them > as well. > > I'm thinking about marking them as binary, this should remove their lines from > the output, but it would make their comparison impossible (at least AFAIK). For a situation like this, where you almost always want them ignored, you can mark them with a special diff driver in .gitattributes. And then you can either use a null textconv for that driver (which will give you a diff header when they change, but the contents of the diff will always be empty), or you can write a custom external diff (in which case you can remove them from the output entirely). When you wanted to see them, you could just tweak the config (which makes it really not that much different than marking them as binary), or if you wanted to get fancy, your custom external diff could look at some environment variable, allowing you to do: git log -p ;# custom diff ignores certain files DIFF_INVISIBLE=1 git log -p ;# show all or something like that. -Peff