{"record":{"id":"41257fe009ec9e39","repo":"tirth8205/code-review-graph","slug":"path-does-not-look-like-a-repository-no-git-sv","errorCode":null,"errorMessage":"Path does not look like a repository (no .git, .svn, or .code-review-graph): {resolved}","messagePattern":"Path does not look like a repository \\(no \\.git, \\.svn, or \\.code-review-graph\\): (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"code_review_graph/registry.py","lineNumber":92,"sourceCode":"            alias: Optional short alias for the repository.\n            data_dir: Optional external directory for graph database.\n\n        Returns:\n            The registered entry dict.\n\n        Raises:\n            ValueError: If the path is not a valid repository.\n        \"\"\"\n        resolved = Path(path).resolve()\n        if not resolved.is_dir():\n            raise ValueError(f\"Path is not a directory: {resolved}\")\n        has_repo_marker = (\n            (resolved / \".git\").exists()\n            or (resolved / \".svn\").exists()\n            or (resolved / \".code-review-graph\").exists()\n        )\n        if not has_repo_marker:\n            raise ValueError(\n                f\"Path does not look like a repository \"\n                f\"(no .git, .svn, or .code-review-graph): {resolved}\"\n            )\n\n        with self._lock:\n            # Check for duplicate path\n            str_path = str(resolved)\n            for entry in self._repos:\n                if entry[\"path\"] == str_path:\n                    # Update alias and/or data_dir if provided\n                    if alias:\n                        entry[\"alias\"] = alias\n                    if data_dir:\n                        entry[\"data_dir\"] = str(Path(data_dir).resolve())\n                    self._save()\n                    return entry\n\n            new_entry: dict[str, str] = {\"path\": str_path}","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/tirth8205/code-review-graph/blob/b58668751ab0c7670c078cf7cbd4d1f5b8e54f81/code_review_graph/registry.py#L74-L110","documentation":"register() accepts a directory only if it looks like a repository: it must contain a .git dir, a .svn dir, or a .code-review-graph marker. Otherwise it refuses with this ValueError listing the resolved path.","triggerScenarios":"Calling register() on an ordinary directory that has none of the three markers — e.g. a plain source folder, a mounted volume, or a repo copied without its .git directory.","commonSituations":"Registering extracted source tarballs or docker volume mounts that lack VCS metadata; copying a repo with 'cp -r' excluding dotfiles; trying to register a workspace folder before git init.","solutions":["If the directory is genuinely a repo, run it from within git (git init / git clone) so .git exists, or re-copy including dotfiles.","For non-VCS trees you still want tracked, create the marker directory: mkdir .code-review-graph.","Verify you registered the repo root, not a subdirectory that happens to lack markers."],"exampleFix":"# before\nregistry.register(\"/data/plain-source-tree\")\n# after\nmkdir /data/plain-source-tree/.code-review-graph\nregistry.register(\"/data/plain-source-tree\")","handlingStrategy":"type-guard","validationCode":"from pathlib import Path\np = Path(path).resolve()\nif not any((p / m).exists() for m in (\".git\", \".svn\", \".code-review-graph\")):\n    (p / \".code-review-graph\").mkdir(exist_ok=True)  # opt in explicitly","typeGuard":"def looks_like_repo(path: Path) -> bool:\n    p = path.resolve()\n    return p.is_dir() and any((p / m).exists() for m in (\".git\", \".svn\", \".code-review-graph\"))","tryCatchPattern":"try:\n    registry.register(path)\nexcept ValueError as exc:\n    if \"does not look like a repository\" in str(exc):\n        (path / \".code-review-graph\").mkdir(exist_ok=True)\n        registry.register(path)","preventionTips":["Clone repos properly rather than copying without dotfiles.","Create the .code-review-graph marker directory for non-VCS trees you intend to track.","Check markers with a helper before calling register()."],"tags":["registry","repo-detection","git"],"backgroundTag":"not-a-git-repository","analyzedSha":"b58668751ab0c7670c078cf7cbd4d1f5b8e54f81","analyzedAt":"2026-08-28T13:19:08.966Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}