See description in "main". */
| 543 | /** See description in "main". |
| 544 | */ |
| 545 | struct Options |
| 546 | { |
| 547 | bool skip_commits_without_parents = true; |
| 548 | bool skip_commits_with_duplicate_diffs = true; |
| 549 | size_t threads = 1; |
| 550 | std::optional<re2::RE2> skip_paths; |
| 551 | std::optional<re2::RE2> skip_commits_with_messages; |
| 552 | std::unordered_set<std::string> skip_commits; |
| 553 | std::optional<size_t> diff_size_limit; |
| 554 | std::string stop_after_commit; |
| 555 | |
| 556 | explicit Options(const po::variables_map & options) |
| 557 | { |
| 558 | skip_commits_without_parents = options["skip-commits-without-parents"].as<bool>(); |
| 559 | skip_commits_with_duplicate_diffs = options["skip-commits-with-duplicate-diffs"].as<bool>(); |
| 560 | threads = options["threads"].as<size_t>(); |
| 561 | if (options.contains("skip-paths")) |
| 562 | { |
| 563 | skip_paths.emplace(options["skip-paths"].as<std::string>()); |
| 564 | } |
| 565 | if (options.contains("skip-commits-with-messages")) |
| 566 | { |
| 567 | skip_commits_with_messages.emplace(options["skip-commits-with-messages"].as<std::string>()); |
| 568 | } |
| 569 | if (options.contains("skip-commit")) |
| 570 | { |
| 571 | auto vec = options["skip-commit"].as<std::vector<std::string>>(); |
| 572 | skip_commits.insert(vec.begin(), vec.end()); |
| 573 | } |
| 574 | if (options.contains("diff-size-limit")) |
| 575 | { |
| 576 | diff_size_limit = options["diff-size-limit"].as<size_t>(); |
| 577 | } |
| 578 | if (options.contains("stop-after-commit")) |
| 579 | { |
| 580 | stop_after_commit = options["stop-after-commit"].as<std::string>(); |
| 581 | } |
| 582 | } |
| 583 | }; |
| 584 | |
| 585 | |
| 586 | /** Rough snapshot of repository calculated by application of diffs. It's used to calculate blame info. |
no outgoing calls
no test coverage detected