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