{"thread":{"id":"56541","subject":"git diff --git-ignore","startedAt":"2021-09-19T23:51:21Z","lastAt":"2021-09-20T02:25:21Z","messageCount":2,"participants":["Aaron Gray","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"436389","messageId":"CANkmNDf5KVn7Afj9xtvMGC0Ua7G6O3EOjBRtAfBOKOnaYgqVXA@mail.gmail.com","threadId":"56541","inReplyTo":null,"subject":"git diff --git-ignore","fromName":"Aaron Gray","fromEmail":"aaronngray.lists@gmail.com","sentAt":"2021-09-19T23:50:56Z","receivedAt":"2021-09-19T23:51:21Z","isPatch":false,"sender":{"key":"aaronngray.lists@gmail.com","avatar":null},"body":"Hi,\n\nIs it possible to add a --git-ignore flag to git diff so I only see\nthe diffs for what I really want to be looking at, and not what I\ndon't ;)\n\nRegards,\n\nAaron\n-- \nAaron Gray\n\nIndependent Open Source Software Engineer, Computer Language\nResearcher, Information Theorist, and amateur computer scientist.\n"},{"id":"436393","messageId":"xmqq4kagdlxx.fsf@gitster.g","threadId":"56541","inReplyTo":"CANkmNDf5KVn7Afj9xtvMGC0Ua7G6O3EOjBRtAfBOKOnaYgqVXA@mail.gmail.com","subject":"Re: git diff --git-ignore","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-09-20T02:23:38Z","receivedAt":"2021-09-20T02:25:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Aaron Gray <aaronngray.lists@gmail.com> writes:\n\n> Is it possible to add a --git-ignore flag to git diff so I only see\n> the diffs for what I really want to be looking at, and not what I\n> don't ;)\n\nHow does your --git-ignore option exactly guess differences for\nwhich paths to show and which paths to exclude?  How do you tell the\n\"git diff --git-ignore\" command which paths are what you really want\nto be looking at?\n\nIf it is by magic, good luck writing such a feature ;-)\n\nIf it is like \"I only am interested in changes in src/ directory and\nthe top-level Makefile\", then perhaps using pathspec is what you\nwant.  E.g.\n\n    $ git diff -- src/ Makefile\n    $ git diff --cached -- src/ Makefile\n    $ git diff master topic -- src/ Makefile\n    $ git diff master...topic -- src/ Makefile\n\nModern Git even allows you to include negative elements to the\npathspec, e.g.\n\n    $ git diff src/ ':(exclude)*.h'\n\nwould tell us \"show only changes in the src/ directory, but do not\nbother with changes to the dot-h files\".\n\nHTH\n"}]}