)]}'
{
  "commit": "6854a8f5c9ecf32f5bd85020e77d48d3ffdf48fc",
  "tree": "e51fc16cc9374db8ac7fbb336d1c10cfada67ed4",
  "parents": [
    "5c238e29a85dd109e42513c6a9d09008d8839bae"
  ],
  "author": {
    "name": "Jeff King",
    "email": "peff@peff.net",
    "time": "Sat Nov 26 23:31:13 2016 -0500"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Tue Nov 29 11:01:48 2016 -0800"
  },
  "message": "common-main: stop munging argv[0] path\n\nSince 650c44925 (common-main: call git_extract_argv0_path(),\n2016-07-01), the argv[0] that is seen in cmd_main() of\nindividual programs is always the basename of the\nexecutable, as common-main strips off the full path. This\ncan produce confusing results for git-daemon, which wants to\nre-exec itself.\n\nFor instance, if the program was originally run as\n\"/usr/lib/git/git-daemon\", it will try just re-execing\n\"git-daemon\", which will find the first instance in $PATH.\nIf git\u0027s exec-path has not been prepended to $PATH, we may\nfind the git-daemon from a different version (or no\ngit-daemon at all).\n\nNormally this isn\u0027t a problem. Git commands are run as \"git\ndaemon\", the git wrapper puts the exec-path at the front of\n$PATH, and argv[0] is already \"daemon\" anyway. But running\ngit-daemon via its full exec-path, while not really a\nrecommended method, did work prior to 650c44925. Let\u0027s make\nit work again.\n\nThe real goal of 650c44925 was not to munge argv[0], but to\nreliably set the argv0_path global. The only reason it\nmunges at all is that one caller, the git.c wrapper,\npiggy-backed on that computation to find the command\nbasename.  Instead, let\u0027s leave argv[0] untouched in\ncommon-main, and have git.c do its own basename computation.\n\nWhile we\u0027re at it, let\u0027s drop the return value from\ngit_extract_argv0_path(). It was only ever used in this one\ncallsite, and its dual purposes is what led to this\nconfusion in the first place.\n\nNote that by changing the interface, the compiler can\nconfirm for us that there are no other callers storing the\nreturn value. But the compiler can\u0027t tell us whether any of\nthe cmd_main() functions (besides git.c) were relying on the\nbasename munging. However, we can observe that prior to\n650c44925, no other cmd_main() functions did that munging,\nand no new cmd_main() functions have been introduced since\nthen. So we can\u0027t be regressing any of those cases.\n\nSigned-off-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "44a29e8b13cb5203e2d35c99b8e2b5fec49f6981",
      "old_mode": 33188,
      "old_path": "common-main.c",
      "new_id": "c654f95551c33d6b346ae7fe43a6cac987dd6b75",
      "new_mode": 33188,
      "new_path": "common-main.c"
    },
    {
      "type": "modify",
      "old_id": "9d5703a157fe8e9d8396e0771798e54dc5eea6eb",
      "old_mode": 33188,
      "old_path": "exec_cmd.c",
      "new_id": "19ac2146d0c49be8f5ef3739664dc3105544b4c2",
      "new_mode": 33188,
      "new_path": "exec_cmd.c"
    },
    {
      "type": "modify",
      "old_id": "1f6b43378ba3866c07578b2222154e3a760440d1",
      "old_mode": 33188,
      "old_path": "exec_cmd.h",
      "new_id": "ff0b48048a6ba82827b4d441654c34c21cfb7b9a",
      "new_mode": 33188,
      "new_path": "exec_cmd.h"
    },
    {
      "type": "modify",
      "old_id": "0f1937fd0c23da7c316540b8f9a6b05746011506",
      "old_mode": 33188,
      "old_path": "git.c",
      "new_id": "5e50a41285bd7129aa1e1373276a6f22206831a5",
      "new_mode": 33188,
      "new_path": "git.c"
    }
  ]
}
