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

Re: Excluding files from git-diff

From
CJChristian Jaeger <christian@pflanze.mine.nu>
Date
Oct 18, 2008, 16:08 UTC
Message-ID
<48FA0A17.9050506@pflanze.mine.nu>
In-Reply-To
<20081018155912.GA20387@coredump.intra.peff.net>
Jeff King wrote:
Show 7 quoted lines
> No, I don't think there is a way to do that currently. I would probably
> generate the file list with a shell snippet:
>
>   git diff -- `git ls-files | grep -v .gitignore`
>
> but obviously that is a lot more typing if this is something you are
> doing frequently.

The problem with this is that it won't show files that aren't there anymore but have been previously; in general, for that to work (also with git log, for example), the list of files would need to include all paths which have ever existed and which are not to be excluded. Even then, I'm not sure whether there are corner case where it would not work (when files are being renamed, for example?).

If I/we (after finishing my intergit-find-matching-commit-in experiment) finally decide that tracking generated files in the same repository is the right thing to do, then I guess the only way to ignore those cleanly would be to add an inverse match feature to the Git core.

Christian.
Previous: Jeff KingNext: Jeff King
Message 9 of 12 in “Excluding files from git-diff”
  1. Erik HahnOct 17, 2008
  2. Raphael ZimmererOct 17, 2008
  3. Johannes SchindelinOct 17, 2008
  4. Michael J GruberOct 17, 2008
  5. Christian JaegerOct 17, 2008
  6. Eric RaibleOct 17, 2008
  7. Christian JaegerOct 18, 2008
  8. Jeff KingOct 18, 2008
  9. Christian JaegerOct 18, 2008
  10. Jeff KingOct 18, 2008
  11. Jeff KingOct 18, 2008
  12. Anders MelchiorsenOct 17, 2008

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.