Skip to content

Conversation

@reach-junaidsyed
Copy link

Title: Docs: Add Advanced Usage Examples to README

Body:

This PR enhances the README.md by adding examples for more advanced usage scenarios that were not previously covered, aiming to improve user understanding and usability.

Motivation:

The current README examples cover basic usage well, but lack demonstrations for:

  1. Applying multiple include or exclude patterns via the CLI.
  2. Utilizing the Python API to combine include_patterns and exclude_patterns for more complex filtering logic.

Adding these examples makes the tool's capabilities clearer for common and powerful use cases.

Changes Made:

  1. Added Subsection to CLI Usage:

    • Introduced a "Using Multiple Patterns (CLI)" section.
    • Provided examples showing how to use -e/--exclude-pattern and -i/--include-pattern multiple times in a single command.
    • Included examples for excluding various file types/directories and including specific file types.
  2. Added Subsection to Python API Usage:

    • Introduced an "Advanced Pattern Usage (Python API)" section.
    • Included a detailed Python code example demonstrating how to use include_patterns and exclude_patterns arguments together.
    • The example showcases a practical scenario (ingesting only non-log files from a specific src/ directory within a branch).
    • Provided variants for both synchronous (ingest) and asynchronous (ingest_async) functions.
    • Explicitly explained the interaction logic: exclusions are applied first, then includes (if provided).

Verification:

  • The added CLI commands and Python code snippets have been reviewed for accuracy and represent valid usage patterns of the gitingest tool.

This contribution aims to make it easier for users to leverage the pattern-matching features of gitingest effectively through both its command-line and Python interfaces.

@filipchristiansen filipchristiansen changed the title Docs/add usage examples docs: add advanced usage examples for CLI & Python API Jun 23, 2025
@cyclotruc
Copy link
Member

After considering this pr for a while I think this represent too much information for the main readme

The added new patterns section pushes back the first time you see the python usage and I think that's not something we want: gitingest aims to be simple to onboard and use for the first time, ideally the python usage should even surface higher in the readme

So I'll be closing this PR, I hope it makes sense
thanks anyway for your work @reach-junaidsyed

@cyclotruc cyclotruc closed this Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants