Metadata-Version: 2.2
Name: bisos.gitist
Version: 0.14
Summary: bisos.gitist:  Git Mass Cloning and More
Author: Mohsen Banan
Author-email: libre@mohsen.1.banan.byname.net
Maintainer: Mohsen Banan
Maintainer-email: libre@mohsen.1.banan.byname.net
License: AGPL
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: bisos
Requires-Dist: bisos.b
Requires-Dist: bisos.common
Requires-Dist: bisos.csPlayer
Requires-Dist: bisos.csSeed
Requires-Dist: bisos.sbom
Requires-Dist: by
Requires-Dist: PyGithub
Requires-Dist: setuptools==75.8.0
Requires-Dist: wheel==0.38.4
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: license
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: requires-dist
Dynamic: summary

=======================================
bisos.gitist: Git Mass Cloning and More
=======================================

.. contents::
   :depth: 3
..

Overview
========

*bisos.gitist* is git + ist, as in artist: its scope is all things git
in BISOS. It has two roles:

#. **Bootstrapper**: cloning sets of repos onto a new platform — mass
   cloning from GitHub and GitLab (public, and private through
   credentials).
#. **Maintainer**: keeping cloned repos consistent and at hand during
   development — the gitGroup engine (rules every repo of a gitGroup
   follows) and the lists Blee's Magit menus use.

Where gitist is headed (a registry of gitGroups replacing
bisos.common's, and its merge into the ``-sbom.pcs`` model) is in
`DESIGN.org <DESIGN.org>`__. This README holds what is settled.

bisos.gitist is a python package that uses the
`PyCS-Framework <https://github.com/bisos-pip/pycs>`__.

.. _table-of-contents:

Table of Contents TOC
=====================

-  `Overview <#overview>`__
-  `Part of BISOS — ByStar Internet Services Operating
   System <#part-of-bisos--bystar-internet-services-operating-system>`__
-  `Gitist Model, Abstractions and
   Terminology <#gitist-model-abstractions-and-terminology>`__

   -  `Repo <#repo>`__
   -  `gitGroup <#gitgroup>`__
   -  `The gitGroup Directory <#the-gitgroup-directory>`__
   -  `gitGroup Plant, Rules and
      Statuses <#gitgroup-plant-rules-and-statuses>`__
   -  `gitGroupsSet and
      gitGroupsSetServer <#gitgroupsset-and-gitgroupssetserver>`__
   -  `gitAccount <#gitaccount>`__
   -  `gitGroup-Repos-Profile <#gitgroup-repos-profile>`__
   -  `anon and auth <#anon-and-auth>`__

-  `Gitist Layers <#gitist-layers>`__
-  `The Facilities <#the-facilities>`__

   -  `Mass Cloning: gitist-seed.cs <#mass-cloning-gitist-seedcs>`__
   -  `gitGroup Consistency:
      gitGroup-seed.cs <#gitgroup-consistency-gitgroup-seedcs>`__
   -  `Git Tooling: git-sbom.pcs and
      gitCreds-sbom.pcs <#git-tooling-git-sbompcs-and-gitcreds-sbompcs>`__

-  `Post-Installation Setup <#post-installation-setup>`__
-  `Installation <#installation>`__

   -  `Installation With pip <#installation-with-pip>`__
   -  `Installation With pipx <#installation-with-pipx>`__

-  `Documentation and Blee-Panels <#documentation-and-blee-panels>`__
-  `Support <#support>`__

Part of BISOS — ByStar Internet Services Operating System
=========================================================

Layered on top of Debian, **BISOS** (By\* Internet Services Operating
System) is a unified and universal framework for developing both
internet services and software-service continuums that use internet
services. See `Bootstrapping ByStar, BISOS and
Blee <https://github.com/bxGenesis/start>`__ for information about
getting started with BISOS.

**BISOS** is a foundation for **The Libre-Halaal ByStar Digital
Ecosystem** which is described as a cure for losses of autonomy and
privacy in a book titled: `Nature of
Polyexistentials <https://github.com/bxplpc/120033>`__

*bisos.gitist* is part of BISOS. It is a standalone package that can be
used independently of the full BISOS environment.

Gitist Model, Abstractions and Terminology
==========================================

Repo
----

A BISOS gitist **Repo** is just that, a git repo. Issues, projects,
wikis and the rest that GitHub and GitLab combine with a repo are not
part of the model.

gitGroup
--------

A is a co-anchored set of repos, independent of the git server that
hosts them. GitHub calls it an "organization"; GitLab a "group" (and
"subgroup"). Examples: ``bisos-pip`` (the BISOS pip packages), ``blee``
(on GitHub the ``bx-blee`` organization), ``bxObjects``.

A gitGroup's local name and its name on the server may differ (``blee``
<- ``bx-blee``).

