)]}'
{
  "commit": "e83e3333b5770815e9c2e3aee48c305257385bbb",
  "tree": "aaa7ee6995975d510c90eee1638ade485f43ebc6",
  "parents": [
    "ede8a5bb6b16af70542bc9d02d17371e83764837"
  ],
  "author": {
    "name": "Prathamesh Chavan",
    "email": "pc44800@gmail.com",
    "time": "Thu Aug 13 01:14:04 2020 +0530"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Wed Aug 12 14:12:58 2020 -0700"
  },
  "message": "submodule: port submodule subcommand \u0027summary\u0027 from shell to C\n\nConvert submodule subcommand \u0027summary\u0027 to a builtin and call it via\n\u0027git-submodule.sh\u0027.\n\nThe shell version had to call $diff_cmd twice, once to find the modified\nmodules cared by the user and then again, with that list of modules\nto do various operations for computing the summary of those modules.\nOn the other hand, the C version does not need a second call to\n$diff_cmd since it reuses the module list from the first call to do the\naforementioned tasks.\n\nIn the C version, we use the combination of setting a child process\u0027\nworking directory to the submodule path and then calling\n\u0027prepare_submodule_repo_env()\u0027 which also sets the \u0027GIT_DIR\u0027 to \u0027.git\u0027,\nso that we can be certain that those spawned processes will not access\nthe superproject\u0027s ODB by mistake.\n\nA behavioural difference between the C and the shell version is that the\nshell version outputs two line feeds after the \u0027git log\u0027 output when run\noutside of the tests while the C version outputs one line feed in any\ncase. The reason for this is that the shell version calls log with\n\u0027--pretty\u003dformat:\u003cfmt\u003e\u0027 whose output is followed by two echo\ncalls; \u0027format\u0027 does not have \"terminator\" semantics like its \u0027tformat\u0027\ncounterpart. So, the log output is terminated by a newline only when\ninvoked by the user and not when invoked from the scripts. This results\nin the one \u0026 two line feed differences in the shell version.\nOn the other hand, the C version calls log with \u0027--pretty\u003d\u003cfmt\u003e\u0027\nwhich is equivalent to \u0027--pretty:tformat:\u003cfmt\u003e\u0027 which is then\nfollowed by a \u0027printf(\"\\n\")\u0027. Due to its \"terminator\" semantics the\nlog output is always terminated by newline and hence one line feed in\nany case.\n\nAlso, when we try to pass an option-like argument after a non-option\nargument, for instance:\n\n    git submodule summary HEAD --foo-bar\n\n    (or)\n\n    git submodule summary HEAD --cached\n\nThat argument would be treated like a path to the submodule for which\nthe user is requesting a summary. So, the option ends up having no\neffect. Though, passing \u0027--quiet\u0027 is an exception to this:\n\n    git submodule summary HEAD --quiet\n\nWhile \u0027summary\u0027 doesn\u0027t support \u0027--quiet\u0027, we don\u0027t get an output for\nthe above command as \u0027--quiet\u0027 is treated as a path which means we get\nan output only if a submodule whose path is \u0027--quiet\u0027 exists.\n\nThe error message in case of computing a summary for non-existent\nsubmodules in the C version is different from that of the shell version.\nSince the new error message is not marked for translation, change the\n\u0027test_i18ngrep\u0027 in t7421.4 to \u0027grep\u0027.\n\nMentored-by: Christian Couder \u003cchriscool@tuxfamily.org\u003e\nMentored-by: Stefan Beller \u003cstefanbeller@gmail.com\u003e\nMentored-by: Kaartic Sivaraam \u003ckaartic.sivaraam@gmail.com\u003e\nHelped-by: Johannes Schindelin \u003cJohannes.Schindelin@gmx.de\u003e\nSigned-off-by: Prathamesh Chavan \u003cpc44800@gmail.com\u003e\nSigned-off-by: Shourya Shukla \u003cshouryashukla.oo@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a03dc84ea42861fe523d8e09049f10ba2c1ddfff",
      "old_mode": 33188,
      "old_path": "builtin/submodule--helper.c",
      "new_id": "63ea39025d037a7ca2a1c79087e3ff6a58a81f76",
      "new_mode": 33188,
      "new_path": "builtin/submodule--helper.c"
    },
    {
      "type": "modify",
      "old_id": "43eb6051d23f90cccc94c1fb4c58ad14d4ece3e6",
      "old_mode": 33261,
      "old_path": "git-submodule.sh",
      "new_id": "6fb12585cb07c3eb1f0a9ff1263c8d51de26962c",
      "new_mode": 33261,
      "new_path": "git-submodule.sh"
    },
    {
      "type": "modify",
      "old_id": "829fe26d6d66bc015843dfa1bf5a26691466358b",
      "old_mode": 33261,
      "old_path": "t/t7421-submodule-summary-add.sh",
      "new_id": "59a9b00467dcb043b8e522022a45cb19a3636f4c",
      "new_mode": 33261,
      "new_path": "t/t7421-submodule-summary-add.sh"
    }
  ]
}
