MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / gitShow

Function gitShow

programs/git-import/git-import.cpp:1127–1137  ·  view source on GitHub ↗

Runs child process and allows to read the result. * Multiple processes can be run for parallel processing. */

Source from the content-addressed store, hash-verified

1125 * Multiple processes can be run for parallel processing.
1126 */
1127static 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.

Callers 1

processLogFunction · 0.85

Calls 3

shellQuoteFunction · 0.85
executeFunction · 0.85
formatFunction · 0.50

Tested by

no test coverage detected