git-project-core-plugins 0.0.33__tar.gz → 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.
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/PKG-INFO +40 -39
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/_version.py +2 -2
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/changelog.rst +17 -1
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/hatch_build.py +4 -4
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/requirements.txt +2 -1
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/__init__.py +6 -6
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/_commanddocs.py +4 -4
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/artifact.py +4 -4
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/branch.py +1 -1
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/clone.py +1 -1
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/common.py +0 -20
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/config.py +2 -2
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/help.py +11 -11
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/multirepo.py +9 -6
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/run.py +3 -7
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/worktree.py +57 -52
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_branch.py +1 -1
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_multirepo.py +98 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_run.py +1 -1
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_worktree.py +111 -7
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/.gitignore +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/COPYING +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/MANIFEST.in +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/changelog.d/README.rst +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/changelog.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/Makefile +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/authors.rst +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/commands.rst +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/conf.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/contributing.rst +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/index.rst +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/intro.rst +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/license.rst +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/docs/make.bat +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/pyproject.toml +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/src/git_project_core_plugins/init.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/common.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/conftest.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_artifact.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_changelog.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_clone.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_config.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_help.py +0 -0
- {git_project_core_plugins-0.0.33 → git_project_core_plugins-0.1.0}/tests/test_init.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: git-project-core-plugins
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
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,8 @@ 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
|
|
17
|
+
Requires-Dist: git-project>=0.1.0
|
|
18
|
+
Requires-Dist: pygit2>=1.18.2
|
|
18
19
|
Requires-Dist: pytest-console-scripts
|
|
19
20
|
Provides-Extra: test
|
|
20
21
|
Requires-Dist: git-project; extra == 'test'
|
|
@@ -30,7 +31,7 @@ git-project-core-plugins
|
|
|
30
31
|
Plugins for `git-project <http://www.github.com/greened/git-project>`_
|
|
31
32
|
|
|
32
33
|
This is a set of basic plugins to manage several aspects of projects kept within
|
|
33
|
-
git repositories.
|
|
34
|
+
git repositories. These plugins include commands to:
|
|
34
35
|
|
|
35
36
|
#. Configure git-project and its various plugins
|
|
36
37
|
#. Clone repositories
|
|
@@ -42,8 +43,8 @@ git repositories. These plugins include commands to:
|
|
|
42
43
|
#. Show extended help for a command
|
|
43
44
|
#. Run a command in every repository of a set
|
|
44
45
|
|
|
45
|
-
These plugins add a number of commands to git-project.
|
|
46
|
-
associated ``--help`` option to describe its function and options.
|
|
46
|
+
These plugins add a number of commands to git-project. Each command has an
|
|
47
|
+
associated ``--help`` option to describe its function and options. There is
|
|
47
48
|
also a ``help`` command that accesses more extensive manpage-like descriptions
|
|
48
49
|
of commands.
|
|
49
50
|
|
|
@@ -68,7 +69,7 @@ the umbrella, holds a bare repository and its worktrees::
|
|
|
68
69
|
worktree3
|
|
69
70
|
|
|
70
71
|
That is, either a bare clone is done, or an existing clone is converted to a
|
|
71
|
-
bare clone via ``git <project> init --worktree``.
|
|
72
|
+
bare clone via ``git <project> init --worktree``. The bare repository is the
|
|
72
73
|
hidden ``.<name>.git`` child, named for the last component of the remote url,
|
|
73
74
|
and the umbrella ``<path>`` holds it alongside the worktrees. The ``.git`` beside it is a
|
|
74
75
|
file holding ``gitdir: .<name>.git``, so git works from ``<path>`` too. It is
|
|
@@ -82,12 +83,12 @@ linked worktrees, is converted with ``git <project> worktree migrate``
|
|
|
82
83
|
instead, which keeps them all.
|
|
83
84
|
|
|
84
85
|
Either route also creates a worktree for the project's main branch, so the
|
|
85
|
-
layout is usable straight away.
|
|
86
|
+
layout is usable straight away. The main branch is taken from the repository
|
|
86
87
|
when it can be determined uniquely, and you are asked which to use when it
|
|
87
88
|
cannot.
|
|
88
89
|
|
|
89
90
|
The point of the layout is that each worktree can own its own build and install
|
|
90
|
-
trees.
|
|
91
|
+
trees. Switching from worktree to worktree then does not result in "rebuilding
|
|
91
92
|
the world."
|
|
92
93
|
|
|
93
94
|
Examples
|
|
@@ -143,9 +144,9 @@ Summary::
|
|
|
143
144
|
git <project> artifact rm <subsection> [<path>]
|
|
144
145
|
|
|
145
146
|
<subsection> is a git config section which will appear under the
|
|
146
|
-
<project>.artifact section.
|
|
147
|
+
<project>.artifact section. Artifacts look up objects associated with
|
|
147
148
|
<subsection> and perform substitutions on paths to yield the final
|
|
148
|
-
associated file-system object.
|
|
149
|
+
associated file-system object. The ``artifact rm`` command simply removes
|
|
149
150
|
an artifact association, it does not remove the artifact itself. A
|
|
150
151
|
<subsection> may hold several paths. With <path>, ``artifact rm`` removes
|
|
151
152
|
only that association. <path> is a regular expression that git matches
|
|
@@ -174,7 +175,7 @@ Substitutions can make artifact associations easier to manage::
|
|
|
174
175
|
git <project> artifact add worktree /path/to/{worktree}/artifact
|
|
175
176
|
|
|
176
177
|
Notice that we've added the artifact under the more general ``worktree``
|
|
177
|
-
subsection instead of naming a worktree explicitly as before.
|
|
178
|
+
subsection instead of naming a worktree explicitly as before. Because the
|
|
178
179
|
{worktree} substitution appears in the artifact path, deleting any worktree
|
|
179
180
|
will cause the worktree's name to be substituted into the artifact path,
|
|
180
181
|
forming a unique artifact path to remove. If a worktree also has its own
|
|
@@ -193,7 +194,7 @@ We may make this even more general::
|
|
|
193
194
|
git <project> artifact add worktree "{builddir}"
|
|
194
195
|
|
|
195
196
|
We've added a single artifact association that will handle any worktree and
|
|
196
|
-
all of our different build types.
|
|
197
|
+
all of our different build types. When we delete the worktree, all
|
|
197
198
|
artifacts related to debug, release and check builds will also be removed.
|
|
198
199
|
|
|
199
200
|
See also::
|
|
@@ -278,8 +279,8 @@ Summary::
|
|
|
278
279
|
|
|
279
280
|
The config command operates much like git's built-in config command, except
|
|
280
281
|
all configuration keys are prefixed with <project>, keeping values under a
|
|
281
|
-
single project namespace.
|
|
282
|
-
other commands.
|
|
282
|
+
single project namespace. This is a convenient way to store parameters for
|
|
283
|
+
other commands. For example::
|
|
283
284
|
|
|
284
285
|
git <project> config builddir /path/to/build
|
|
285
286
|
git <project> add run build "make BUILDDIR={builddir} all"
|
|
@@ -325,7 +326,7 @@ Users may add help to any project config section. For example::
|
|
|
325
326
|
git <project> add help run.build "Perform a build"
|
|
326
327
|
git <project> add help run.check "Run tests"
|
|
327
328
|
|
|
328
|
-
All help is stored under a <project>.help config sub-section.
|
|
329
|
+
All help is stored under a <project>.help config sub-section. If a command
|
|
329
330
|
supports it, such help may appear in the command's own help output by
|
|
330
331
|
querying the appropriate <project>.help sub-section::
|
|
331
332
|
|
|
@@ -337,9 +338,9 @@ querying the appropriate <project>.help sub-section::
|
|
|
337
338
|
check - Run tests
|
|
338
339
|
build - Perform a build
|
|
339
340
|
|
|
340
|
-
In this way projects can self-document their configurations.
|
|
341
|
-
<text> is stored in <project>.help.<subsection>.short.
|
|
342
|
-
<text> is stored in <project>.help.<subsection>.manpage.
|
|
341
|
+
In this way projects can self-document their configurations. Normally
|
|
342
|
+
<text> is stored in <project>.help.<subsection>.short. With --manpage,
|
|
343
|
+
<text> is stored in <project>.help.<subsection>.manpage. Commands may
|
|
343
344
|
reference short help or manpages in various ways to present help.
|
|
344
345
|
|
|
345
346
|
See also::
|
|
@@ -421,9 +422,9 @@ A Ctrl-C reaches the running member directly. multirepo then starts no
|
|
|
421
422
|
more members, prints the table and exits with a failure status. SIGTERM
|
|
422
423
|
does the same, and multirepo also sends SIGTERM to the running member,
|
|
423
424
|
then SIGKILL if it has not exited after five seconds. SIGHUP is treated
|
|
424
|
-
as SIGTERM. With ``-j``,
|
|
425
|
-
SIGTERM to the process group of each running
|
|
426
|
-
group left after five seconds.
|
|
425
|
+
as SIGTERM. With ``-j``, multirepo sends SIGINT for a Ctrl-C, and
|
|
426
|
+
SIGTERM for SIGTERM or SIGHUP, to the process group of each running
|
|
427
|
+
member. It sends SIGKILL to any group left after five seconds.
|
|
427
428
|
|
|
428
429
|
``--commit <member> <sha>`` lines the new worktrees up in time. It works
|
|
429
430
|
only with ``worktree add`` and no <committish>. In <member> the new
|
|
@@ -504,7 +505,7 @@ clear::
|
|
|
504
505
|
git <project> add build some "{cmd}"
|
|
505
506
|
|
|
506
507
|
We have configured two different build flavors, each which place build
|
|
507
|
-
results in separate directories and invoke different targets.
|
|
508
|
+
results in separate directories and invoke different targets. Substitution
|
|
508
509
|
proceeds as follows::
|
|
509
510
|
|
|
510
511
|
git <project> build all -> make -C /cur/workarea BLDDIR=/path/to/all all
|
|
@@ -685,8 +686,8 @@ paths that ``artifact`` associates with the worktree, and if one of those is
|
|
|
685
686
|
refused, nothing is removed. The branch is deleted too, locally and on each
|
|
686
687
|
project remote, unless a flag says otherwise: ``--keep-branch`` leaves the
|
|
687
688
|
branch alone everywhere, and ``--keep-remote-branch`` deletes only the
|
|
688
|
-
local copy.
|
|
689
|
-
flags say.
|
|
689
|
+
local copy. A branch the project configures is never deleted, whatever the
|
|
690
|
+
flags say. Removing a worktree whose branch is unmerged requires ``-f``,
|
|
690
691
|
unless ``--keep-branch`` means the branch survives anyway.
|
|
691
692
|
|
|
692
693
|
With ``--check``, ``worktree add`` and ``worktree rm`` make the checks
|
|
@@ -698,12 +699,12 @@ name <set>, and keeps the branch unless the record has ``branchcreated =
|
|
|
698
699
|
true``. It refuses a record whose ``branchcreated`` is anything else.
|
|
699
700
|
|
|
700
701
|
The key idea behind project worktrees is that they are connected to various
|
|
701
|
-
``artifacts``.
|
|
702
|
-
provide a project-level view of various tasks.
|
|
703
|
-
command can create artifacts associated with a worktree.
|
|
702
|
+
``artifacts``. Worktrees are managed together with these artifacts to
|
|
703
|
+
provide a project-level view of various tasks. For example, a ``run``
|
|
704
|
+
command can create artifacts associated with a worktree. Removing the
|
|
704
705
|
worktree implicitly removes these artifacts, making build cleanups easy and
|
|
705
|
-
convenient.
|
|
706
|
-
worktree-unique artifacts.
|
|
706
|
+
convenient. Commands may use the {worktree} substitution to create
|
|
707
|
+
worktree-unique artifacts. Other substitutions may also reference
|
|
707
708
|
{worktree} in a recursive manner.
|
|
708
709
|
|
|
709
710
|
Here is a concrete example::
|
|
@@ -716,7 +717,7 @@ Here is a concrete example::
|
|
|
716
717
|
|
|
717
718
|
Assuming the build system uses BUILDDIR to determine where build artifacts
|
|
718
719
|
go, each worktree will get a unique set of build artifacts, via the
|
|
719
|
-
{builddir} and, recursively, {worktree} substitutions.
|
|
720
|
+
{builddir} and, recursively, {worktree} substitutions. When we delete the
|
|
720
721
|
worktree, we'll also delete the associated build directory.
|
|
721
722
|
|
|
722
723
|
We associate artifacts with worktrees via the artifact commands.
|
|
@@ -724,8 +725,8 @@ We associate artifacts with worktrees via the artifact commands.
|
|
|
724
725
|
Another important benefit of worktrees and associated builds is that
|
|
725
726
|
switching to work on a new worktree (by simply editing sources in a
|
|
726
727
|
different worktree directory) will not result in build artifacts from the
|
|
727
|
-
previous worktree being overwritten.
|
|
728
|
-
world`` problems of switching branches within the same workarea.
|
|
728
|
+
previous worktree being overwritten. Thus we avoid the ``rebuild the
|
|
729
|
+
world`` problems of switching branches within the same workarea. Generally,
|
|
729
730
|
each created branch will have its own worktree and we will rarely, if ever,
|
|
730
731
|
switch branches within a worktree.
|
|
731
732
|
|
|
@@ -746,23 +747,23 @@ git-project documentation describes the rule:
|
|
|
746
747
|
https://pypi.org/project/git-project/
|
|
747
748
|
|
|
748
749
|
The worktree plugin also adds a --worktree option to the clone and init
|
|
749
|
-
commands.
|
|
750
|
-
documentation.
|
|
751
|
-
the last component of the remote url, such as ``.myrepo.git``.
|
|
750
|
+
commands. Both set up the ``umbrella layout`` described in the package
|
|
751
|
+
documentation. The bare repository is a hidden child directory named for
|
|
752
|
+
the last component of the remote url, such as ``.myrepo.git``. The
|
|
752
753
|
umbrella holds it alongside the worktrees.
|
|
753
754
|
|
|
754
755
|
``clone --worktree`` clones bare, then rewrites the fetch refspec and sets
|
|
755
756
|
the main branch to track its remote branch, so fetch and pull behave as
|
|
756
|
-
they do in a regular clone.
|
|
757
|
+
they do in a regular clone. The refs/heads and refs/remotes namespaces
|
|
757
758
|
remain, and every other local branch is deleted. Add ``--bare`` to skip
|
|
758
759
|
the refspec rewrite. The clone still gets the ``.git`` file and the main
|
|
759
760
|
worktree. With no <path>, ``clone --worktree`` uses the current directory
|
|
760
761
|
itself as the umbrella, where a plain clone makes a new one.
|
|
761
762
|
|
|
762
|
-
``init --worktree`` converts an existing clone in place.
|
|
763
|
-
be clean.
|
|
763
|
+
``init --worktree`` converts an existing clone in place. The workarea must
|
|
764
|
+
be clean. The conversion deletes every file in the umbrella except the
|
|
764
765
|
git directory, so preserve anything there that is not part of the
|
|
765
|
-
repository.
|
|
766
|
+
repository. Only the main branch gets a worktree, so a different
|
|
766
767
|
checked-out branch gets none, though one is easy to add afterward. To
|
|
767
768
|
convert a clone you work in, with its branches and linked worktrees, use
|
|
768
769
|
``worktree migrate`` instead.
|
|
@@ -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
|
|
22
|
-
__version_tuple__ = version_tuple = (0,
|
|
21
|
+
__version__ = version = '0.1.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 1, 0)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -31,6 +31,21 @@ ChangeLog
|
|
|
31
31
|
`Unreleased`_
|
|
32
32
|
-------------
|
|
33
33
|
|
|
34
|
+
`0.1.0`_ - 2026-10-15
|
|
35
|
+
---------------------
|
|
36
|
+
Changed
|
|
37
|
+
.......
|
|
38
|
+
- Requires git-project 0.1.0, whose ``--menu=json`` names an option by its long flag.
|
|
39
|
+
- core-plugins declares its own dependency on pygit2 1.18.2 or later, which it imports directly.
|
|
40
|
+
- Versions follow semantic versioning from 0.1.0. Before 1.0.0 a breaking change bumps the minor version, and a feature or a fix bumps the patch. From 1.0.0 on, a breaking change bumps the major version, a feature the minor and a fix the patch.
|
|
41
|
+
|
|
42
|
+
Fixed
|
|
43
|
+
.....
|
|
44
|
+
- ``worktree add`` uses or creates the branch when a tag has the same name, rather than failing with reference is not a branch. ``multirepo --commit`` failed the same way. ``worktree rm`` checks whether the branch is merged, rather than the tag.
|
|
45
|
+
- A failed ``worktree add`` no longer removes git's record of a worktree of the same name that another add made meanwhile.
|
|
46
|
+
- With ``-j``, a Ctrl-C reaches each running member as SIGINT, so an interrupted ``worktree add`` undoes its work as it does without ``-j``.
|
|
47
|
+
- Running a command inside a worktree no longer rewrites that worktree's config. A directory whose path record has no worktree record is treated as outside any worktree, rather than gaining a new worktree record.
|
|
48
|
+
|
|
34
49
|
`0.0.33`_ - 2026-10-13
|
|
35
50
|
----------------------
|
|
36
51
|
Added
|
|
@@ -266,7 +281,8 @@ Fixed
|
|
|
266
281
|
404. Issues named ``unknown/greened``, a leftover from hatch's project
|
|
267
282
|
template, and Documentation misspelled the package name.
|
|
268
283
|
|
|
269
|
-
.. _Unreleased: https://github.com/greened/git-project-core-plugins/compare/v0.0
|
|
284
|
+
.. _Unreleased: https://github.com/greened/git-project-core-plugins/compare/v0.1.0...HEAD
|
|
285
|
+
.. _0.1.0: https://github.com/greened/git-project-core-plugins/compare/v0.0.33...v0.1.0
|
|
270
286
|
.. _0.0.33: https://github.com/greened/git-project-core-plugins/compare/v0.0.32...v0.0.33
|
|
271
287
|
.. _0.0.32: https://github.com/greened/git-project-core-plugins/compare/v0.0.31...v0.0.32
|
|
272
288
|
.. _0.0.31: https://github.com/greened/git-project-core-plugins/compare/v0.0.30...v0.0.31
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"""Build the PyPI long description, command reference included.
|
|
23
23
|
|
|
24
24
|
The package docstring appends the command reference at import time, so the
|
|
25
|
-
docs and ``help()`` get it for free.
|
|
25
|
+
docs and ``help()`` get it for free. A build cannot rely on that: importing
|
|
26
26
|
the package needs its dependencies installed, which is not true while the
|
|
27
|
-
package is being built.
|
|
27
|
+
package is being built. So this hook parses the sources instead, sharing the
|
|
28
28
|
formatter with the runtime path.
|
|
29
29
|
|
|
30
30
|
This replaces hatch-fancy-pypi-readme for this package, because that hook can
|
|
@@ -44,7 +44,7 @@ def _load_commanddocs():
|
|
|
44
44
|
|
|
45
45
|
A plain import would run ``git_project_core_plugins/__init__.py``, which
|
|
46
46
|
imports git_project, so the build would need the runtime dependency
|
|
47
|
-
installed before it could compute its own metadata.
|
|
47
|
+
installed before it could compute its own metadata. This module stands
|
|
48
48
|
alone, so load it straight from its path.
|
|
49
49
|
"""
|
|
50
50
|
path = (
|
|
@@ -89,7 +89,7 @@ class ReadmeMetadataHook(MetadataHookInterface):
|
|
|
89
89
|
authors = authors[: authors.index("A full list of contributors")]
|
|
90
90
|
|
|
91
91
|
# The prose ends in a literal block, so the sections need a blank line
|
|
92
|
-
# between them or the next one unindents into it.
|
|
92
|
+
# between them or the next one unindents into it. That is an RST error
|
|
93
93
|
# and PyPI rejects a description that fails to render.
|
|
94
94
|
text = "\n".join([prose, reference, authors])
|
|
95
95
|
|
|
@@ -27,7 +27,7 @@ git-project-core-plugins
|
|
|
27
27
|
Plugins for `git-project <http://www.github.com/greened/git-project>`_
|
|
28
28
|
|
|
29
29
|
This is a set of basic plugins to manage several aspects of projects kept within
|
|
30
|
-
git repositories.
|
|
30
|
+
git repositories. These plugins include commands to:
|
|
31
31
|
|
|
32
32
|
#. Configure git-project and its various plugins
|
|
33
33
|
#. Clone repositories
|
|
@@ -39,8 +39,8 @@ git repositories. These plugins include commands to:
|
|
|
39
39
|
#. Show extended help for a command
|
|
40
40
|
#. Run a command in every repository of a set
|
|
41
41
|
|
|
42
|
-
These plugins add a number of commands to git-project.
|
|
43
|
-
associated ``--help`` option to describe its function and options.
|
|
42
|
+
These plugins add a number of commands to git-project. Each command has an
|
|
43
|
+
associated ``--help`` option to describe its function and options. There is
|
|
44
44
|
also a ``help`` command that accesses more extensive manpage-like descriptions
|
|
45
45
|
of commands.
|
|
46
46
|
|
|
@@ -65,7 +65,7 @@ the umbrella, holds a bare repository and its worktrees::
|
|
|
65
65
|
worktree3
|
|
66
66
|
|
|
67
67
|
That is, either a bare clone is done, or an existing clone is converted to a
|
|
68
|
-
bare clone via ``git <project> init --worktree``.
|
|
68
|
+
bare clone via ``git <project> init --worktree``. The bare repository is the
|
|
69
69
|
hidden ``.<name>.git`` child, named for the last component of the remote url,
|
|
70
70
|
and the umbrella ``<path>`` holds it alongside the worktrees. The ``.git`` beside it is a
|
|
71
71
|
file holding ``gitdir: .<name>.git``, so git works from ``<path>`` too. It is
|
|
@@ -79,12 +79,12 @@ linked worktrees, is converted with ``git <project> worktree migrate``
|
|
|
79
79
|
instead, which keeps them all.
|
|
80
80
|
|
|
81
81
|
Either route also creates a worktree for the project's main branch, so the
|
|
82
|
-
layout is usable straight away.
|
|
82
|
+
layout is usable straight away. The main branch is taken from the repository
|
|
83
83
|
when it can be determined uniquely, and you are asked which to use when it
|
|
84
84
|
cannot.
|
|
85
85
|
|
|
86
86
|
The point of the layout is that each worktree can own its own build and install
|
|
87
|
-
trees.
|
|
87
|
+
trees. Switching from worktree to worktree then does not result in "rebuilding
|
|
88
88
|
the world."
|
|
89
89
|
|
|
90
90
|
Examples
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"""Build the command reference from the plugin classes.
|
|
23
23
|
|
|
24
24
|
Each ``<Name>Plugin`` class documents its own command, so that docstring is the
|
|
25
|
-
only place the command is described.
|
|
25
|
+
only place the command is described. This module renders those docstrings as
|
|
26
26
|
an RST section, which the package docstring appends at import time and the
|
|
27
|
-
build appends to the PyPI description.
|
|
27
|
+
build appends to the PyPI description. A hand-maintained copy drifted from the
|
|
28
28
|
classes it was copied from, which is the failure this replaces.
|
|
29
29
|
|
|
30
|
-
Two extractors, one formatter.
|
|
31
|
-
classes and serves the runtime docstring.
|
|
30
|
+
Two extractors, one formatter. ``from_classes`` introspects imported
|
|
31
|
+
classes and serves the runtime docstring. ``from_source`` parses the
|
|
32
32
|
sources with ``ast`` and serves the build, where importing the package would
|
|
33
33
|
require its dependencies to be installed first.
|
|
34
34
|
"""
|
|
@@ -281,9 +281,9 @@ class ArtifactPlugin(Plugin):
|
|
|
281
281
|
git <project> artifact rm <subsection> [<path>]
|
|
282
282
|
|
|
283
283
|
<subsection> is a git config section which will appear under the
|
|
284
|
-
<project>.artifact section.
|
|
284
|
+
<project>.artifact section. Artifacts look up objects associated with
|
|
285
285
|
<subsection> and perform substitutions on paths to yield the final
|
|
286
|
-
associated file-system object.
|
|
286
|
+
associated file-system object. The ``artifact rm`` command simply removes
|
|
287
287
|
an artifact association, it does not remove the artifact itself. A
|
|
288
288
|
<subsection> may hold several paths. With <path>, ``artifact rm`` removes
|
|
289
289
|
only that association. <path> is a regular expression that git matches
|
|
@@ -312,7 +312,7 @@ class ArtifactPlugin(Plugin):
|
|
|
312
312
|
git <project> artifact add worktree /path/to/{worktree}/artifact
|
|
313
313
|
|
|
314
314
|
Notice that we've added the artifact under the more general ``worktree``
|
|
315
|
-
subsection instead of naming a worktree explicitly as before.
|
|
315
|
+
subsection instead of naming a worktree explicitly as before. Because the
|
|
316
316
|
{worktree} substitution appears in the artifact path, deleting any worktree
|
|
317
317
|
will cause the worktree's name to be substituted into the artifact path,
|
|
318
318
|
forming a unique artifact path to remove. If a worktree also has its own
|
|
@@ -331,7 +331,7 @@ class ArtifactPlugin(Plugin):
|
|
|
331
331
|
git <project> artifact add worktree "{builddir}"
|
|
332
332
|
|
|
333
333
|
We've added a single artifact association that will handle any worktree and
|
|
334
|
-
all of our different build types.
|
|
334
|
+
all of our different build types. When we delete the worktree, all
|
|
335
335
|
artifacts related to debug, release and check builds will also be removed.
|
|
336
336
|
|
|
337
337
|
See also::
|
|
@@ -168,7 +168,7 @@ def command_branch_prune(git, gitproject, project, clargs):
|
|
|
168
168
|
print("-" * separator_width)
|
|
169
169
|
|
|
170
170
|
# FIXME: Prunes all branchs that start with the given name becuase
|
|
171
|
-
# iterrefnames does a startswith match.
|
|
171
|
+
# iterrefnames does a startswith match. This is probably not what we should
|
|
172
172
|
# do.
|
|
173
173
|
for branch in git.iterrefnames([ref]):
|
|
174
174
|
status = "merged" if project.branch_is_merged(branch) else "unmerged"
|
|
@@ -43,7 +43,7 @@ def command_clone(git, gitproject, project, clargs):
|
|
|
43
43
|
bare=clargs.bare,
|
|
44
44
|
)
|
|
45
45
|
|
|
46
|
-
# Now that we have a repository, add sensible project defaults.
|
|
46
|
+
# Now that we have a repository, add sensible project defaults. We know
|
|
47
47
|
# there is no existing project in the config file since we just cloned.
|
|
48
48
|
# This will have the effect of adding a project section.
|
|
49
49
|
project.set_defaults()
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
# You should have received a copy of the GNU Affero General Public License along
|
|
22
22
|
# with git-project. If not, see <https://www.gnu.org/licenses/>.
|
|
23
23
|
|
|
24
|
-
from git_project import ConfigObject
|
|
25
24
|
from git_project.commandline import add_version_argument
|
|
26
25
|
|
|
27
26
|
# Each of these points git somewhere other than the repository the command was
|
|
@@ -42,22 +41,3 @@ _GIT_REDIRECT_VARS = (
|
|
|
42
41
|
|
|
43
42
|
def add_plugin_version_argument(parser):
|
|
44
43
|
add_version_argument(parser, "git-project-core-plugins")
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def add_config_properties(git, cls, project_section, subsection, ident):
|
|
48
|
-
"""Give cls a property for each key in the config section of
|
|
49
|
-
subsection.ident, without constructing cls. Constructing a Worktree
|
|
50
|
-
writes its path record.
|
|
51
|
-
|
|
52
|
-
"""
|
|
53
|
-
config_section = git.config.get_section(
|
|
54
|
-
ConfigObject._get_full_section(
|
|
55
|
-
ConfigObject._map_project_section(project_section),
|
|
56
|
-
subsection,
|
|
57
|
-
ident,
|
|
58
|
-
)
|
|
59
|
-
)
|
|
60
|
-
for itemname, _item in config_section or []:
|
|
61
|
-
key = itemname.rsplit(".", 1)[-1]
|
|
62
|
-
if not hasattr(cls, key):
|
|
63
|
-
cls._add_property(key)
|
|
@@ -91,8 +91,8 @@ class ConfigPlugin(Plugin):
|
|
|
91
91
|
|
|
92
92
|
The config command operates much like git's built-in config command, except
|
|
93
93
|
all configuration keys are prefixed with <project>, keeping values under a
|
|
94
|
-
single project namespace.
|
|
95
|
-
other commands.
|
|
94
|
+
single project namespace. This is a convenient way to store parameters for
|
|
95
|
+
other commands. For example::
|
|
96
96
|
|
|
97
97
|
git <project> config builddir /path/to/build
|
|
98
98
|
git <project> add run build "make BUILDDIR={builddir} all"
|
|
@@ -47,9 +47,9 @@ def _print_general_help(git, gitproject, project, clargs):
|
|
|
47
47
|
|
|
48
48
|
git-project aims to make managing various project aspects simple and convenient.
|
|
49
49
|
The key idea of git-project is that various project actions may be coupled to
|
|
50
|
-
the source code repository or workarea in some fashion.
|
|
50
|
+
the source code repository or workarea in some fashion. For example, developers
|
|
51
51
|
may want builds isolated by the current branch, such that build directories are
|
|
52
|
-
encoded with the branch name.
|
|
52
|
+
encoded with the branch name. Or users may want to create worktrees associated
|
|
53
53
|
with build and install directories, so that removing a worktree also removes the
|
|
54
54
|
associated build and install directories.
|
|
55
55
|
|
|
@@ -57,11 +57,11 @@ git-project may be invoked via ``git project <command> [options...]'' or, by
|
|
|
57
57
|
linking the git-project command to another command named ``git-<name>'' it may
|
|
58
58
|
be invoked via ``git <name> <command>.'' For example, linking ``git-project''
|
|
59
59
|
to ``git-fizzbin'' we may invoke commands via ``git fizzbin <command>'' and all
|
|
60
|
-
configuration will appear under a ``fizzbin'' config section.
|
|
61
|
-
repository may support multiple projects, each with a unique name.
|
|
60
|
+
configuration will appear under a ``fizzbin'' config section. Thus, a single
|
|
61
|
+
repository may support multiple projects, each with a unique name. To emphasize
|
|
62
62
|
this, we will show invocations of git-project as ``git <project> [options...].''
|
|
63
63
|
|
|
64
|
-
Plugins extend git-project with new functionality.
|
|
64
|
+
Plugins extend git-project with new functionality. Each plugin should include
|
|
65
65
|
extensive documentation accessible though --help flags or via help command
|
|
66
66
|
options.
|
|
67
67
|
|
|
@@ -135,8 +135,8 @@ class Help(ConfigObject):
|
|
|
135
135
|
)
|
|
136
136
|
|
|
137
137
|
|
|
138
|
-
# Map command names to plugins.
|
|
139
|
-
# git-project help has its own built-in help in its plugin.
|
|
138
|
+
# Map command names to plugins. We use this to see if a command given to
|
|
139
|
+
# git-project help has its own built-in help in its plugin. This avoids the
|
|
140
140
|
# need to store large help pages in the git config and also allows later
|
|
141
141
|
# versions of plugins to provide new help and not be stuck with whatever happens
|
|
142
142
|
# to be stored in the config.
|
|
@@ -211,7 +211,7 @@ class HelpPlugin(Plugin):
|
|
|
211
211
|
git <project> add help run.build "Perform a build"
|
|
212
212
|
git <project> add help run.check "Run tests"
|
|
213
213
|
|
|
214
|
-
All help is stored under a <project>.help config sub-section.
|
|
214
|
+
All help is stored under a <project>.help config sub-section. If a command
|
|
215
215
|
supports it, such help may appear in the command's own help output by
|
|
216
216
|
querying the appropriate <project>.help sub-section::
|
|
217
217
|
|
|
@@ -223,9 +223,9 @@ class HelpPlugin(Plugin):
|
|
|
223
223
|
check - Run tests
|
|
224
224
|
build - Perform a build
|
|
225
225
|
|
|
226
|
-
In this way projects can self-document their configurations.
|
|
227
|
-
<text> is stored in <project>.help.<subsection>.short.
|
|
228
|
-
<text> is stored in <project>.help.<subsection>.manpage.
|
|
226
|
+
In this way projects can self-document their configurations. Normally
|
|
227
|
+
<text> is stored in <project>.help.<subsection>.short. With --manpage,
|
|
228
|
+
<text> is stored in <project>.help.<subsection>.manpage. Commands may
|
|
229
229
|
reference short help or manpages in various ways to present help.
|
|
230
230
|
|
|
231
231
|
See also::
|
|
@@ -563,8 +563,8 @@ def _group_alive(pgid):
|
|
|
563
563
|
def _run_parallel(tasks, jobs, cancel, on_done):
|
|
564
564
|
pending = deque(tasks)
|
|
565
565
|
running = []
|
|
566
|
-
# A group can outlive its leader, so keep each one
|
|
567
|
-
#
|
|
566
|
+
# A group can outlive its leader, so keep each one signalled until it is
|
|
567
|
+
# gone or has had SIGKILL.
|
|
568
568
|
groups = []
|
|
569
569
|
term_sent = None
|
|
570
570
|
killed = False
|
|
@@ -581,8 +581,11 @@ def _run_parallel(tasks, jobs, cancel, on_done):
|
|
|
581
581
|
running.append((task, proc))
|
|
582
582
|
|
|
583
583
|
if cancel.cancelled and running and term_sent is None:
|
|
584
|
+
# A Ctrl-C goes on as SIGINT, so a member's own interrupt
|
|
585
|
+
# handling, such as the add's undo, runs.
|
|
586
|
+
signum = signal.SIGTERM if cancel.terminated else signal.SIGINT
|
|
584
587
|
for _task, proc in running:
|
|
585
|
-
_killpg(proc.pid,
|
|
588
|
+
_killpg(proc.pid, signum)
|
|
586
589
|
groups.append(proc.pid)
|
|
587
590
|
term_sent = time.monotonic()
|
|
588
591
|
if term_sent is not None and not killed:
|
|
@@ -1170,9 +1173,9 @@ class MultirepoPlugin(Plugin):
|
|
|
1170
1173
|
more members, prints the table and exits with a failure status. SIGTERM
|
|
1171
1174
|
does the same, and multirepo also sends SIGTERM to the running member,
|
|
1172
1175
|
then SIGKILL if it has not exited after five seconds. SIGHUP is treated
|
|
1173
|
-
as SIGTERM. With ``-j``,
|
|
1174
|
-
SIGTERM to the process group of each running
|
|
1175
|
-
group left after five seconds.
|
|
1176
|
+
as SIGTERM. With ``-j``, multirepo sends SIGINT for a Ctrl-C, and
|
|
1177
|
+
SIGTERM for SIGTERM or SIGHUP, to the process group of each running
|
|
1178
|
+
member. It sends SIGKILL to any group left after five seconds.
|
|
1176
1179
|
|
|
1177
1180
|
``--commit <member> <sha>`` lines the new worktrees up in time. It works
|
|
1178
1181
|
only with ``worktree add`` and no <committish>. In <member> the new
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
# You should have received a copy of the GNU Affero General Public License along
|
|
22
22
|
# with git-project. If not, see <https://www.gnu.org/licenses/>.
|
|
23
23
|
|
|
24
|
-
"""A plugin to add a 'run' command to git-project.
|
|
25
|
-
arbitrary command.
|
|
24
|
+
"""A plugin to add a 'run' command to git-project. The run command invokes an
|
|
25
|
+
arbitrary command. It can be used to perform any action, such as building the
|
|
26
26
|
project.
|
|
27
27
|
|
|
28
28
|
Summary:
|
|
@@ -142,7 +142,7 @@ class RunPlugin(Plugin):
|
|
|
142
142
|
git <project> add build some "{cmd}"
|
|
143
143
|
|
|
144
144
|
We have configured two different build flavors, each which place build
|
|
145
|
-
results in separate directories and invoke different targets.
|
|
145
|
+
results in separate directories and invoke different targets. Substitution
|
|
146
146
|
proceeds as follows::
|
|
147
147
|
|
|
148
148
|
git <project> build all -> make -C /cur/workarea BLDDIR=/path/to/all all
|
|
@@ -215,10 +215,6 @@ class RunPlugin(Plugin):
|
|
|
215
215
|
alias + "Class",
|
|
216
216
|
(RunnableConfigObject,),
|
|
217
217
|
{
|
|
218
|
-
# __doc__ = f"""A RunnableConfigObject to manage {alias} names. Each run name gets its own
|
|
219
|
-
# config section.
|
|
220
|
-
#
|
|
221
|
-
# """
|
|
222
218
|
"subsection": subsection,
|
|
223
219
|
"get_managing_command": get_managing_command,
|
|
224
220
|
},
|