Skip to content

Commit d3bde06

Browse files
committed
delay git import, do not process git history
1 parent eeb5b3a commit d3bde06

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

code_graph/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def process_repo():
160160

161161
proj = Project.from_git_repository(url)
162162
proj.analyze_sources(ignore)
163-
proj.process_git_history(ignore)
163+
#proj.process_git_history(ignore)
164164

165165
# Create a response
166166
response = {

code_graph/git_utils/git_graph.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import os
22
import logging
3-
from git import Commit
4-
from falkordb import FalkorDB, Node
53
from typing import List, Optional
4+
from falkordb import FalkorDB, Node
65

76
# Configure logging
87
logging.basicConfig(level=logging.DEBUG, format='%(filename)s - %(asctime)s - %(levelname)s - %(message)s')
@@ -41,7 +40,7 @@ def _commit_from_node(self, node:Node) -> dict:
4140
'author': node.properties['author'],
4241
'message': node.properties['message']}
4342

44-
def add_commit(self, commit: Commit) -> None:
43+
def add_commit(self, commit) -> None:
4544
"""
4645
Add a new commit to the graph
4746
"""

code_graph/git_utils/git_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import threading
77
import subprocess
88
from ..info import *
9-
from git import Repo
109
from pathlib import Path
1110
from ..graph import Graph
1211
from .git_graph import GitGraph
@@ -78,6 +77,8 @@ def build_commit_graph(
7877
GitGraph: Graph object representing the commit history.
7978
"""
8079

80+
from git import Repo
81+
8182
# Copy the graph into a temporary graph
8283
logging.info(f"Cloning source graph {repo_name} -> {repo_name}_tmp")
8384
# Will be deleted at the end of this function

code_graph/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _clone_source(url: str, name: str) -> Path:
3333

3434
# Run the git clone command and wait for it to finish
3535
result = subprocess.run(cmd, check=True, capture_output=True, text=True)
36-
36+
3737
return path
3838

3939
class Project():

0 commit comments

Comments
 (0)