Skip to content
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

Feature Request: Allow local repositories #30

Open
kunalshah opened this issue Dec 16, 2024 · 2 comments
Open

Feature Request: Allow local repositories #30

kunalshah opened this issue Dec 16, 2024 · 2 comments
Labels
suggestion New feature or request

Comments

@kunalshah
Copy link

In addition to the GitHub Public repo URL, add the support to select the local repositories folder from the UI.
As the server side reads the repo currently, it is probably easier to read if the repo is already on the disk.

@cyclotruc cyclotruc added the suggestion New feature or request label Dec 16, 2024
@cyclotruc
Copy link
Owner

Yes! I'm planning to add this
I'm currently thinking about how to do the upload properly

I imagine:

  • drop the code-base folder/archive anywhere on the homepage to ingest

If anyone has any idea while this is still in the brainstorming phase

@kunalshah
Copy link
Author

How about adding checkboxes "local directory" and "remote repo"?
and for the repote repo, user would continue to paste the repote repo path (as they are doing today)
with the local directory, user would paste the directory full path. On the server side, if the directory exists, the contents of the directory would be ingested.

Note that local directory doesn't have to be a git repo.

vishwamartur added a commit to vishwamartur/gitingest that referenced this issue Dec 24, 2024
Related to cyclotruc#30

Add support for local directories in the UI and backend.

* **UI Changes:**
  - Add a file input field for selecting local directories in `src/templates/components/github_form.jinja`.
  - Add checkboxes to select between "local directory" and "remote repo" options in `src/templates/components/github_form.jinja`.

* **Backend Changes:**
  - Update `ingest` function in `src/gitingest/ingest.py` to handle local directories by checking if the input is a directory path.
  - Modify `parse_query` function in `src/gitingest/parse_query.py` to parse local directory paths and set appropriate query parameters.
  - Ensure the `scan_directory` function in `src/gitingest/ingest_from_query.py` includes safety limits such as `MAX_DIRECTORY_DEPTH`, `MAX_FILES`, and `MAX_TOTAL_SIZE_BYTES` to prevent excessive processing.

* **Documentation:**
  - Update `README.md` to include instructions for using local directories with the CLI and Python package.

* **User Feedback:**
  - Provide feedback to the user if the directory exceeds the safety limits in `src/templates/components/result.jinja`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants