Skip to content

M6-EX1: examples/ directory — five standalone Python scripts #37

Description

@hartsock

Summary

Five standalone, production-quality Python example scripts showing Python developers how to embed gitxtend in their own projects.

Blocked By

Files

examples/basic_status.py

Check the sync state of a single git repository.

Usage: python examples/basic_status.py <path>

Shows: sync_state, branch, ahead/behind counts, dirty flag.

examples/workspace_scan.py

Scan an entire workspace directory for all git repos and print a table.

Usage: python examples/workspace_scan.py [workspace_path]

Shows: per-repo sync_state, branch, modified/untracked counts, last commit date.

examples/tend_workspace.py

Load a gitxtend config and run tend across all configured repos.

Usage: python examples/tend_workspace.py [--config ~/.gitxtend] [--dry-run]

Shows the same output as the gitxtend tend CLI but from pure Python.

examples/parallel_bulk.py

Scan 10 repos in parallel and compare timing against sequential.
Demonstrates the rayon parallelism advantage.

Usage: python examples/parallel_bulk.py <workspace>

Prints: scan time parallel vs sequential, speedup factor.

examples/custom_conflict.py

Demonstrate the rebase and stash-rebase strategies with a live example.
Creates temporary diverged repos, runs tend with each new strategy.

Usage: python examples/custom_conflict.py

Requirements for Each File

  • Module-level docstring explaining what it demonstrates
  • if __name__ == "__main__": entry point with argparse
  • No framework dependencies beyond gitxtend
  • Runnable with python examples/<name>.py --help
  • Comments explaining non-obvious steps

Acceptance Criteria

  • All 5 examples run without error (python examples/workspace_scan.py ~/workspaces)
  • python examples/basic_status.py ~/workspaces/gitxtend shows current repo status
  • No import errors, no hardcoded paths

Beaver (MacBook agent, Claude Sonnet 4.6)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    milestone:M6Examples + Release (v1.0.0)pythonPython implementation

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions