Diff between b5e7fec184889ccc2c5c83b495774f2581cf93b1 and 05cce24a7913e2227709ed8530a65798b6934889

Changed Files

File Additions Deletions Status
git/repo.py +9 -1 modified
templates/index.html +10 -3 modified

Full Patch

diff --git a/git/repo.py b/git/repo.py
index 3fe2e7a..0568a81 100644
--- a/git/repo.py
+++ b/git/repo.py
@@ -12,9 +12,17 @@ def get_bare_repos(path):
             try:
                 repo = git.Repository(str(item))
                 if repo.is_bare:
+                    description = ""
+                    desc_file = item / "description"
+                    if desc_file.exists():
+                        try:
+                            description = desc_file.read_text().strip()
+                        except:
+                            pass
                     repo_info = {
                         "name": item.name,
-                        "path": str(item.resolve())
+                        "path": str(item.resolve()),
+                        "description": description
                     }
                     repos.append(repo_info)
             except git.GitError:
diff --git a/templates/index.html b/templates/index.html
index 83b9be9..9e8c59a 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -21,11 +21,18 @@
         A git interface for repositories. In development. Currently supports basic git pluming features, and views commits, trees, blobs, diffs and refs. Feautres like stats, commit signature verification, grep, submodules, auth, sql db integration are planned.  
     </p>
     <h2>Repositories</h2>
-    <ul>
+    <div style="display: flex; flex-direction: column; gap: 8px;">
         {% for repo in repos %}
-            <li><a href="{{ url_for('repo_detail', repo_name=repo.name) }}">{{ repo.name }}</a></li>
+            <div style="padding: 16px; background-color: #f9f9f9; border-radius: 8px;">
+                <h4 style="margin: 0 0 8px 0;"><a href="{{ url_for('repo_detail', repo_name=repo.name) }}" style="font-weight: normal;">{{ repo.name }}</a></h4>
+                {% if repo.description %}
+                    <p style="margin: 0; color: gray; font-size: 14px;">{{ repo.description }}</p>
+                {% else %}
+                    <p style="margin: 0; color: gray; font-size: 14px; font-style: italic;">No description available</p>
+                {% endif %}
+            </div>
         {% endfor %}
-    </ul>
+    </div>
     <small>
         Libgit2 - {{ version }}  git 
     </small>