Tue, 15 Jul 2025 19:18:15 +0200
merge changes
54
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
1 | /* Copyright 2025 Mike Becker. All rights reserved. |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
2 | * |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
3 | * Redistribution and use in source and binary forms, with or without |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
4 | * modification, are permitted provided that the following conditions are met: |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
5 | * |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
6 | * 1. Redistributions of source code must retain the above copyright |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
7 | * notice, this list of conditions and the following disclaimer. |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
8 | * |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
9 | * 2. Redistributions in binary form must reproduce the above copyright |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
10 | * notice, this list of conditions and the following disclaimer in the |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
11 | * documentation and/or other materials provided with the distribution. |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
12 | * |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
13 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
16 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
17 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
18 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
19 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
20 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
21 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
22 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
23 | */ |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
24 | |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
25 | #ifndef COMMIT_DATA_H |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
26 | #define COMMIT_DATA_H |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
27 | |
56
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
28 | #include <map> |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
29 | #include <numeric> |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
30 | #include <vector> |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
31 | #include <string> |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
32 | |
54
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
33 | namespace fm { |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
34 | struct commits final { |
56
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
35 | std::map< |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
36 | std::string, // repository name |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
37 | std::vector<std::string> > summaries; |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
38 | |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
39 | [[nodiscard]] unsigned count(const std::string &repo) const { |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
40 | return summaries.at(repo).size(); |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
41 | } |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
42 | |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
43 | [[nodiscard]] unsigned count() const { |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
44 | return std::accumulate( |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
45 | summaries.begin(), summaries.end(), 0u, |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
46 | [](unsigned sum, const auto &pair) { return sum + pair.second.size(); }); |
3d2720f95cfb
fix that commits were not listed per repository in the combined view
Mike Becker <universe@uap-core.de>
parents:
54
diff
changeset
|
47 | } |
54
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
48 | }; |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
49 | } |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
50 | |
586dcd606e47
add popups with commit summaries - resolves #644
Mike Becker <universe@uap-core.de>
parents:
diff
changeset
|
51 | #endif //COMMIT_DATA_H |