Each gitGroup has two special repos:

-  **<<base repo>>** (``base``) — keeps what is specific to the
   gitGroup: its plant (``py3/bin/<gitGroup>_gitGroup.spcs``), and the
   fto files that make the gitGroup directory walkable.
-  **gitGroup** — a symlink to the ``.github`` repo (on GitHub, the
   organization's profile). A server without ``.github`` repos (GitLab)
   gets a repo of that role.

The gitGroup Directory
----------------------

On a platform a gitGroup is a directory,
``/bisos/git/bxRepos/<gitGroup>/``, holding its repos:

::

   /bisos/git/bxRepos/bisos-pip/
   ├── base/           the base repo
   ├── .github/        the .github repo
   ├── gitGroup -> .github
   ├── aiActivity/     ... every other member repo
   └── ...

The gitGroup directory is a plain directory. (Platforms installed before
this layout have the directory itself cloned from a repo — ``bisos-pip``
from ``.github``, ``blee`` from ``bx-blee/base``; see DESIGN.org.) The
**members** of a gitGroup are the git repos directly in its directory;
symlinks such as ``gitGroup`` are not members.

gitGroup Plant, Rules and Statuses
----------------------------------

A gitGroup's **plant**, ``<gitGroup>_gitGroup.spcs`` in its base repo's
``py3/bin/``, is spread-planted on ``gitGroup-seed.cs``. It declares
only the gitGroup's **rules**; its name and directory come from where
the file really lives (the base repo's parent). It is put on PATH by a
symlink in ``/bisos/core/bsip/bin/`` (the symlink is resolved).

Two kinds of rules:

-  ``fileFromTemplate(path, template, customRepos``\ […])= — every
   member's ``path`` equals ``template``.
-  ``notTracked(paths)`` — none of ``paths`` is tracked (generated
   files).

Each member, against each rule, has a **status**:

+-------------+--------------------------+--------------------------+
| Status      | Meaning                  | gitGroup\ :sub:`update`  |
+=============+==========================+==========================+
| ``ok``      | as the rule says         | nothing                  |
+-------------+--------------------------+--------------------------+
| ``missing`` | the file is absent       | writes it                |
+-------------+--------------------------+--------------------------+
| ``stale``   | an exact earlier version | writes it                |
|             | of the template (git     |                          |
|             | history)                 |                          |
+-------------+--------------------------+--------------------------+
| ``drift``   | differs from every       | with ``--replaceDrift``  |
|             | template version, not    |                          |
|             | declared                 |                          |
+-------------+--------------------------+--------------------------+
| ``custom``  | differs, declared in the | never                    |
|             | plant's ``customRepos``  |                          |
+-------------+--------------------------+--------------------------+
| ``tracked`` | a ``notTracked`` path is | prints                   |
|             | tracked                  | ``git rm --cached``;     |
|             |                          | ``gitGroup_untrack``     |
|             |                          | runs it                  |
+-------------+--------------------------+--------------------------+

Status is read-only; update writes files only and never stages or
commits. ``gitGroup_untrack`` is the one verb that stages:
``git rm --cached`` of the ``tracked`` paths (the files stay on disk);
the commit is the user's.

A gitGroup's **cached list**,
``/bisos/var/gitGroup/<gitGroup>/cachedList.<auth|anon|other>``, holds
the real paths of its repos. Blee's "Apps -> GitHub MAGIT Menu ->
BISOS-Magit gitGroups" reads it.

gitGroupsSet and gitGroupsSetServer
-----------------------------------

A is a named list of gitGroups with a canonical base: for example the
set of a Raw-BISOS platform, ``bisos-pip``, ``blee``, ``bxObjects``, …
under ``/bisos/git``. For each gitGroup it holds its local name and its
name on the server, and its **membership**: the repos a platform clones.

-  Membership is an **explicit list** in the set. Installing clones that
   list, with no use of the server's API: predictable, and not subject
   to API rate limits.
-  Keeping the list current is a developer's read-only step: compare
   each list with the server and report the repos new on the server, the
   listed repos gone from it, and those skipped by exclusion patterns
   (``*.moved``, ``defunc-*``, ``*.obsolete``, archived); then update
   the list explicitly.
-  The full set is kept in a repo of its own in the ``ByStar``
   organization (the top-most level).

A is what a gitGroupsSet needs about the git server holding its repos:
its type (github, gitlab), its base address, and a reference to its
credentials.

gitAccount
----------

A (also called ) is the account used on the gitServer to manage and
control `gitGroupsSetServer <#gitGroupsSetServer>`__ s.

gitGroup-Repos-Profile
----------------------

A is a labeling mechanism: subsets of a `gitGroup <#gitGroup>`__'s repos
addressed by labels.

anon and auth
-------------

A platform clones its repos anonymously (https) into
``/bisos/git/anon/bxRepos``; a developer platform clones them again,
authenticated (ssh, with a host alias), into
``/bisos/git/auth/bxRepos``. The symlink ``/bisos/git/bxRepos`` says
which is in use. gitist reads it to choose the mode and the destination,
and the cached list is named after it.

Gitist Layers
=============

#. PyCS Framework
#. Seeded/Planted PyCS Framework (``gitist-seed.cs``,
   ``gitGroup-seed.cs``)
#. Common csCmndsList (bisos.csSeed)
#. Gitist Commands CSUs (``gitist_csu.py``, ``gitGroup_csu.py``)

The Facilities
==============

Mass Cloning: gitist-seed.cs
----------------------------

Brand-neutral commands (GitHub through PyGithub, GitLab through
python-gitlab) over a thin brand adapter. A plant names the brand, the
credentials and the access type:
``py3/bin/pub-{anon,auth}-{github,gitlab}-gitist.pcs``.

.. code:: bash

   pub-anon-github-gitist.pcs -i gitist_reposList bisos-pip                        # the org's repos
   pub-anon-github-gitist.pcs -i gitist_clone --destBaseDir=/tmp/x bisos-pip/gitist   # one repo
   pub-anon-github-gitist.pcs -i gitist_reposClone --destBaseDir=/tmp/x bisos-pip     # all of them

Access: ``anon`` clones over https; ``auth`` over ssh (with a
``~/.ssh/config`` host alias), or https with a token. Existing clones
are skipped. A plant can also run a list of these commands
(``csCmndsList``): ``/bisos/core/bsip/bin/bxRepos-gitist.pcs`` is the
list of repos a Raw-BISOS install clones beyond bisos.common's registry.

gitGroup Consistency: gitGroup-seed.cs
--------------------------------------

Run through a gitGroup's plant:

.. code:: bash

   bisos-pip_gitGroup.spcs -i gitGroup_members                     # the member repos
   bisos-pip_gitGroup.spcs -i gitGroup_status                      # read-only: each member, each rule
   bisos-pip_gitGroup.spcs -i gitGroup_diff <repo> .gitignore      # template -> the member's file
   bisos-pip_gitGroup.spcs -i gitGroup_update                      # writes missing and stale files
   bisos-pip_gitGroup.spcs -i gitGroup_update --replaceDrift=true  # and drifted ones
   bisos-pip_gitGroup.spcs -i gitGroup_untrack                     # git rm --cached the tracked notTracked paths
   bisos-pip_gitGroup.spcs -i gitGroup_cachedListUpdate            # the list for Blee's Magit menus

Plants today: ``bisos-pip/base/bin/bisos-pip_gitGroup.spcs``,
``blee/base/bin/blee_gitGroup.spcs``. ``bx-gitRepos``
(``/bisos/core/bsip/bin``) stays beside this.

Git Tooling: git-sbom.pcs and gitCreds-sbom.pcs
-----------------------------------------------

Two ``-sbom.pcs`` (bisos.sbom's ``pkgsSeed``) for the programs that
cloning and committing need. They were one ``git-sbom.pcs`` in
``bisos/bsip4/bin``, which no provisioner ran; split and moved here
2026-11-22.

+----------------+----------------+----------------+----------------+
| sbom           | Installs       | Interaction    | Run by         |
+================+================+================+================+
| ``             | ``git``,       | none           | ``bsipP        |
| git-sbom.pcs`` | ``git-lfs``,   |                | rovision.sh``, |
|                | ``gitleaks``   |                | before         |
|                |                |                | ``bxRepo       |
|                |                |                | s-gitist.pcs`` |
+----------------+----------------+----------------+----------------+
| ``gitCr        | ``wget``, Git  | after          | by hand        |
| eds-sbom.pcs`` | Credential     | ``             |                |
|                | Manager        | gpg-sbom.pcs`` |                |
|                | (pinned .deb,  | key setup      |                |
|                | then           |                |                |
|                | ``configure``, |                |                |
|                | ``credentia    |                |                |
|                | lStore gpg``), |                |                |
|                | ``gh``         |                |                |
+----------------+----------------+----------------+----------------+

.. code:: bash

   git-sbom.pcs -i aptPkgs_list       # what it would install
   git-sbom.pcs -i sbom_fullUpdate
   gitCreds-sbom.pcs -i readme        # the order: git-sbom, gpg-sbom, key init, gitCreds-sbom

``git-lfs``: the package does not register the LFS filters; a user's
``~/.gitconfig`` does (``git lfs install``) or the platform does
(``git lfs install --system``). A ``~/.gitconfig`` with
``filter.lfs.required`` and no ``git-lfs`` program makes every git
command in an LFS repo fail. ``gitCreds-sbom.pcs``'s GCM step rewrites
``credential.helper`` in ``~/.gitconfig``; do not run it where another
helper is in use.

Post-Installation Setup
=======================

For authenticated access, run the provisioning script to create the
credentials directory and place the configuration templates:

.. code:: bash

   config/provision.pcs -i credsSetup

This creates ``~/credentials/git/`` and copies two config files there if
they do not already exist:

-  ``~/credentials/git/githubHosts.cfg`` — GitHub configuration; insert
   your GitHub PAT here.
-  ``~/credentials/git/gitlabHosts.cfg`` — GitLab configuration; insert
   your GitLab PAT here.

Anonymous access to public repos needs neither.

Installation
============

The sources for the bisos.gitist pip package are maintained at:
https://github.com/bisos-pip/gitist.

The bisos.gitist pip package is available at PYPI as
https://pypi.org/project/bisos.gitist

You can install bisos.gitist with pip or pipx.

Installation With pip
---------------------

If you need access to bisos.gitist as a python module, you can install
it with pip:

.. code:: bash

   pip install bisos.gitist

Installation With pipx
----------------------

If you only need access to bisos.gitist on command-line, you can install
it with pipx:

.. code:: bash

   pipx install bisos.gitist

Documentation and Blee-Panels
=============================

bisos.gitist is part of ByStar Digital Ecosystem http://www.by-star.net.

This module's primary documentation is in the form of Blee-Panels.
Additional information is also available in:
http://www.by-star.net/PLPC/180047

bisos.gitist's Blee-Panel is
`file:./panels/bisos.gitist/_nodeBase_/fullUsagePanel-en.org <./panels/bisos.gitist/_nodeBase_/fullUsagePanel-en.org>`__.
From within Blee and BISOS it is accessible under the Blee "Panels"
menu.

Support
=======

| For support, criticism, comments and questions; please contact the
  author/maintainer
| `Mohsen Banan <http://mohsen.1.banan.byname.net>`__ at:
  http://mohsen.1.banan.byname.net/contact
