)]}'
{
  "commit": "b04ba2bb42957f63567f530e092385f085b25e63",
  "tree": "995067e56b042a7d4d9df32a50268ef614972737",
  "parents": [
    "8d714b11df2b65e5f4272c1616e561930010be90"
  ],
  "author": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Tue Sep 27 16:56:49 2011 -0700"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Tue Sep 27 17:00:04 2011 -0700"
  },
  "message": "parse-options: deprecate OPT_BOOLEAN\n\nIt is natural to expect that an option defined with OPT_BOOLEAN() could be\nused in this way:\n\n\tint option \u003d -1; /* unspecified */\n\n\tstruct option options[] \u003d {\n\t\tOPT_BOOLEAN(0, \"option\", \u0026option, \"set option\"),\n                OPT_END()\n\t};\n\tparse_options(ac, av, prefix, options, usage, 0);\n\n        if (option \u003c 0)\n        \t... do the default thing ...\n\telse if (!option)\n\t\t... --no-option was given ...\n\telse\n\t\t... --option was given ...\n\nto easily tell three cases apart:\n\n - There is no mention of the `--option` on the command line;\n - The variable is positively set with `--option`; or\n - The variable is explicitly negated with `--no-option`.\n\nUnfortunately, this is not the case. OPT_BOOLEAN() increments the variable\nevery time `--option` is given, and resets it to zero when `--no-option`\nis given.\n\nAs a first step to remedy this, introduce a true boolean OPT_BOOL(), and\nrename OPT_BOOLEAN() to OPT_COUNTUP(). To help transitioning, OPT_BOOLEAN\nand OPTION_BOOLEAN are defined as deprecated synonyms to OPT_COUNTUP and\nOPTION_COUNTUP respectively.\n\nThis is what db7244b (parse-options new features., 2007-11-07) from four\nyears ago started by marking OPTION_BOOLEAN as \"INCR would have been a\nbetter name\".\n\nSome existing users do depend on the count-up semantics; for example,\nusers of OPT__VERBOSE() could use it to raise the verbosity level with\nrepeated use of `-v` on the command line, but they probably should be\nrewritten to use OPT__VERBOSITY() instead these days.  I suspect that some\nusers of OPT__FORCE() may also use it to implement different level of\nforcibleness but I didn\u0027t check.\n\nOn top of this patch, here are the remaining clean-up tasks that other\npeople can help:\n\n - Look at each hit in \"git grep -e OPT_BOOLEAN\"; trace all uses of the\n   value that is set to the underlying variable, and if it can proven that\n   the variable is only used as a boolean, replace it with OPT_BOOL(). If\n   the caller does depend on the count-up semantics, replace it with\n   OPT_COUNTUP() instead.\n\n - Same for OPTION_BOOLEAN; replace it with OPTION_SET_INT and arrange to\n   set 1 to the variable for a true boolean, and otherwise replace it with\n   OPTION_COUNTUP.\n\n - Look at each hit in \"git grep -e OPT__VERBOSE -e OPT__QUIET\" and see if\n   they can be replaced with OPT__VERBOSITY().\n\nI\u0027ll follow this message up with a separate patch as an example.\n\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f6a4a361bd56e1cc0f4645e09898e6852bfb8a8b",
      "old_mode": 33188,
      "old_path": "Documentation/technical/api-parse-options.txt",
      "new_id": "acf17607dfced869ed9709decbe11a1828659cfa",
      "new_mode": 33188,
      "new_path": "Documentation/technical/api-parse-options.txt"
    },
    {
      "type": "modify",
      "old_id": "503ab5d500c8ca2fe30f50601717979e752b9254",
      "old_mode": 33188,
      "old_path": "parse-options.c",
      "new_id": "f0098eb8ea7eed27d8a67952481f043ce7c75d4a",
      "new_mode": 33188,
      "new_path": "parse-options.c"
    },
    {
      "type": "modify",
      "old_id": "59e0b524bdcbe1c061f49b8e5f3c6365a9f2eba4",
      "old_mode": 33188,
      "old_path": "parse-options.h",
      "new_id": "22c0273052c93bde773fa573988a4eac0b2ed495",
      "new_mode": 33188,
      "new_path": "parse-options.h"
    }
  ]
}
