Skip to content

Raaghulk04/Geneology

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Function History Retriever

This project is a small starter tool for exploring how a function evolved over time in a GitHub repository.

What it does

  1. Clones or reuses a local checkout of a Git repository.
  2. Retrieves commit history from that repository.
  3. Filters commits to those likely related to a given function name.
  4. Prints a compact timeline you can build on later.
  5. Optionally asks an LLM to explain how the function evolved across those commits.

Project layout

  • src/repo_history/git_tools.py: Git clone and log retrieval helpers.
  • src/repo_history/function_history.py: Function-oriented commit filtering logic.
  • src/repo_history/cli.py: Command-line entrypoint.

Quick start

python3 -m src.repo_history.cli \
  --repo-url https://github.com/pallets/flask.git \
  --function-name route

AI explanation mode

Set an API key and model first:

export OPENAI_API_KEY=your_api_key
export OPENAI_MODEL=your_model_id

Then run:

python3 -m src.repo_history.cli \
  --repo-url https://github.com/pallets/flask.git \
  --function-name route \
  --explain-with-ai

Useful flags:

  • --show-patches: print full matching patches in the terminal
  • --ai-model: override OPENAI_MODEL for one run
  • --ai-base-url: point at an OpenAI-compatible API endpoint
  • --ai-max-commits: limit how many matching commits are sent to the model
  • --ai-max-patch-chars: truncate each patch before it is added to the prompt

Notes

This version uses git log -S to find commits where the exact function name text changed. That is a useful baseline, but it is not perfect:

  • It may miss refactors where the function moved without the name text changing.
  • It may include unrelated uses of the same name.
  • It does not yet parse language syntax.
  • The AI explanation is only as good as the commits surfaced by that search strategy.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages