git-project-core-plugins 0.0.29__tar.gz → 0.0.30__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 (38) hide show
  1. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/PKG-INFO +64 -7
  2. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/_version.py +2 -2
  3. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/docs/changelog.rst +37 -1
  4. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/requirements.txt +1 -1
  5. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/worktree.py +621 -88
  6. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/conftest.py +47 -0
  7. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/test_worktree.py +967 -16
  8. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/.gitignore +0 -0
  9. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/COPYING +0 -0
  10. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/MANIFEST.in +0 -0
  11. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/docs/Makefile +0 -0
  12. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/docs/authors.rst +0 -0
  13. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/docs/commands.rst +0 -0
  14. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/docs/conf.py +0 -0
  15. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/docs/index.rst +0 -0
  16. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/docs/intro.rst +0 -0
  17. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/docs/license.rst +0 -0
  18. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/docs/make.bat +0 -0
  19. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/hatch_build.py +0 -0
  20. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/pyproject.toml +0 -0
  21. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/__init__.py +0 -0
  22. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/_commanddocs.py +0 -0
  23. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/artifact.py +0 -0
  24. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/branch.py +0 -0
  25. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/clone.py +0 -0
  26. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/common.py +0 -0
  27. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/config.py +0 -0
  28. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/help.py +0 -0
  29. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/init.py +0 -0
  30. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/src/git_project_core_plugins/run.py +0 -0
  31. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/common.py +0 -0
  32. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/test_artifact.py +0 -0
  33. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/test_branch.py +0 -0
  34. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/test_clone.py +0 -0
  35. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/test_config.py +0 -0
  36. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/test_help.py +0 -0
  37. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/test_init.py +0 -0
  38. {git_project_core_plugins-0.0.29 → git_project_core_plugins-0.0.30}/tests/test_run.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: git-project-core-plugins
3
- Version: 0.0.29
3
+ Version: 0.0.30
4
4
  Summary: The extensible stupid project manager - core functionality
5
5
  Author-email: "David A. Greene" <dag@obbligato.org>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Topic :: Software Development :: Version Control :: Git
16
16
  Requires-Python: >=3.10
17
- Requires-Dist: git-project>=0.0.41
17
+ Requires-Dist: git-project>=0.0.42
18
18
  Requires-Dist: pytest-console-scripts
19
19
  Provides-Extra: test
20
20
  Requires-Dist: git-project; extra == 'test'
@@ -589,9 +589,7 @@ directory, to the worktree layout. Every branch, ref, stash and config
589
589
  value stays. Each linked worktree moves into the top-level directory. The
590
590
  files of the main worktree, ignored ones too, move into a worktree named
591
591
  for the main branch. Without ``--apply`` it prints each step and changes
592
- nothing. One exception applies to every git-project command: before the
593
- command runs, git-project may set ``<project>.branch`` and
594
- ``<project>.remote`` when they are unset.
592
+ nothing.
595
593
 
596
594
  The main branch is the first branch the project configures that exists
597
595
  locally. Failing that, it is ``main``, then ``master``, then the only
@@ -626,14 +624,58 @@ warning does not stop the migration, so fix the value by hand. A tool
626
624
  that records absolute paths, such as a Python virtualenv, may need to be
627
625
  made again.
628
626
 
627
+ ``worktree migrate`` also converts a store that is already bare at
628
+ <top>/.git, with its worktrees inside <top>. It renames the store to the
629
+ hidden name, writes the ``.git`` file and repairs each worktree. A
630
+ worktree's ``commondir`` file that holds an absolute path is rewritten
631
+ as ``../..``, because the repair leaves it naming the old store. No
632
+ worktree moves and no config changes. The checks above apply to each
633
+ worktree, except the sparse checkout, assume-unchanged, skip-worktree and
634
+ filesystem checks. Those matter only when files move or an index is
635
+ reset. It also refuses a worktree outside <top> or inside the store, and
636
+ a store with no worktrees. It refuses a store with an index. It looks in
637
+ <top> and in each directory between <top> and a worktree, and refuses
638
+ an entry there that holds no worktree, unless its name starts with
639
+ ``.``. An index or such an entry can mean a checkout that ``core.bare``
640
+ hides. It refuses a ``commondir`` that names another repository. A
641
+ ``core.bare`` in the store's ``config.worktree`` is allowed, since
642
+ ``git sparse-checkout`` puts it there.
643
+
644
+ For a flat clone or a bare store, the plan lists each local branch
645
+ with commits its upstream lacks, and how many. A commit the upstream
646
+ has under another id, as after a rebase or cherry-pick, does not count.
647
+ A branch with no upstream, or an upstream that is gone, is compared
648
+ with the main branch. A bare store with no main branch lists only
649
+ branches with an upstream. The list is for information and does not
650
+ stop the migration.
651
+
652
+ After a successful ``--apply`` of either kind, migrate runs the
653
+ command in ``<project>.postmigrate``, if it is set, in <top>. The value
654
+ is split into words as a shell would split it, but no shell runs it, so
655
+ pipes, redirections and variables do not work. The command runs in its
656
+ own session and gets no standard input. It has the number of seconds in
657
+ ``<project>.postmigratetimeout`` to finish, 600 when that is unset. On
658
+ a timeout or a Ctrl-C, migrate sends SIGTERM to the command's process
659
+ group, then SIGKILL after five seconds. A process that starts its own
660
+ session or process group is not stopped. Only a Ctrl-C or the timeout
661
+ stops the command. A hangup or a SIGTERM to migrate does not reach it.
662
+ The result goes in ``post.status`` in the manifest, ``ok`` or the
663
+ reason it failed. When the command fails or is interrupted, the
664
+ migration stays done and migrate exits with a failure status. The dry
665
+ run shows the step and the config file that sets the command, but does
666
+ not run it. Migrate refuses a command it cannot split, an empty one,
667
+ and a timeout that is not a whole number from 1 to 86400.
668
+
629
669
  ``--apply`` writes the plan to ``git-project-migrate.json`` in the git
630
670
  directory. Before each step runs, its name goes in ``current_step``.
631
671
  When the step finishes, it is added to the ``steps_done`` list. The
632
672
  migration stops at the first failure and names the step in
633
673
  ``failed_step``. A hard stop, such as a kill, leaves no
634
674
  ``failed_step``, so read ``current_step``. The error names the
635
- manifest. After a stop in ``rename_store`` it is at either
636
- <top>/.git or <store_new>.
675
+ failed step, its reason and the manifest. After a stop in
676
+ ``rename_store`` the manifest is at either <top>/.git or <store_new>.
677
+ When ``verify`` finds a worktree that is not clean, it names the first
678
+ 10 changed or untracked paths and counts the rest.
637
679
 
638
680
  Manual rollback. Undo the steps that ``steps_done`` lists, in the order
639
681
  below. The failed step, or the current step after a hard stop, may be
@@ -674,6 +716,21 @@ nothing::
674
716
  rm -f <top>/.git/git-project-migrate.json
675
717
  rm -f <top>/.git/git-project-migrate.json.tmp
676
718
 
719
+ A bare store at <top>/.git has a manifest with ``form`` set to
720
+ ``bare_at_root``. Each <path> is a ``linked`` entry. The ``verify`` step
721
+ needs no undo. The repair command below undoes ``repair``. The
722
+ ``rewrite_commondir`` steps need no undo, since ``../..`` names the store
723
+ at either path::
724
+
725
+ # write_pointer: done when <top>/.git is a file
726
+ rm <top>/.git
727
+ # rename_store: done when <store_new> exists
728
+ mv <store_new> <top>/.git
729
+ git --git-dir=<top>/.git worktree repair <path>...
730
+ # last, remove the manifest
731
+ rm -f <top>/.git/git-project-migrate.json
732
+ rm -f <top>/.git/git-project-migrate.json.tmp
733
+
677
734
  See also::
678
735
 
679
736
  artifact
@@ -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.0.29'
22
- __version_tuple__ = version_tuple = (0, 0, 29)
21
+ __version__ = version = '0.0.30'
22
+ __version_tuple__ = version_tuple = (0, 0, 30)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -31,6 +31,41 @@ ChangeLog
31
31
  `Unreleased`_
32
32
  -------------
33
33
 
34
+ `0.0.30`_ - 2026-10-07
35
+ ----------------------
36
+ Added
37
+ .....
38
+ - ``worktree migrate`` converts a store already bare at ``<top>/.git``
39
+ with its worktrees inside ``<top>``. It renames the store to the hidden
40
+ name, writes the ``.git`` file and repairs each worktree. An absolute
41
+ ``commondir`` becomes ``../..``, so each worktree finds the renamed
42
+ store. Worktrees may be nested, such as ``<top>/x/b1``. A file or
43
+ directory on the way to a worktree that holds no worktree is refused,
44
+ unless its name starts with ``.``. Sparse checkouts and skip-worktree
45
+ files are allowed in this form.
46
+ - ``worktree migrate`` lists each local branch with commits that its
47
+ upstream lacks. A branch with no upstream, or one that is gone, is
48
+ compared with the main branch.
49
+ - ``worktree migrate --apply`` runs the command in
50
+ ``<project>.postmigrate`` in the top-level directory after a successful
51
+ migration. ``<project>.postmigratetimeout`` sets its time limit in
52
+ seconds, 600 by default and 86400 at most. The manifest records the result.
53
+
54
+ Changed
55
+ .......
56
+ - A ``worktree migrate --apply`` failure prints the reason as well as the
57
+ step. When ``verify`` finds a worktree that is not clean, it names up to
58
+ 10 of the changed or untracked paths. Like the precheck, it ignores
59
+ ``status.showUntrackedFiles`` and ``submodule.<name>.ignore``.
60
+ - core-plugins now needs git-project 0.0.42 or later. That release lets a
61
+ command turn off its writes of the project defaults.
62
+
63
+ Fixed
64
+ .....
65
+ - A ``worktree migrate`` dry run wrote ``<project>.branch`` and
66
+ ``<project>.remote`` when they were unset. Now it writes nothing to the
67
+ config. It needs git-project 0.0.42 or later.
68
+
34
69
  `0.0.29`_ - 2026-10-06
35
70
  ----------------------
36
71
  Added
@@ -168,7 +203,8 @@ Fixed
168
203
  404. Issues named ``unknown/greened``, a leftover from hatch's project
169
204
  template, and Documentation misspelled the package name.
170
205
 
171
- .. _Unreleased: https://github.com/greened/git-project-core-plugins/compare/v0.0.29...HEAD
206
+ .. _Unreleased: https://github.com/greened/git-project-core-plugins/compare/v0.0.30...HEAD
207
+ .. _0.0.30: https://github.com/greened/git-project-core-plugins/compare/v0.0.29...v0.0.30
172
208
  .. _0.0.29: https://github.com/greened/git-project-core-plugins/compare/v0.0.28...v0.0.29
173
209
  .. _0.0.28: https://github.com/greened/git-project-core-plugins/compare/v0.0.27...v0.0.28
174
210
  .. _0.0.27: https://github.com/greened/git-project-core-plugins/compare/v0.0.26...v0.0.27
@@ -19,5 +19,5 @@
19
19
  # You should have received a copy of the GNU Affero General Public License along
20
20
  # with git-project. If not, see <https://www.gnu.org/licenses/>.
21
21
 
22
- git-project >= 0.0.41
22
+ git-project >= 0.0.42
23
23
  pytest-console-scripts