)]}'
{
  "commit": "7ec8125fba96f47b00bb0cab3ed716557e81e7e6",
  "tree": "88639831c65796818278922bb530e3993f2975da",
  "parents": [
    "b6d4d82bd5a49197d5d2f4f81c08da0d461cfcf1"
  ],
  "author": {
    "name": "Elijah Newren",
    "email": "newren@gmail.com",
    "time": "Tue Feb 18 23:05:37 2020 +0000"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Tue Feb 18 15:28:58 2020 -0800"
  },
  "message": "check-ignore: fix documentation and implementation to match\n\ncheck-ignore has two different modes, and neither of these modes has an\nimplementation that matches the documentation.  These modes differ in\nwhether they just print paths or whether they also print the final\npattern matched by the path.  The fix is different for both modes, so\nI\u0027ll discuss both separately.\n\n\u003d\u003d\u003d First (default) mode \u003d\u003d\u003d\n\nThe first mode is documented as:\n\n    For each pathname given via the command-line or from a file via\n    --stdin, check whether the file is excluded by .gitignore (or other\n    input files to the exclude mechanism) and output the path if it is\n    excluded.\n\nHowever, it fails to do this because it did not account for negated\npatterns.  Commands other than check-ignore verify exclusion rules via\ncalling\n\n   ... -\u003e treat_one_path() -\u003e is_excluded() -\u003e last_matching_pattern()\n\nwhile check-ignore has a call path of the form:\n\n   ... -\u003e check_ignore()                    -\u003e last_matching_pattern()\n\nThe fact that the latter does not include the call to is_excluded()\nmeans that it is susceptible to to messing up negated patterns (since\nthat is the only significant thing is_excluded() adds over\nlast_matching_pattern()).  Unfortunately, we can\u0027t make it just call\nis_excluded(), because the same codepath is used by the verbose mode\nwhich needs to know the matched pattern in question.  This brings us\nto...\n\n\u003d\u003d\u003d Second (verbose) mode \u003d\u003d\u003d\n\nThe second mode, known as verbose mode, references the first in the\ndocumentation and says:\n\n    Also output details about the matching pattern (if any) for each\n    given pathname. For precedence rules within and between exclude\n    sources, see gitignore(5).\n\nThe \"Also\" means it will print patterns that match the exclude rules as\nnoted for the first mode, and also print which pattern matches.  Unless\nmore information is printed than just pathname and pattern (which is not\ndone), this definition is somewhat ill-defined and perhaps even\nself-contradictory for negated patterns: A path which matches a negated\nexclude pattern is NOT excluded and thus shouldn\u0027t be printed by the\nformer logic, while it certainly does match one of the explicit patterns\nand thus should be printed by the latter logic.\n\n\u003d\u003d\u003d Resolution \u003d\u003d\n\nSince the second mode exists to find out which pattern matches given\npaths, and showing the user a pattern that begins with a \u0027!\u0027 is\nsufficient for them to figure out whether the pattern is excluded, the\nexisting behavior is desirable -- we just need to update the\ndocumentation to match the implementation (i.e. it is about printing\nwhich pattern is matched by paths, not about showing which paths are\nexcluded).\n\nFor the first or default mode, users just want to know whether a pattern\nis excluded.  As such, the existing documentation is desirable; change\nthe implementation to match the documented behavior.\n\nFinally, also adjust a few tests in t0008 that were caught up by this\ndiscrepancy in how negated paths were handled.\n\nSigned-off-by: Elijah Newren \u003cnewren@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8b42cb3fb20a78cde2eb4c6a7546a334cc71ec4b",
      "old_mode": 33188,
      "old_path": "Documentation/git-check-ignore.txt",
      "new_id": "b5f6a2d61a5fa62bb2734f11029d8c53514e4dd8",
      "new_mode": 33188,
      "new_path": "Documentation/git-check-ignore.txt"
    },
    {
      "type": "modify",
      "old_id": "5a4f92395f371438cbfc0582c77666622b9c0b3d",
      "old_mode": 33188,
      "old_path": "builtin/check-ignore.c",
      "new_id": "ea5d0ae3a6a6fff59424909b8be47aaabb824b7c",
      "new_mode": 33188,
      "new_path": "builtin/check-ignore.c"
    },
    {
      "type": "modify",
      "old_id": "1744cee5e996fe4e03149de3a0fb8065d2aa6d67",
      "old_mode": 33261,
      "old_path": "t/t0008-ignores.sh",
      "new_id": "370a389e5c5c509b51189e23b81c6ce2d1b79a18",
      "new_mode": 33261,
      "new_path": "t/t0008-ignores.sh"
    }
  ]
}
