src/main.cpp

changeset 67
7962d771b939
parent 65
ff03ae99323f
equal deleted inserted replaced
66:16b2313dd96f 67:7962d771b939
36 36
37 #include <numeric> 37 #include <numeric>
38 38
39 using namespace std::chrono; 39 using namespace std::chrono;
40 40
41 static constexpr auto program_version = "1.1.0"; 41 static constexpr auto program_version = "1.1.1";
42 42
43 static void print_help() { 43 static void print_help() {
44 fputs( 44 fputs(
45 "Usage: repoheat [OPTION]... [PATH]...\n\n" 45 "Usage: repoheat [OPTION]... [PATH]...\n\n"
46 "Options:\n" 46 "Options:\n"
233 } else if (proc.exec({"update"})) { 233 } else if (proc.exec({"update"})) {
234 fprintf(stderr, "Updating repo '%s' failed!\nMaybe there are local changes?\n", repo.path.c_str()); 234 fprintf(stderr, "Updating repo '%s' failed!\nMaybe there are local changes?\n", repo.path.c_str());
235 } 235 }
236 } else { 236 } else {
237 proc.setbin(settings.git); 237 proc.setbin(settings.git);
238 if (proc.exec({"pull", "-q"})) { 238 if (proc.exec({"pull", "-q", "--all"})) {
239 fprintf(stderr, "Pulling repo '%s' failed - continue without pull.\n", repo.path.c_str()); 239 fprintf(stderr, "Pulling repo '%s' failed - continue without pull.\n", repo.path.c_str());
240 } 240 }
241 } 241 }
242 } 242 }
243 } 243 }
266 } 266 }
267 heatmap.add(settings, proc.output()); 267 heatmap.add(settings, proc.output());
268 } else { 268 } else {
269 proc.setbin(settings.git); 269 proc.setbin(settings.git);
270 if (proc.exec_log({"log", 270 if (proc.exec_log({"log",
271 "--all",
271 "--decorate=short", 272 "--decorate=short",
272 "--decorate-refs=refs/tags/", 273 "--decorate-refs=refs/tags/",
273 "--since", std::format("{0}-01-01 00:00:00", report_year), 274 "--since", std::format("{0}-01-01 00:00:00", report_year),
274 "--until", std::format("{0}-12-31 23:59:59", report_year), 275 "--until", std::format("{0}-12-31 23:59:59", report_year),
275 "--format=tformat:%an <%ae>#%cs#%(decorate:prefix=,suffix=,tag=,separator= )#%s"})) { 276 "--format=tformat:%an <%ae>#%cs#%(decorate:prefix=,suffix=,tag=,separator= )#%s"})) {

mercurial