How kamranahmedse/git-standup works
Project type and purpose
• Type: Open-source command-line tool written in shell/Node.js.
• Purpose: Scan one or more Git repositories, collect commits from a configurable time window (last working day by default), and present them as a standup report.
File structure
Top-level files and directories:
• git-standup → Main CLI script or entry point
• installer.sh → Shell installation script
• Makefile → Local build/install targets
• package.json → npm packaging metadata (bin, dependencies)
• snap/ → snapcraft.yaml for Snap packaging
• .github/ → GitHub Actions for linting (shellcheck, shfmt)
• LICENSE, .gitignore, README.md
Core architectural components
a. CLI Entry Point
– git-standup shell script (or Node bin) invoked by user.
b. Argument Parser
– Parses flags (-a, -d, -m, etc.) using a library (e.g., yargs) or custom shell parsing.
c. Configuration Loader
– Reads optional .git-standup-whitelist; applies defaults (weekdays, depth).
d. Directory Scanner
– Recursively traverses current directory up to -m depth; respects -F, symlink, whitelist settings.
e. Git Executor
– For each discovered repo: optionally runs git fetch --all -f; then executes git log with date/author filters.
f. Data Processor
– Parses git log output into structured entries (commit SHA, date, author, message, diff-stat).
g. Report Formatter
– Groups by repository, formats dates (relative, ISO), applies summary or diff-stat options, and prints to STDOUT or writes git-standup-report.txt.
h. Packaging & Distribution
– npm registry (via package.json), Homebrew formula, AUR, Snap (snapcraft.yaml), installer.sh, Makefile.
External integrations & infrastructure
• Git CLI: External dependency for all repo operations.
• npm / brew / aur / snap: Distribution channels.
• GitHub Actions: CI pipelines for shell linting (actions/shellcheck, actions/shfmt).
Relationships & data flow
– User invokes CLI → Argument Parser → Config Loader → Directory Scanner → Git Executor → Data Processor → Report Formatter → Output.
– Packaging flows from source code into various package managers.
– CI workflows run static analysis against the CLI scripts.
Architectural patterns & principles
• Single Responsibility: each module (scanner, executor, parser, formatter) has one clear job.
• Plugin-style extensibility: whitelisting, multiple output formats, custom date filters.
• Shell-and-Node hybrid: leverages the host shell for orchestration, Node (or POSIX sh) for parsing/formatting.