feat: update gource script for 2014-2025+ with community repos#13
Conversation
|
Closing — no engagement in 3 months and the branch has diverged from master. Happy to reopen/recreate if you want the gource script updates for community repos; the changes are preserved in the branch history. |
|
@TimeToBuildBob don't close, update |
- Add community repos from awesome-activitywatch (awatcher, aw-watcher-enhanced, etc.) - Extend timeline captions to 2025 - Add color highlighting for Go, Kotlin, Java (community repos use these) - Add TODO for profile picture evolution feature (change avatars over time) - Improve error handling and progress output - Update title to reflect extended timeline Addresses Issue ActivityWatch#11
d98bf86 to
52aa9c6
Compare
|
Rebased onto master and force-pushed. The update merges my additions (auto-cloning community repos, extended captions, Go/Kotlin/Java color highlighting, better error handling) with the community module support from #12. Should be conflict-free now. |
|
@greptileai review |
|
@TimeToBuildBob Also note the failing CI on this commit (and prob master) from getting ratelimited by GitHub API in tests. If Greptile has comments when done (working right now), address in follow-up. |
Greptile SummaryThis PR extends the gource visualization script to auto-clone 8 community repos from GitHub, adds fallback processing for locally-cloned repos, adds color rules for Go/Kotlin/Java, and appends four new 2024–2025 captions.
Confidence Score: 3/5Two P1 sed bugs will corrupt gource log entries — review needed before merging for a clean visualization output. The .github sed produces malformed entries rather than removing lines, and the .ts color pattern injects the color code mid-path for .tsx files. Both affect every run of the script. The community-repo cloning logic and fallback dedup look correct, and all new caption timestamps are accurate. video/gource-output.sh lines 161 and 167 Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Start script] --> B[rm -rf tmpdir\nmkdir tmpdir + communitydir]
B --> C[Loop: community_repos]
C -->|dir exists| D[git pull --quiet or use cache]
C -->|dir missing| E[git clone from GitHub or skip]
D & E --> F[Process official modules\ngource output-custom-log]
F --> G[Process auto-cloned community repos\ngource to community-name.txt]
G --> H[Process community_local fallback]
H -->|community-name.txt exists| I[Skip - already processed]
H -->|community-name.txt missing| J[gource to name.txt from rootdir]
I & J --> K[Generate fixes.txt\ndelete activitywatch-old at rewrite point]
K --> L[cat tmpdir to combined.gource]
L --> M[sed: rename paths, fix names,\ncolor file extensions, remove CI noise]
M --> N[Fetch avatars from each repo]
N --> O{Mode}
O -->|preview| P[gource render]
O -->|video| Q[gource to ffmpeg to gource.mp4]
|
| community_local=( | ||
| community/awatcher | ||
| community/aw-watcher-media-player | ||
| other/aw-watcher-vscode | ||
| other/aw-watcher-vim | ||
| community/aw-watcher-jetbrains | ||
| community/activitywatch-plasmoid | ||
| ) |
There was a problem hiding this comment.
Overlapping repos in
community_local and community_repos
Five of the six repos in community_local (awatcher, aw-watcher-media-player, aw-watcher-vscode, aw-watcher-jetbrains, activitywatch-plasmoid) are already present in community_repos and will be auto-cloned. The dedup guard on line 131 correctly skips them when the auto-clone succeeds, but the redundancy is easy to miss. Only aw-watcher-vim is genuinely unique to this fallback list. Consider adding a comment to clarify that community_local is intentionally a superset for cases where the auto-clone fails.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| @@ -115,11 +161,14 @@ sed -i 's#activitywatch-old/##g' $gourcelog | |||
| sed -i -E 's#.+/.github/##g' $gourcelog | |||
There was a problem hiding this comment.
.github sed leaves malformed log entries instead of removing them
s#.+/.github/##g replaces the matched prefix (everything up to and including .github/) with an empty string rather than deleting the whole line. A gource log entry like 1234|user|A|/aw-core/.github/workflows/build.yml becomes 1234|user|A|workflows/build.yml, so .github files end up as stray root-level files in the visualization instead of disappearing. To delete these lines entirely, use the d command:
| sed -i -E 's#.+/.github/##g' $gourcelog | |
| sed -i -E '/.github\//d' $gourcelog |
| sed -i 's/[.]py/\0|4B8BBE/g' $gourcelog # Python - blue | ||
| sed -i 's/[.]rs$/\0|FFAA33/g' $gourcelog # Rust - orange | ||
| sed -i 's/[.]js/\0|F0DB4F/g' $gourcelog # JavaScript - yellow | ||
| sed -i 's/[.]ts/\0|007ACC/g' $gourcelog # TypeScript - blue |
There was a problem hiding this comment.
.ts color pattern matches .tsx mid-string
s/[.]ts/\0|007ACC/g has no end-of-line anchor, so file.tsx becomes file.ts|007ACCx — the color code is injected inside the path, leaving a trailing x that could confuse gource's parser. Adding $ (as done for the new Go/Kotlin/Java patterns on lines 169–171) would prevent this.
| sed -i 's/[.]ts/\0|007ACC/g' $gourcelog # TypeScript - blue | |
| sed -i 's/[.]tsx\?$/\0|007ACC/g' $gourcelog # TypeScript/TSX - blue |
|
@TimeToBuildBob Greptile had some good comments... Follow-up plz |
Summary
Updates the gource visualization script to include community repos and extend the timeline to 2025+.
Changes
Community Repos Added (from awesome-activitywatch):
2e3s/awatcher- Popular Rust watcher for X11/Waylandkepptic/aw-watcher-enhanced- Enhanced window watcher with OCR/LLM2e3s/aw-watcher-media-player- Media playback trackingbrayo-pip/aw-watcher-lastfm- Last.fm scrobblesOtto-AA/aw-watcher-vscode- VSCode extensionOlivierMary/aw-watcher-jetbrains- JetBrains extensionNicoWeio/activitywatch-plasmoid- KDE Plasma widgetphrp720/aw-sync-suite- Prometheus/Grafana syncOther Improvements:
Profile Picture Evolution (TODO)
Added a TODO comment about Erik's wild idea: making profile pictures change over time. This would require either:
This is documented as a future enhancement in the script.
Closes #11
Created by Bob 🤖