git-captains-log 0.7.3__tar.gz → 0.7.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/PKG-INFO +5 -2
  2. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/README.md +4 -1
  3. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/pyproject.toml +1 -1
  4. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/_version.py +2 -2
  5. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/projects/project_finder.py +24 -1
  6. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/.gitignore +0 -0
  7. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/LICENSE +0 -0
  8. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/docs/README.md +0 -0
  9. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/docs/ideas/README.md +0 -0
  10. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/docs/roadmap/README.md +0 -0
  11. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/__init__.py +0 -0
  12. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/app.py +0 -0
  13. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/btw.py +0 -0
  14. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/cli.py +0 -0
  15. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/cli_logging.py +0 -0
  16. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/config/__init__.py +0 -0
  17. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/config/config_loader.py +0 -0
  18. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/config/config_models.py +0 -0
  19. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/entries/__init__.py +0 -0
  20. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/entries/entry_formatter.py +0 -0
  21. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/entries/entry_models.py +0 -0
  22. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/entries/entry_processor.py +0 -0
  23. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/git/__init__.py +0 -0
  24. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/git/commit_parser.py +0 -0
  25. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/git/git_operations.py +0 -0
  26. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/hooks/commit-msg +0 -0
  27. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/hooks/commit-msg-package +0 -0
  28. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/hooks/post-commit +0 -0
  29. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/hooks/post-commit-package +0 -0
  30. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/logs/__init__.py +0 -0
  31. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/logs/log_manager.py +0 -0
  32. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/logs/log_models.py +0 -0
  33. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/logs/log_parser.py +0 -0
  34. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/logs/log_writer.py +0 -0
  35. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/projects/__init__.py +0 -0
  36. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/projects/project_models.py +0 -0
  37. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/publication.py +0 -0
  38. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/shortcuts.py +0 -0
  39. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/stone.py +0 -0
  40. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/update_log.py +0 -0
  41. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/wnext.py +0 -0
  42. {git_captains_log-0.7.3 → git_captains_log-0.7.4}/src/wtf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: git-captains-log
3
- Version: 0.7.3
3
+ Version: 0.7.4
4
4
  Summary: Automatically aggregate git commit messages daily into markdown logs
5
5
  Author: Captain's Log Team
6
6
  License-File: LICENSE
@@ -211,7 +211,10 @@ stone "Completed migration to new infrastructure"
211
211
  #### How They Work:
212
212
  - **Smart Project Detection**: Uses the same project detection logic as git commits
213
213
  - If you're in a configured project directory → logs to that project
214
- - If not configured → uses the current directory name as project
214
+ - Clones and worktrees outside configured roots can still join the same project; see
215
+ [project grouping rules](docs/adr/0004-project-grouping-tolerates-pooled-worktrees.md)
216
+ for directory-name matching and equivalent HTTPS/SSH origin URLs
217
+ - Otherwise → uses the repository directory name as project
215
218
  - **Different Sections**:
216
219
  - `btw` entries appear in the "What I did" section under "## other"
217
220
  - `wtf` entries appear in the "What Broke or Got Weird" section
@@ -200,7 +200,10 @@ stone "Completed migration to new infrastructure"
200
200
  #### How They Work:
201
201
  - **Smart Project Detection**: Uses the same project detection logic as git commits
202
202
  - If you're in a configured project directory → logs to that project
203
- - If not configured → uses the current directory name as project
203
+ - Clones and worktrees outside configured roots can still join the same project; see
204
+ [project grouping rules](docs/adr/0004-project-grouping-tolerates-pooled-worktrees.md)
205
+ for directory-name matching and equivalent HTTPS/SSH origin URLs
206
+ - Otherwise → uses the repository directory name as project
204
207
  - **Different Sections**:
205
208
  - `btw` entries appear in the "What I did" section under "## other"
206
209
  - `wtf` entries appear in the "What Broke or Got Weird" section
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "git-captains-log"
7
- version = "0.7.3"
7
+ version = "0.7.4"
8
8
  # dynamic = ["version"] # Temporarily disabled for release
9
9
  description = "Automatically aggregate git commit messages daily into markdown logs"
10
10
  authors = [
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.7.3'
22
- __version_tuple__ = version_tuple = (0, 7, 3)
21
+ __version__ = version = '0.7.4'
22
+ __version_tuple__ = version_tuple = (0, 7, 4)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -1,12 +1,35 @@
1
1
  """Project discovery functionality for Captain's Log."""
2
2
 
3
3
  import configparser
4
+ import re
4
5
  from pathlib import Path
5
6
  from typing import Optional
6
7
 
7
8
  from src.config.config_models import Config, ProjectConfig
8
9
  from src.projects.project_models import ProjectInfo
9
10
 
11
+ _REMOTE_URL = re.compile(
12
+ r"(?:https?://|ssh://git@)(?P<host>[A-Za-z0-9.-]+)/"
13
+ r"(?P<path>[^/\s:?#@]+/[^/\s:?#@]+?)(?:\.git)?(?P<slash>/?)"
14
+ )
15
+ _SCP_LIKE_REMOTE = re.compile(
16
+ r"git@(?P<host>[A-Za-z0-9.-]+):"
17
+ r"(?P<path>[^/\s:?#@]+/[^/\s:?#@]+?)(?:\.git)?"
18
+ )
19
+
20
+
21
+ def normalize_remote_url(url: str) -> tuple[str, str]:
22
+ """Canonicalize approved remote forms, retaining raw text for all others.
23
+
24
+ Only credential-free HTTP(S), git-user SSH without ports, and git-user
25
+ SCP forms are canonicalized. Host case is ignored; path case is preserved.
26
+ Only HTTP(S) forms accept a trailing slash.
27
+ """
28
+ match = _REMOTE_URL.fullmatch(url) or _SCP_LIKE_REMOTE.fullmatch(url)
29
+ if match is None or (url.startswith("ssh://") and match.group("slash")):
30
+ return "raw", url
31
+ return "canonical", f"{match.group('host').lower()}/{match.group('path')}"
32
+
10
33
 
11
34
  class ProjectFinder:
12
35
  """Handles finding and identifying projects from repository paths."""
@@ -87,7 +110,7 @@ class ProjectFinder:
87
110
  if remote_a is None or remote_b is None:
88
111
  return True
89
112
 
90
- return remote_a == remote_b
113
+ return normalize_remote_url(remote_a) == normalize_remote_url(remote_b)
91
114
 
92
115
  def _git_remote_url(self, repo: Path) -> Optional[str]:
93
116
  """Read the "origin" remote URL from a repo's git config, if any.