)]}'
{
  "commit": "c033a2f62dda774de8cccc83b7f1918377995d6c",
  "tree": "3f7723b2d6800286553045eae10ed6e08331562d",
  "parents": [
    "ccdcbd54c4475c2238b310f7113ab3075b5abc9c"
  ],
  "author": {
    "name": "Prathamesh Chavan",
    "email": "pc44800@gmail.com",
    "time": "Tue May 08 17:29:49 2018 -0700"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Wed May 09 12:37:00 2018 +0900"
  },
  "message": "submodule foreach: correct \u0027$path\u0027 in nested submodules from a subdirectory\n\nWhen running \u0027git submodule foreach --recursive\u0027 from a subdirectory of\nyour repository, nested submodules get a bogus value for $path:\nFor a submodule \u0027sub\u0027 that contains a nested submodule \u0027nested\u0027,\nrunning \u0027git -C dir submodule foreach echo $path\u0027 from the root of the\nsuperproject would report path\u003d\u0027../nested\u0027 for the nested submodule.\nThe first part \u0027../\u0027 is derived from the logic computing the relative\npath from $pwd to the root of the superproject. The second part is the\nsubmodule path inside the submodule. This value is of little use and is\nhard to document.\n\nAlso, in git-submodule.txt, $path is documented to be the \"name of the\nsubmodule directory relative to the superproject\", but \"the\nsuperproject\" is ambiguous.\n\nTo resolve both these issues, we could:\n(a) Change \"the superproject\" to \"its immediate superproject\", so\n    $path would be \"nested\" instead of \"../nested\".\n(b) Change \"the superproject\" to \"the superproject the original\n    command was run from\", so $path would be \"sub/nested\" instead of\n    \"../nested\".\n(c) Change \"the superproject\" to \"the directory the original command\n    was run from\", so $path would be \"../sub/nested\" instead of\n    \"../nested\".\n\nThe behavior for (c) was attempted to be introduced in 091a6eb0fe\n(submodule: drop the top-level requirement, 2013-06-16) with the intent\nfor $path to be relative from $pwd to the submodule worktree, but that\ndid not work for nested submodules, as the intermittent submodules\nwere not included in the path.\n\nIf we were to fix the meaning of the $path using (a), we would break\nany existing submodule user that runs foreach from non-root of the\nsuperproject as the non-nested submodule \u0027../sub\u0027 would change its\npath to \u0027sub\u0027.\n\nIf we were to fix the meaning of $path using (b), then we would break\nany user that uses nested submodules (even from the root directory)\nas the \u0027nested\u0027 would become \u0027sub/nested\u0027.\n\nIf we were to fix the meaning of $path using (c), then we would break\nthe same users as in (b) as \u0027nested\u0027 would become \u0027sub/nested\u0027 from\nthe root directory of the superproject.\n\nAll groups can be found in the wild.  The author has no data if one group\noutweighs the other by large margin, and offending each one seems equally\nbad at first.  However in the authors imagination it is better to go with\n(a) as running from a sub directory sounds like it is carried out by a\nhuman rather than by some automation task.  With a human on the keyboard\nthe feedback loop is short and the changed behavior can be adapted to\nquickly unlike some automation that can break silently.\n\nDiscussed-with: Ramsay Jones \u003cramsay@ramsayjones.plus.com\u003e\nSigned-off-by: Prathamesh Chavan \u003cpc44800@gmail.com\u003e\nSigned-off-by: Stefan Beller \u003csbeller@google.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\nSigned-off-by: Stefan Beller \u003csbeller@google.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "24914963ca23c837e0cc46ca2dc0fa46bf9886a6",
      "old_mode": 33261,
      "old_path": "git-submodule.sh",
      "new_id": "331d71c908bf2210649e53221933c17cd88805dd",
      "new_mode": 33261,
      "new_path": "git-submodule.sh"
    },
    {
      "type": "modify",
      "old_id": "6ba5daf42ee870ce3a30c4fdb5a7cf84c18a2c84",
      "old_mode": 33261,
      "old_path": "t/t7407-submodule-foreach.sh",
      "new_id": "5144cc6926be3c9ff5b1a73919e9a96e7ac1a4c7",
      "new_mode": 33261,
      "new_path": "t/t7407-submodule-foreach.sh"
    }
  ]
}
