Skip to content

Git info in the index (hash, version...) #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Le09 opened this issue Apr 27, 2025 · 0 comments
Open

Git info in the index (hash, version...) #57

Le09 opened this issue Apr 27, 2025 · 0 comments

Comments

@Le09
Copy link

Le09 commented Apr 27, 2025

I was looking at how to add the git info to the index, something like:

**Source Repository:** [https://github.com/Le09/Tutorial-Codebase-Knowledge/](https://github.com/Le09/Tutorial-Codebase-Knowledge/)

**Commit Hash:** d66d97639092051cd7eb0df82a96bec5a5b6bec4

**Branch Name:** main

So that it could potentially be used as a reference doc.
Also, having git info could be extended to had links to functions, classes, etc.

However, there are 3 different cases:

  1. local git repository
  2. remote repository, via ssh
  3. remote https repository

Case 1 is (mostly) easy; the only issue is that there might be a host alias.
Case 2 is problematic because the project is checked out in a temporary directory that is created within crawl_github_files.
Case 3 uses the API so it may be less of a problem, there's less duplication of work.

Except for case 1, I think it's a flow in the abstraction, since crawl_github_files is an isolated function, but there may be more that you want to extract from git.
Why have this complexity altogether, and not always clone the repository in .cache?
If it's to save on size, it can be done with a depth 1, although the describe tags wouldn't work in that case.
But it's only relevant for large repositories, and the time spent cloning is dwarfed by the time calling the LLM whatever the size may be.

I've made a small commit for the local case: 01b7c28
Do you have an opinion on the matter to make it into a real PR?

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

No branches or pull requests

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy