git-ew 0.1.0__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 (73) hide show
  1. git_ew-0.1.0/AI_POLICY.md +15 -0
  2. git_ew-0.1.0/CHANGELOG.md +37 -0
  3. git_ew-0.1.0/CODE_OF_CONDUCT.md +84 -0
  4. git_ew-0.1.0/CONTRIBUTING.md +180 -0
  5. git_ew-0.1.0/LICENSE +15 -0
  6. git_ew-0.1.0/PKG-INFO +291 -0
  7. git_ew-0.1.0/README.md +248 -0
  8. git_ew-0.1.0/config/coverage.ini +25 -0
  9. git_ew-0.1.0/config/git-changelog.toml +9 -0
  10. git_ew-0.1.0/config/pytest.ini +16 -0
  11. git_ew-0.1.0/config/ruff.toml +76 -0
  12. git_ew-0.1.0/config/ty.toml +6 -0
  13. git_ew-0.1.0/config/vscode/launch.json +56 -0
  14. git_ew-0.1.0/config/vscode/settings.json +31 -0
  15. git_ew-0.1.0/config/vscode/tasks.json +97 -0
  16. git_ew-0.1.0/config/zed/debug.json +44 -0
  17. git_ew-0.1.0/config/zed/settings.json +43 -0
  18. git_ew-0.1.0/config/zed/tasks.json +72 -0
  19. git_ew-0.1.0/docs/.overrides/main.html +18 -0
  20. git_ew-0.1.0/docs/.overrides/partials/comments.html +57 -0
  21. git_ew-0.1.0/docs/changelog.md +5 -0
  22. git_ew-0.1.0/docs/code_of_conduct.md +5 -0
  23. git_ew-0.1.0/docs/contributing.md +5 -0
  24. git_ew-0.1.0/docs/credits.md +9 -0
  25. git_ew-0.1.0/docs/css/apidocs.css +21 -0
  26. git_ew-0.1.0/docs/index.md +7 -0
  27. git_ew-0.1.0/docs/js/feedback.js +14 -0
  28. git_ew-0.1.0/docs/license.md +11 -0
  29. git_ew-0.1.0/docs/reference/api.md +7 -0
  30. git_ew-0.1.0/duties.py +248 -0
  31. git_ew-0.1.0/pyproject.toml +123 -0
  32. git_ew-0.1.0/scripts/create_sample_data.py +263 -0
  33. git_ew-0.1.0/scripts/gen_credits.py +190 -0
  34. git_ew-0.1.0/scripts/get_version.py +49 -0
  35. git_ew-0.1.0/scripts/make +1 -0
  36. git_ew-0.1.0/scripts/make.py +250 -0
  37. git_ew-0.1.0/src/git_ew/__init__.py +166 -0
  38. git_ew-0.1.0/src/git_ew/__main__.py +32 -0
  39. git_ew-0.1.0/src/git_ew/_internal/__init__.py +17 -0
  40. git_ew-0.1.0/src/git_ew/_internal/app.py +418 -0
  41. git_ew-0.1.0/src/git_ew/_internal/cli.py +246 -0
  42. git_ew-0.1.0/src/git_ew/_internal/config.py +148 -0
  43. git_ew-0.1.0/src/git_ew/_internal/database.py +297 -0
  44. git_ew-0.1.0/src/git_ew/_internal/debug.py +130 -0
  45. git_ew-0.1.0/src/git_ew/_internal/email_fetcher.py +301 -0
  46. git_ew-0.1.0/src/git_ew/_internal/email_parser.py +274 -0
  47. git_ew-0.1.0/src/git_ew/_internal/email_sender.py +220 -0
  48. git_ew-0.1.0/src/git_ew/_internal/mailing_lists/__init__.py +19 -0
  49. git_ew-0.1.0/src/git_ew/_internal/mailing_lists/zsh_workers/__init__.py +17 -0
  50. git_ew-0.1.0/src/git_ew/_internal/mailing_lists/zsh_workers/ingest.py +427 -0
  51. git_ew-0.1.0/src/git_ew/_internal/mailing_lists/zsh_workers/sync_archives.py +300 -0
  52. git_ew-0.1.0/src/git_ew/_internal/models.py +149 -0
  53. git_ew-0.1.0/src/git_ew/_internal/secrets.py +59 -0
  54. git_ew-0.1.0/src/git_ew/_internal/sync.py +156 -0
  55. git_ew-0.1.0/src/git_ew/_internal/thread_utils.py +185 -0
  56. git_ew-0.1.0/src/git_ew/py.typed +0 -0
  57. git_ew-0.1.0/src/git_ew/static/css/style.css +608 -0
  58. git_ew-0.1.0/src/git_ew/static/js/main.js +47 -0
  59. git_ew-0.1.0/src/git_ew/templates/base.html +38 -0
  60. git_ew-0.1.0/src/git_ew/templates/index.html +44 -0
  61. git_ew-0.1.0/src/git_ew/templates/thread.html +153 -0
  62. git_ew-0.1.0/tests/__init__.py +25 -0
  63. git_ew-0.1.0/tests/conftest.py +19 -0
  64. git_ew-0.1.0/tests/test_api.py +197 -0
  65. git_ew-0.1.0/tests/test_cli.py +121 -0
  66. git_ew-0.1.0/tests/test_database.py +142 -0
  67. git_ew-0.1.0/tests/test_email_fetcher.py +97 -0
  68. git_ew-0.1.0/tests/test_email_parser.py +109 -0
  69. git_ew-0.1.0/tests/test_reply_metadata.py +51 -0
  70. git_ew-0.1.0/tests/test_secrets.py +53 -0
  71. git_ew-0.1.0/tests/test_thread_utils.py +158 -0
  72. git_ew-0.1.0/tests/test_zsh_workers_ingest.py +86 -0
  73. git_ew-0.1.0/zensical.toml +186 -0
@@ -0,0 +1,15 @@
1
+ # AI Contribution Policy
2
+
3
+ We accept AI-*assisted* contributions, both for code and documentation, with the following expectations:
4
+
5
+ - AI-assisted contributions must disclaim their use of AI.
6
+ - Contributors must fully understand the proposed changes and be able to explain why they are the correct approach.
7
+ - Issues must be created before creating pull requests (unless there is already a relevant issue).
8
+ - Issue and pull request templates must be followed.
9
+ - Comments (including bodies) in issues and pull requests must be written by humans. If you use LLMs to translate from one language to another, please include your original comment and the translated one.
10
+ - Git commits must be authored by humans, not AI/bot accounts or identities.
11
+ - Git commit messages must be written by humans, in English. If you cannot write English, please state so in the pull request body and we will write the commit messages ourselves.
12
+
13
+ Failure to comply with any of these requirements will result in issues or pull requests being closed immediately without comment. Repeated violations of this policy will result in a ban of the offending accounts/identities from contributing to this project and any related project from the same author/organization.
14
+
15
+ We do not accept AI-generated content in community spaces we maintain or moderate, such as GitHub discussions or Matrix rooms.
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+ <!-- insertion marker -->
9
+ ## [0.1.0](https://github.com/pawamoy/git-ew/releases/tag/0.1.0) - 2026-10-06
10
+
11
+ <small>[Compare with first commit](https://github.com/pawamoy/git-ew/compare/51f9194bfe7f135376dedc9035f0726fb8960a30...0.1.0)</small>
12
+
13
+ ### Features
14
+
15
+ - Extract and backfill MIME patch attachments ([7e2b3be](https://github.com/pawamoy/git-ew/commit/7e2b3bec937e6aee36d9b40b4d3ff255f244557e) by Timothée Mazzucotelli).
16
+ - Add zsh-workers archive ingestion command ([83db052](https://github.com/pawamoy/git-ew/commit/83db052a98b04517e183ed14542e44d534846009) by Timothée Mazzucotelli).
17
+ - Support reply-all and archive sent messages ([b02a0f9](https://github.com/pawamoy/git-ew/commit/b02a0f9697c20227dcdd8c40f86c89fa6fc8c9f1) by Timothée Mazzucotelli).
18
+ - Add IMAP account configuration and syncing ([1216023](https://github.com/pawamoy/git-ew/commit/1216023772ef150601dbee534f30539be0660ae2) by Timothée Mazzucotelli).
19
+ - Hide quoted previous email under details ([a15500e](https://github.com/pawamoy/git-ew/commit/a15500e251ea4f5753ec654f38dd3c8e6fac05c5) by Timothée Mazzucotelli).
20
+ - Sync and ingestion of zsh-workers mailing list ([01bc7e9](https://github.com/pawamoy/git-ew/commit/01bc7e9b36b1df7e9e1e70dc84ee18c6b28b8798) by Timothée Mazzucotelli).
21
+ - Initial (vibe-coded) version ([51f9194](https://github.com/pawamoy/git-ew/commit/51f9194bfe7f135376dedc9035f0726fb8960a30) by Timothée Mazzucotelli).
22
+
23
+ ### Bug Fixes
24
+
25
+ - Resolve type-checking errors ([7f4165a](https://github.com/pawamoy/git-ew/commit/7f4165a9ee817f934beac0b9d8a3becc7aee4453) by Timothée Mazzucotelli).
26
+ - Filter archive ingestion by date ([49ce25a](https://github.com/pawamoy/git-ew/commit/49ce25afda1d0389006afce98d42a25cb0df7176) by Timothée Mazzucotelli).
27
+ - Allow SMTP without authentication ([0187fa0](https://github.com/pawamoy/git-ew/commit/0187fa006797d6d72586914ddbdfb3e28db03ce8) by Timothée Mazzucotelli).
28
+ - Report email synchronization failures ([b861fd6](https://github.com/pawamoy/git-ew/commit/b861fd6a6fe95b58c3228057ad31c674aacbdc8d) by Timothée Mazzucotelli).
29
+ - Correct collapsing/expanding behavior ([469af2b](https://github.com/pawamoy/git-ew/commit/469af2b4ad1658e96f67a95c5fda822a7e66c848) by Timothée Mazzucotelli).
30
+ - Fix decoding (UTF8) ([821f4a8](https://github.com/pawamoy/git-ew/commit/821f4a82fae36e4582accd2f415ac9d04b217383) by Timothée Mazzucotelli).
31
+ - Collapsing/unfolding threads ([783f968](https://github.com/pawamoy/git-ew/commit/783f9685a4b630669e67a148c10d39821935ad21) by Timothée Mazzucotelli).
32
+
33
+ ### Code Refactoring
34
+
35
+ - Use logging outside the CLI ([8099404](https://github.com/pawamoy/git-ew/commit/809940439d4ed73721d5a2130aa3b9b358ae422f) by Timothée Mazzucotelli).
36
+ - Simplify thread views ([1095340](https://github.com/pawamoy/git-ew/commit/1095340d4ec84faffe74fde04286181543ad6f07) by Timothée Mazzucotelli).
37
+ - Better indentation (visual indications of branching vs single reply) ([45bdff6](https://github.com/pawamoy/git-ew/commit/45bdff64cff1221a86bdab887f8ea5bba50a071d) by Timothée Mazzucotelli).
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
22
+ * Trolling, insulting or derogatory comments, and personal or political attacks
23
+ * Public or private harassment
24
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
25
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Enforcement Responsibilities
28
+
29
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
+
33
+ ## Scope
34
+
35
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
+
37
+ ## Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at dev@pawamoy.fr. All complaints will be reviewed and investigated promptly and fairly.
40
+
41
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42
+
43
+ ## Enforcement Guidelines
44
+
45
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46
+
47
+ ### 1. Correction
48
+
49
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50
+
51
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52
+
53
+ ### 2. Warning
54
+
55
+ **Community Impact**: A violation through a single incident or series of actions.
56
+
57
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58
+
59
+ ### 3. Temporary Ban
60
+
61
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62
+
63
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64
+
65
+ ### 4. Permanent Ban
66
+
67
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68
+
69
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
70
+
71
+ ## Attribution
72
+
73
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74
+
75
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76
+
77
+ For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78
+
79
+ [homepage]: https://www.contributor-covenant.org
80
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81
+ [Mozilla CoC]: https://github.com/mozilla/diversity
82
+ [FAQ]: https://www.contributor-covenant.org/faq
83
+ [translations]: https://www.contributor-covenant.org/translations
84
+
@@ -0,0 +1,180 @@
1
+ # Contributing
2
+
3
+ Contributions are welcome, and they are greatly appreciated. Every little bit helps, and credit will always be given.
4
+
5
+ **Please always create an issue before working on a new feature or a bug fix, so that we can discuss the implementation and make sure that your work will be merged.**
6
+
7
+ ## Environment setup
8
+
9
+ Install [uv](https://github.com/astral-sh/uv) and [direnv](https://direnv.net/), fork and clone the repository, then:
10
+
11
+ ```bash
12
+ git clone https://github.com/pawamoy/git-ew.git
13
+ cd git-ew
14
+ direnv allow
15
+ make setup
16
+ ```
17
+
18
+ You now have the dependencies installed.
19
+
20
+ 1. Create a branch: `git switch -c feature-or-bugfix-name`
21
+ 2. Make your changes
22
+ 3. Run checks:
23
+ ```bash
24
+ make format # Auto-format code
25
+ make check # Run all checks
26
+ make test # Run tests
27
+ ```
28
+ 4. If updating documentation: `make docs` and verify at http://localhost:8000
29
+ 5. Follow the commit message convention below
30
+
31
+ ## Project Structure
32
+
33
+ ```
34
+ src/git_ew/_internal/
35
+ ├── cli.py # Command-line interface
36
+ ├── app.py # FastAPI application
37
+ ├── models.py # SQLAlchemy models
38
+ ├── database.py # Database operations
39
+ ├── email_parser.py # Email parsing
40
+ ├── email_fetcher.py # Fetch from sources
41
+ ├── email_sender.py # SMTP sending
42
+ ├── thread_utils.py # Thread organization
43
+ ├── sync.py # Email sync
44
+ ├── templates/ # Jinja2 templates
45
+ └── static/ # CSS and JavaScript
46
+
47
+ tests/
48
+ ├── test_database.py
49
+ ├── test_email_parser.py
50
+ └── test_thread_utils.py
51
+ ```
52
+
53
+ The entry-point to run commands and tasks is the `make` Python script, located in the `scripts` directory. Try running `make` to show the available commands and tasks. The *commands* do not need the Python dependencies to be installed, while the *tasks* do. The cross-platform tasks are written in Python, thanks to [duty](https://github.com/pawamoy/duty).
54
+
55
+ Run tests with pytest:
56
+
57
+ ```bash
58
+ pytest
59
+ pytest --cov # With coverage
60
+ ```
61
+
62
+ Write async tests with pytest-asyncio:
63
+
64
+ ```python
65
+ import pytest
66
+ from git_ew._internal.database import Database
67
+
68
+ @pytest.mark.asyncio
69
+ async def test_database():
70
+ db = Database("sqlite+aiosqlite:///:memory:")
71
+ await db.init_db()
72
+ thread = await db.create_thread("Test", "msg1", is_patch=False)
73
+ assert thread.id is not None
74
+ ```
75
+
76
+ ## Code Style
77
+
78
+ - Follow PEP 8
79
+ - Use type hints
80
+ - Write docstrings for public APIs
81
+ - Prefer async/await for I/O operations
82
+ - Keep functions focused and small
83
+
84
+ Example:
85
+
86
+ ```python
87
+ async def get_thread_messages(
88
+ db: Database,
89
+ thread_id: int,
90
+ ) -> list[Message]:
91
+ """Get all messages in a thread.
92
+
93
+ Args:
94
+ db: Database instance.
95
+ thread_id: Thread ID.
96
+
97
+ Returns:
98
+ List of messages in chronological order.
99
+ """
100
+ thread = await db.get_thread(thread_id)
101
+ if not thread:
102
+ return []
103
+ return sorted(thread.messages, key=lambda m: m.date)
104
+ ```
105
+
106
+ ## Adding Features
107
+
108
+ When adding a new email source type:
109
+
110
+ 1. Create fetcher class in `_internal/email_fetcher.py`
111
+ 2. Update factory function
112
+ 3. Add tests
113
+ 4. Update documentation
114
+
115
+ ## Debugging
116
+
117
+ Database inspection:
118
+
119
+ ```bash
120
+ sqlite3 git_ew.db
121
+ .tables
122
+ SELECT * FROM threads;
123
+ ```
124
+
125
+ Enable debug logging:
126
+
127
+ ```python
128
+ import logging
129
+ logging.basicConfig(level=logging.DEBUG)
130
+ ```
131
+
132
+ ## Commit Message Convention
133
+
134
+ Follow the [Angular convention](https://gist.github.com/stephenparish/9941e89d80e2bc58a153):
135
+
136
+ ```
137
+ <type>[(scope)]: Subject
138
+
139
+ [Body]
140
+ ```
141
+
142
+ Types: `build`, `chore`, `ci`, `deps`, `docs`, `feat`, `fix`, `perf`, `refactor`, `style`, `tests`
143
+
144
+ Subject and body must be valid Markdown. Capitalize subject but no trailing dot.
145
+
146
+ Add trailers at the end for references:
147
+
148
+ ```
149
+ Issue #10: https://github.com/namespace/project/issues/10
150
+ ```
151
+
152
+ ## Pull Requests
153
+
154
+ Link related issues in the PR message.
155
+
156
+ Use fixups during review:
157
+
158
+ ```bash
159
+ git commit --fixup=SHA
160
+ git rebase -i --autosquash main
161
+ git push -f
162
+ ```
163
+
164
+ Or push each commit and we'll squash before merging.
165
+
166
+ ## Email Patches
167
+
168
+ Send patches via email:
169
+
170
+ ```bash
171
+ git format-patch origin/main
172
+ git send-email *.patch
173
+ ```
174
+
175
+ ## Questions
176
+
177
+ - Check documentation
178
+ - Open a GitHub issue
179
+ - Join Matrix/Gitter discussion
180
+ - Email maintainers
git_ew-0.1.0/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026, Timothée Mazzucotelli and contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
git_ew-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,291 @@
1
+ Metadata-Version: 2.4
2
+ Name: git-ew
3
+ Version: 0.1.0
4
+ Summary: Git Email Workflow
5
+ Author-Email: Timothée Mazzucotelli <dev@pawamoy.fr>
6
+ License-Expression: ISC
7
+ License-File: LICENSE
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Python :: 3.15
17
+ Classifier: Topic :: Documentation
18
+ Classifier: Topic :: Software Development
19
+ Classifier: Topic :: Utilities
20
+ Classifier: Typing :: Typed
21
+ Project-URL: Homepage, https://pawamoy.github.io/git-ew
22
+ Project-URL: Documentation, https://pawamoy.github.io/git-ew
23
+ Project-URL: Changelog, https://pawamoy.github.io/git-ew/changelog
24
+ Project-URL: Repository, https://github.com/pawamoy/git-ew
25
+ Project-URL: Issues, https://github.com/pawamoy/git-ew/issues
26
+ Project-URL: Discussions, https://github.com/pawamoy/git-ew/discussions
27
+ Project-URL: Gitter, https://gitter.im/git-ew/community
28
+ Project-URL: Funding, https://github.com/sponsors/pawamoy
29
+ Requires-Python: >=3.12
30
+ Requires-Dist: fastapi>=0.115.0
31
+ Requires-Dist: uvicorn[standard]>=0.32.0; python_version < "3.15"
32
+ Requires-Dist: uvicorn>=0.32.0; python_version >= "3.15"
33
+ Requires-Dist: sqlalchemy>=2.0.0
34
+ Requires-Dist: alembic>=1.13.0
35
+ Requires-Dist: aiosqlite<0.22.0,>=0.20.0
36
+ Requires-Dist: jinja2>=3.1.0
37
+ Requires-Dist: python-multipart>=0.0.9
38
+ Requires-Dist: httpx>=0.27.0
39
+ Requires-Dist: aiofiles>=24.1.0
40
+ Requires-Dist: markdown>=3.5.0
41
+ Requires-Dist: pymdown-extensions>=10.0.0
42
+ Description-Content-Type: text/markdown
43
+
44
+ # git-ew
45
+
46
+ [![ci](https://github.com/pawamoy/git-ew/workflows/ci/badge.svg)](https://github.com/pawamoy/git-ew/actions?query=workflow%3Aci)
47
+ [![documentation](https://img.shields.io/badge/docs-zensical-FF9100.svg?style=flat)](https://pawamoy.github.io/git-ew/)
48
+ [![pypi version](https://img.shields.io/pypi/v/git-ew.svg)](https://pypi.org/project/git-ew/)
49
+ [![gitter](https://img.shields.io/badge/matrix-chat-4DB798.svg?style=flat)](https://app.gitter.im/#/room/#git-ew:gitter.im)
50
+
51
+ Git Email Workflow - A GitHub-like web interface for email-based git workflows
52
+
53
+ > [!NOTE]
54
+ > This project is developed with the assistance of LLMs / coding agents. It's not fully functional yet. My main use of it will be to continue my contribution of a ZSH_XTRACEFD feature to Zsh, through their zsh-workers mailing list.
55
+
56
+ ## Overview
57
+
58
+ **git-ew** provides a GitHub-style web interface for email-based git workflows. It organizes emails into threads, handles infinite nesting, and allows posting comments via plain-text emails.
59
+
60
+ ![screenshot](https://github.com/user-attachments/assets/d94cdee4-898f-4f1f-be0e-c513714508e6)
61
+
62
+ ### Features
63
+
64
+ - GitHub-like interface for viewing threads and patches
65
+ - Email integration (maildir, mbox, public archives)
66
+ - Threaded discussions with infinite nesting support
67
+ - Automatic patch detection and display
68
+ - Plain-text email replies with proper headers
69
+ - Thread flattening for long linear chains
70
+ - SQLite backend with async FastAPI
71
+
72
+ ## Installation
73
+
74
+ ```bash
75
+ pip install git-ew
76
+ ```
77
+
78
+ With [`uv`](https://docs.astral.sh/uv/):
79
+
80
+ ```bash
81
+ uv tool install git-ew
82
+ ```
83
+
84
+ ## Getting Started
85
+
86
+ ### Quick Demo
87
+
88
+ Try git-ew with sample data:
89
+
90
+ ```bash
91
+ git-ew init
92
+ python scripts/create_sample_data.py
93
+ git-ew serve
94
+ ```
95
+
96
+ Open http://127.0.0.1:8000 to view sample threads.
97
+
98
+ ### Setup
99
+
100
+ Initialize the database:
101
+
102
+ ```bash
103
+ git-ew init
104
+ ```
105
+
106
+ Use the interactive setup wizard:
107
+
108
+ ```bash
109
+ git-ew config
110
+ ```
111
+
112
+ Or configure manually:
113
+
114
+ ```python
115
+ import asyncio
116
+ from git_ew._internal.database import Database
117
+ from git_ew._internal.models import EmailSource
118
+ import json
119
+
120
+ async def setup():
121
+ db = Database()
122
+ await db.init_db()
123
+
124
+ # Configure SMTP for sending emails
125
+ await db.set_config("email_config", {
126
+ "smtp_host": "smtp.gmail.com",
127
+ "smtp_port": 587,
128
+ "from_email": "you@example.com",
129
+ "from_name": "Your Name",
130
+ "username": "you@example.com",
131
+ "password": "your-app-password", # Use app password for Gmail
132
+ "use_tls": True
133
+ })
134
+
135
+ # Add email source - Maildir
136
+ async with db.session() as session:
137
+ source = EmailSource(
138
+ name="my-inbox",
139
+ source_type="maildir",
140
+ config=json.dumps({"path": "/path/to/maildir"}),
141
+ enabled=True
142
+ )
143
+ session.add(source)
144
+
145
+ # Or add email source - Mbox
146
+ async with db.session() as session:
147
+ source = EmailSource(
148
+ name="mailing-list",
149
+ source_type="mbox",
150
+ config=json.dumps({"path": "/path/to/archive.mbox"}),
151
+ enabled=True
152
+ )
153
+ session.add(source)
154
+
155
+ asyncio.run(setup())
156
+ ```
157
+
158
+ ### Usage
159
+
160
+ Start the server:
161
+
162
+ ```bash
163
+ git-ew serve # Default: http://127.0.0.1:8000
164
+ git-ew serve --host 0.0.0.0 # Listen on all interfaces
165
+ git-ew serve --port 3000 # Custom port
166
+ git-ew serve --reload # Auto-reload (development)
167
+ ```
168
+
169
+ Access the web interface and click "Sync Emails" to fetch messages from configured sources.
170
+
171
+ ### Configuration Details
172
+
173
+ #### Email Sources
174
+
175
+ **Maildir** (local mail folders):
176
+
177
+ ```json
178
+ {"path": "/home/user/.mail/INBOX"}
179
+ ```
180
+
181
+ **Mbox** (archive files):
182
+
183
+ ```json
184
+ {"path": "/path/to/mailing-list.mbox"}
185
+ ```
186
+
187
+ **Public Inbox** (coming soon):
188
+
189
+ ```json
190
+ {"url": "https://example.org/archive/"}
191
+ ```
192
+
193
+ #### SMTP Providers
194
+
195
+ **Gmail**: Enable 2FA and generate an [app password](https://myaccount.google.com/apppasswords)
196
+
197
+ **Outlook/Office365**: Use regular or app-specific password
198
+
199
+ **Custom SMTP**: Any server supporting STARTTLS
200
+
201
+ **Fastmail**: Use a Fastmail app password with mail access enabled. Configure SMTP as
202
+ `smtp.fastmail.com` on port `587` with TLS, and configure an IMAP source using
203
+ `imap.fastmail.com` on port `993` with the folders `INBOX` and `Sent`.
204
+
205
+ To download and ingest zsh-workers archives into the database:
206
+
207
+ ```bash
208
+ git-ew ingest zsh-workers --since 2026-03-18
209
+ ```
210
+
211
+ #### Command Line
212
+
213
+ ```bash
214
+ git-ew init # Initialize database
215
+ git-ew serve # Start web server
216
+ git-ew sync # Sync emails from sources
217
+ ```
218
+
219
+ ## How It Works
220
+
221
+ ### Email Fetching
222
+
223
+ git-ew can fetch emails from various sources:
224
+
225
+ - **Maildir**: Local maildir folders
226
+ - **Mbox**: Mbox archive files
227
+ - **Public Archives**: Public-inbox archives (coming soon)
228
+
229
+ ### Thread Organization
230
+
231
+ Emails are organized into threads based on their `Message-ID`, `In-Reply-To`, and `References` headers. The system:
232
+
233
+ 1. Groups related emails into threads
234
+ 2. Builds a tree structure with infinite nesting support
235
+ 3. Detects linear chains (single replies) and marks them for flattening
236
+ 4. Renders threads with proper indentation and visual hierarchy
237
+
238
+ ### Sending Emails
239
+
240
+ When you post a comment through the web interface:
241
+
242
+ 1. The comment is sent as a **plain-text email** (no HTML)
243
+ 2. Proper email headers are set (`In-Reply-To`, `References`)
244
+ 3. The email is stored in the local database
245
+ 4. Email threading is maintained correctly
246
+
247
+ ### Patch Detection
248
+
249
+ git-ew automatically detects patches in emails by looking for:
250
+
251
+ - Git diff format (`diff --git`)
252
+ - Unified diff format (`---` and `+++`)
253
+ - `[PATCH]` in the subject line
254
+
255
+ Patches are displayed with syntax highlighting and can be viewed/hidden.
256
+
257
+ ## Architecture
258
+
259
+ ```
260
+ git-ew/
261
+ ├── models.py # SQLAlchemy database models
262
+ ├── database.py # Database operations
263
+ ├── email_parser.py # Email parsing utilities
264
+ ├── email_fetcher.py # Fetch emails from various sources
265
+ ├── email_sender.py # Send emails via SMTP
266
+ ├── thread_utils.py # Thread organization and flattening
267
+ ├── app.py # FastAPI application
268
+ ├── cli.py # Command-line interface
269
+ ├── templates/ # Jinja2 HTML templates
270
+ │ ├── base.html
271
+ │ ├── index.html
272
+ │ └── thread.html
273
+ └── static/ # CSS and JavaScript
274
+ ├── css/style.css
275
+ └── js/main.js
276
+ ```
277
+
278
+ ## API Endpoints
279
+
280
+ - `GET /` - List threads
281
+ - `GET /thread/{id}` - View thread details
282
+ - `POST /api/thread/{id}/comment` - Post a comment (sends email)
283
+ - `POST /api/thread/{id}` - Update thread (e.g., close/reopen)
284
+ - `POST /api/sync` - Sync emails from sources
285
+ - `GET /api/threads` - Get threads as JSON
286
+ - `GET /api/thread/{id}` - Get thread details as JSON
287
+
288
+ ## Sponsors
289
+
290
+ <!-- sponsors-start -->
291
+ <!-- sponsors-end -->