Runs child process and allows to read the result. * Multiple processes can be run for parallel processing. */
| 1125 | * Multiple processes can be run for parallel processing. |
| 1126 | */ |
| 1127 | static auto gitShow(const std::string & hash) |
| 1128 | { |
| 1129 | /// `hash` is parsed from `git log --pretty=%H` output, which is hex-only today, |
| 1130 | /// but quote it anyway so a future format change or a hand-crafted hash list |
| 1131 | /// cannot inject shell syntax through `/bin/sh -c`. |
| 1132 | std::string command = fmt::format( |
| 1133 | "git show --raw --pretty='format:%ct%x00%aN%x00%P%x00%s%x00' --patch --unified=0 {}", |
| 1134 | shellQuote(hash)); |
| 1135 | |
| 1136 | return ShellCommand::execute(command); |
| 1137 | } |
| 1138 | |
| 1139 | |
| 1140 | /** Obtain the list of commits and process them. |
no test coverage detected