git-nested 1.0.5__tar.gz → 1.1.1__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 (133) hide show
  1. {git_nested-1.0.5 → git_nested-1.1.1}/.fish.rc +4 -3
  2. git_nested-1.1.1/.github/ISSUE_TEMPLATE/bug_report.md +23 -0
  3. git_nested-1.1.1/.github/ISSUE_TEMPLATE/config.yml +8 -0
  4. git_nested-1.1.1/.github/ISSUE_TEMPLATE/feature_request.md +15 -0
  5. git_nested-1.1.1/.github/PULL_REQUEST_TEMPLATE.md +17 -0
  6. git_nested-1.1.1/.github/dependabot.yml +23 -0
  7. git_nested-1.1.1/.github/release.yml +22 -0
  8. git_nested-1.1.1/.github/workflows/build-binary.yml +137 -0
  9. {git_nested-1.0.5 → git_nested-1.1.1}/.github/workflows/publish.yml +3 -3
  10. {git_nested-1.0.5 → git_nested-1.1.1}/.github/workflows/release-binary.yml +51 -20
  11. {git_nested-1.0.5 → git_nested-1.1.1}/.github/workflows/test-binary.yml +9 -6
  12. git_nested-1.1.1/.github/workflows/test.yml +102 -0
  13. {git_nested-1.0.5 → git_nested-1.1.1}/.gitignore +2 -1
  14. git_nested-1.1.1/.pre-commit-config.yaml +63 -0
  15. {git_nested-1.0.5 → git_nested-1.1.1}/.rc +8 -2
  16. git_nested-1.1.1/CONTRIBUTING.md +95 -0
  17. {git_nested-1.0.5 → git_nested-1.1.1}/PKG-INFO +148 -98
  18. {git_nested-1.0.5 → git_nested-1.1.1}/README.md +144 -94
  19. git_nested-1.1.1/SECURITY.md +34 -0
  20. git_nested-1.1.1/bin/git-nested +39 -0
  21. {git_nested-1.0.5 → git_nested-1.1.1}/docs/diagrams.md +113 -5
  22. git_nested-1.1.1/man/man1/git-nested.1 +138 -0
  23. git_nested-1.1.1/pyproject.toml +221 -0
  24. git_nested-1.1.1/scripts/create-python-exe.sh +257 -0
  25. git_nested-1.1.1/sonar-project.properties +9 -0
  26. git_nested-1.1.1/src/git_nested/__init__.py +40 -0
  27. git_nested-1.1.1/src/git_nested/__main__.py +10 -0
  28. git_nested-1.1.1/src/git_nested/_compat.py +32 -0
  29. git_nested-1.1.1/src/git_nested/_version.py +21 -0
  30. git_nested-1.1.1/src/git_nested/checks.py +104 -0
  31. git_nested-1.1.1/src/git_nested/cli/__init__.py +3 -0
  32. git_nested-1.1.1/src/git_nested/cli/app.py +109 -0
  33. git_nested-1.1.1/src/git_nested/cli/main.py +20 -0
  34. git_nested-1.1.1/src/git_nested/cli/parser.py +170 -0
  35. git_nested-1.1.1/src/git_nested/cli/setup.py +103 -0
  36. git_nested-1.1.1/src/git_nested/cli/spec.py +243 -0
  37. git_nested-1.1.1/src/git_nested/commands/__init__.py +49 -0
  38. git_nested-1.1.1/src/git_nested/commands/branch.py +37 -0
  39. git_nested-1.1.1/src/git_nested/commands/clean.py +55 -0
  40. git_nested-1.1.1/src/git_nested/commands/clone.py +160 -0
  41. git_nested-1.1.1/src/git_nested/commands/commit.py +46 -0
  42. git_nested-1.1.1/src/git_nested/commands/completion.py +14 -0
  43. git_nested-1.1.1/src/git_nested/commands/config.py +104 -0
  44. git_nested-1.1.1/src/git_nested/commands/diff.py +53 -0
  45. git_nested-1.1.1/src/git_nested/commands/fetch.py +49 -0
  46. git_nested-1.1.1/src/git_nested/commands/init.py +81 -0
  47. git_nested-1.1.1/src/git_nested/commands/pull.py +234 -0
  48. git_nested-1.1.1/src/git_nested/commands/push.py +329 -0
  49. git_nested-1.1.1/src/git_nested/commands/status.py +184 -0
  50. git_nested-1.1.1/src/git_nested/commands/version.py +23 -0
  51. git_nested-1.1.1/src/git_nested/completion/__init__.py +278 -0
  52. git_nested-1.1.1/src/git_nested/completion/scripts.py +210 -0
  53. git_nested-1.1.1/src/git_nested/constants.py +13 -0
  54. git_nested-1.1.1/src/git_nested/content.py +199 -0
  55. git_nested-1.1.1/src/git_nested/discovery.py +76 -0
  56. git_nested-1.1.1/src/git_nested/errors.py +18 -0
  57. git_nested-1.1.1/src/git_nested/filters.py +164 -0
  58. git_nested-1.1.1/src/git_nested/git.py +104 -0
  59. git_nested-1.1.1/src/git_nested/gitfile.py +194 -0
  60. git_nested-1.1.1/src/git_nested/history.py +224 -0
  61. git_nested-1.1.1/src/git_nested/messages.py +95 -0
  62. git_nested-1.1.1/src/git_nested/models.py +114 -0
  63. git_nested-1.1.1/src/git_nested/output.py +172 -0
  64. git_nested-1.1.1/src/git_nested/py.typed +0 -0
  65. git_nested-1.1.1/src/git_nested/refs.py +58 -0
  66. git_nested-1.1.1/src/git_nested/repo.py +56 -0
  67. git_nested-1.1.1/src/git_nested/worktree.py +40 -0
  68. git_nested-1.1.1/src/git_nested/yamlio.py +22 -0
  69. {git_nested-1.0.5/lib → git_nested-1.1.1/src}/git_nested.egg-info/PKG-INFO +148 -98
  70. git_nested-1.1.1/src/git_nested.egg-info/SOURCES.txt +113 -0
  71. git_nested-1.1.1/src/git_nested.egg-info/requires.txt +1 -0
  72. git_nested-1.1.1/src/git_nested.egg-info/scm_file_list.json +109 -0
  73. git_nested-1.1.1/src/git_nested.egg-info/scm_version.json +8 -0
  74. {git_nested-1.0.5/test → git_nested-1.1.1/tests}/conftest.py +229 -154
  75. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/scenarios/test_extraction.py +6 -7
  76. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/scenarios/test_filemode.py +6 -7
  77. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/scenarios/test_filter.py +2 -2
  78. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_branch.py +37 -19
  79. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_clean.py +1 -1
  80. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_clone.py +20 -21
  81. git_nested-1.1.1/tests/e2e/test_commit.py +50 -0
  82. git_nested-1.1.1/tests/e2e/test_completion.py +201 -0
  83. git_nested-1.1.1/tests/e2e/test_config.py +125 -0
  84. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_diff.py +5 -13
  85. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_encode.py +4 -5
  86. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_error.py +28 -30
  87. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_fetch.py +2 -3
  88. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_gitignore.py +2 -2
  89. git_nested-1.1.1/tests/e2e/test_init.py +80 -0
  90. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_nested_in_nested.py +7 -18
  91. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_pull.py +51 -51
  92. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_push.py +83 -30
  93. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_rebase.py +11 -9
  94. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_reclone.py +6 -8
  95. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_status.py +6 -5
  96. {git_nested-1.0.5/test → git_nested-1.1.1/tests/e2e}/test_submodule.py +1 -1
  97. git_nested-1.1.1/tests/e2e/test_version.py +28 -0
  98. git_nested-1.1.1/tests/unit/conftest.py +37 -0
  99. git_nested-1.1.1/tests/unit/fakes.py +78 -0
  100. git_nested-1.1.1/tests/unit/test_command.py +119 -0
  101. git_nested-1.1.1/tests/unit/test_completion_engine.py +321 -0
  102. git_nested-1.1.1/tests/unit/test_docs.py +39 -0
  103. git_nested-1.1.1/tests/unit/test_facade.py +97 -0
  104. git_nested-1.1.1/tests/unit/test_helpers.py +205 -0
  105. git_nested-1.1.1/tests/unit/test_logging.py +193 -0
  106. git_nested-1.1.1/tests/unit/test_repo_business.py +469 -0
  107. git_nested-1.1.1/uv.lock +1491 -0
  108. git_nested-1.0.5/.github/workflows/build-binary.yml +0 -62
  109. git_nested-1.0.5/.github/workflows/test.yml +0 -63
  110. git_nested-1.0.5/CONTRIBUTING.md +0 -212
  111. git_nested-1.0.5/lib/git-nested +0 -13
  112. git_nested-1.0.5/lib/git_nested.egg-info/SOURCES.txt +0 -53
  113. git_nested-1.0.5/lib/git_nested.egg-info/requires.txt +0 -1
  114. git_nested-1.0.5/lib/git_nested.py +0 -2108
  115. git_nested-1.0.5/pyproject.toml +0 -100
  116. git_nested-1.0.5/scripts/create-python-exe.sh +0 -176
  117. git_nested-1.0.5/share/completion.bash +0 -44
  118. git_nested-1.0.5/share/enable-completion.sh +0 -35
  119. git_nested-1.0.5/share/git-nested.fish +0 -35
  120. git_nested-1.0.5/share/zsh-completion/_git-nested +0 -72
  121. git_nested-1.0.5/test/test_completion.py +0 -143
  122. git_nested-1.0.5/test/test_init.py +0 -54
  123. git_nested-1.0.5/test/test_version.py +0 -13
  124. git_nested-1.0.5/test/unittest/test_logging.py +0 -162
  125. git_nested-1.0.5/uv.lock +0 -689
  126. {git_nested-1.0.5 → git_nested-1.1.1}/.codecov.yml +0 -0
  127. {git_nested-1.0.5 → git_nested-1.1.1}/.gitattributes +0 -0
  128. {git_nested-1.0.5 → git_nested-1.1.1}/.github/CODEOWNERS +0 -0
  129. {git_nested-1.0.5 → git_nested-1.1.1}/LICENSE +0 -0
  130. {git_nested-1.0.5 → git_nested-1.1.1}/setup.cfg +0 -0
  131. {git_nested-1.0.5/lib → git_nested-1.1.1/src}/git_nested.egg-info/dependency_links.txt +0 -0
  132. {git_nested-1.0.5/lib → git_nested-1.1.1/src}/git_nested.egg-info/entry_points.txt +0 -0
  133. {git_nested-1.0.5/lib → git_nested-1.1.1/src}/git_nested.egg-info/top_level.txt +0 -0
@@ -11,7 +11,8 @@
11
11
  #------------------------------------------------------------------------------
12
12
 
13
13
  set GIT_NESTED_ROOT (dirname (realpath (status --current-filename)))
14
- set PATH $GIT_NESTED_ROOT/lib $PATH
14
+ set PATH $GIT_NESTED_ROOT/bin $PATH
15
15
 
16
- # Load git-nested completions
17
- source $GIT_NESTED_ROOT/share/git-nested.fish
16
+ # Tab completion. The script is generated by git-nested itself, from the
17
+ # same tables the argument parser is built from, so it can never drift.
18
+ git-nested completion fish | source
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: Bug report
3
+ about: Something git-nested does that it should not
4
+ labels: bug
5
+ ---
6
+
7
+ ## What happened
8
+
9
+ <!-- Paste the command and its output. `-v` or `-d` output helps a lot. -->
10
+
11
+ ## What you expected instead
12
+
13
+ ## How to reproduce
14
+
15
+ <!-- The shortest sequence of commands that shows it, starting from an empty
16
+ repository if you can. -->
17
+
18
+ ## Versions
19
+
20
+ - git-nested: <!-- git nested --version -->
21
+ - git: <!-- git --version -->
22
+ - OS:
23
+ - Installed via: <!-- pip / standalone binary / source .rc -->
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Question or idea
4
+ url: https://github.com/thorsten-klein/git-nested/discussions
5
+ about: For anything that is not a bug report or a concrete feature request.
6
+ - name: Security vulnerability
7
+ url: https://github.com/thorsten-klein/git-nested/security/advisories/new
8
+ about: Report privately here, not as a public issue.
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: Feature request
3
+ about: Something git-nested cannot do yet
4
+ labels: enhancement
5
+ ---
6
+
7
+ ## What you are trying to do
8
+
9
+ <!-- The workflow, not the feature. It often turns out there is already a way. -->
10
+
11
+ ## What you would like git-nested to do
12
+
13
+ <!-- If you have a command line in mind, write it out. -->
14
+
15
+ ## What you do instead today
@@ -0,0 +1,17 @@
1
+ ## What this changes
2
+
3
+ <!-- One or two sentences. What is different after this is merged? -->
4
+
5
+ ## Why
6
+
7
+ <!-- The problem it solves. Link the issue if there is one: Fixes #123 -->
8
+
9
+ ## Checklist
10
+
11
+ - [ ] `uv run poe all` passes (ruff, mypy, pyright, bandit, complexipy, and the
12
+ tests at 100% coverage)
13
+ - [ ] New behaviour has a test
14
+ - [ ] README / `--help` / the man page updated, if the change is visible to users
15
+ - [ ] The PR title reads as a [Conventional Commit](https://www.conventionalcommits.org)
16
+ (`feat:`, `fix:`, `docs:`, …) — it becomes the squash-merge commit message
17
+ and the changelog line
@@ -0,0 +1,23 @@
1
+ # Dependabot keeps the two things this repository pins up to date: the actions
2
+ # every workflow runs, and the Python dependencies uv.lock records.
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: github-actions
6
+ directory: /
7
+ schedule:
8
+ interval: weekly
9
+ groups:
10
+ # One pull request for the lot. Action bumps are almost always routine,
11
+ # and reviewing them together is quicker than reviewing them one by one.
12
+ actions:
13
+ patterns: ['*']
14
+
15
+ - package-ecosystem: uv
16
+ directory: /
17
+ schedule:
18
+ interval: weekly
19
+ groups:
20
+ # Dev tooling moves often and breaks nothing users see, so it travels
21
+ # together; a runtime dependency gets its own pull request.
22
+ dev:
23
+ dependency-type: development
@@ -0,0 +1,22 @@
1
+ # Categories for the notes GitHub generates from merged pull requests. The
2
+ # repository squash-merges with Conventional Commit titles, so the labels
3
+ # below are what sorts a PR into a section -- keep them on the PR, not on the
4
+ # commit.
5
+ changelog:
6
+ exclude:
7
+ labels: [skip-changelog]
8
+ categories:
9
+ - title: Breaking changes
10
+ labels: [breaking]
11
+ - title: Features
12
+ labels: [enhancement, feature]
13
+ - title: Fixes
14
+ labels: [bug, fix]
15
+ - title: Documentation
16
+ labels: [documentation]
17
+ - title: Build, CI and tooling
18
+ labels: [build, ci, tooling]
19
+ - title: Dependencies
20
+ labels: [dependencies]
21
+ - title: Other changes
22
+ labels: ['*']
@@ -0,0 +1,137 @@
1
+ name: Build binary
2
+
3
+ # Builds the standalone 'git-nested' executable for one target and uploads it
4
+ # as an artifact. Called by test.yml (so every push/PR proves the recipe still
5
+ # builds) and by release-binary.yml (which attaches it to the release) -- so
6
+ # what CI exercises is built by exactly the recipe that ships, rather than a
7
+ # lookalike that can drift away from it.
8
+ #
9
+ # One call builds one target: PyInstaller freezes for the machine it runs on
10
+ # and nothing else, so Linux, macOS and Windows binaries come from three calls
11
+ # with different 'runs-on'/'container', not from one job.
12
+ on:
13
+ workflow_call:
14
+ inputs:
15
+ ref:
16
+ description: 'Commit/tag/branch to build. Empty: whatever triggered the caller.'
17
+ type: string
18
+ required: false
19
+ default: ''
20
+ artifact:
21
+ description: 'Name of the uploaded artifact'
22
+ type: string
23
+ required: false
24
+ default: git-nested-binary
25
+ runs-on:
26
+ description: 'Runner to build on -- ubuntu-latest, macos-latest, windows-latest'
27
+ type: string
28
+ required: false
29
+ default: ubuntu-latest
30
+ container:
31
+ description: 'Container to build inside (Linux only). Empty: build on the runner itself.'
32
+ type: string
33
+ required: false
34
+ default: almalinux:8
35
+ python-version:
36
+ description: 'Python to freeze, e.g. 3.12'
37
+ type: string
38
+ required: false
39
+ default: '3.12'
40
+ outputs:
41
+ archive:
42
+ description: 'File name of the built archive, e.g. git-nested-1.2.3-x64-linux.tar.xz. Only meaningful for a single (non-matrix) call.'
43
+ value: ${{ jobs.build.outputs.archive }}
44
+ version:
45
+ description: 'Version of the built git-nested, e.g. 1.2.3'
46
+ value: ${{ jobs.build.outputs.version }}
47
+
48
+ jobs:
49
+ build:
50
+ runs-on: ${{ inputs.runs-on }}
51
+ # An empty string here means "no container", which is what the macOS and
52
+ # Windows callers pass -- containers are a Linux-runner feature.
53
+ #
54
+ # For Linux the default is almalinux:8, and that is a portability
55
+ # decision, not a convenience one: a PyInstaller binary links the glibc of
56
+ # the machine that built it, and glibc is only backward compatible, so
57
+ # built on ubuntu-latest it would refuse to start on anything older than
58
+ # that runner. AlmaLinux 8 has glibc 2.28, the oldest that still runs the
59
+ # node20 the actions below need, which covers every distro from Ubuntu
60
+ # 20.04 / Debian 10 / Fedora 29 / RHEL 8 onwards. glibc-based distros only
61
+ # -- musl ones (Alpine) can never run this binary.
62
+ container: ${{ inputs.container }}
63
+ # bash everywhere, including Windows, where the default is pwsh --
64
+ # create-python-exe.sh is one script for all three targets.
65
+ defaults:
66
+ run:
67
+ shell: bash
68
+ outputs:
69
+ archive: ${{ steps.build.outputs.archive }}
70
+ version: ${{ steps.build.outputs.version }}
71
+ steps:
72
+ # Before the checkout -- without git, actions/checkout silently falls
73
+ # back to downloading a tarball, and a checkout with no .git has no
74
+ # tags for setuptools-scm to derive the version from. Only the container
75
+ # needs this; a hosted runner ships all of it.
76
+ - name: Install build prerequisites
77
+ if: inputs.container != ''
78
+ run: dnf -y install "python${{ inputs.python-version }}" "python${{ inputs.python-version }}-pip" git tar xz
79
+
80
+ # ... and the runners get their python from here instead.
81
+ - uses: actions/setup-python@v7
82
+ if: inputs.container == ''
83
+ with:
84
+ python-version: ${{ inputs.python-version }}
85
+
86
+ - uses: actions/checkout@v7
87
+ with:
88
+ ref: ${{ inputs.ref }}
89
+ # the version frozen into the binary comes from the tags, and the
90
+ # default shallow checkout fetches none of them.
91
+ fetch-depth: 0
92
+
93
+ # the checkout is owned by a different user than this container's root,
94
+ # which git refuses to read from until told it is not a security issue.
95
+ - name: Trust the checkout
96
+ run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
97
+
98
+ - name: Build the executable
99
+ id: build
100
+ run: |
101
+ # In the container python is installed under its versioned name; on
102
+ # a runner setup-python puts a plain 'python' on PATH.
103
+ if [ -n "${{ inputs.container }}" ]; then
104
+ PY="python${{ inputs.python-version }}"
105
+ else
106
+ PY=python
107
+ fi
108
+ scripts/create-python-exe.sh --output dist --python "$PY"
109
+ # The archive name carries the version and the target
110
+ # (git-nested-<version>-<arch>-<os>.tar.xz, .zip on Windows), so it
111
+ # cannot be spelled out ahead of time -- it is published as an
112
+ # output for callers that need the exact name.
113
+ #
114
+ # nullglob: only one of the two patterns ever matches (a build
115
+ # produces .tar.xz or .zip, never both) -- without it the unmatched
116
+ # pattern is passed to ls literally, ls exits non-zero trying to
117
+ # read it, and pipefail+errexit abort the step right here with no
118
+ # visible error (ls's message went to /dev/null).
119
+ shopt -s nullglob
120
+ ARCHIVE="$(ls dist/*.tar.xz dist/*.zip 2>/dev/null | head -1)"
121
+ test -n "$ARCHIVE" || { echo "no archive produced" >&2; exit 1; }
122
+ echo "archive=$(basename "$ARCHIVE")" >> "$GITHUB_OUTPUT"
123
+ # 'git-nested Version: X.Y.Z' -> X.Y.Z
124
+ EXE=dist/git-nested
125
+ [ -f "$EXE" ] || EXE=dist/git-nested.exe
126
+ echo "version=$("$EXE" --version | head -1 | cut -d' ' -f3)" >> "$GITHUB_OUTPUT"
127
+
128
+ # the archive rather than the bare executable. It is what a release
129
+ # actually ships, and on the two platforms where it is a .tar.xz it
130
+ # keeps the exec bit as well, so consumers just untar and run it.
131
+ - uses: actions/upload-artifact@v7
132
+ with:
133
+ name: ${{ inputs.artifact }}
134
+ path: |
135
+ dist/*.tar.xz
136
+ dist/*.zip
137
+ if-no-files-found: error
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
11
  - name: Checkout code
12
- uses: actions/checkout@v4
12
+ uses: actions/checkout@v7
13
13
  with:
14
14
  fetch-depth: 0
15
15
  - name: Install uv
@@ -22,7 +22,7 @@ jobs:
22
22
  - name: Build package
23
23
  run: uv run poe build
24
24
  - name: Upload dist
25
- uses: actions/upload-artifact@v4
25
+ uses: actions/upload-artifact@v7
26
26
  with:
27
27
  name: dist
28
28
  path: dist/
@@ -37,7 +37,7 @@ jobs:
37
37
  id-token: write
38
38
  steps:
39
39
  - name: Download dist
40
- uses: actions/download-artifact@v4
40
+ uses: actions/download-artifact@v8
41
41
  with:
42
42
  name: dist
43
43
  path: dist/
@@ -1,9 +1,9 @@
1
1
  name: Release binary
2
2
 
3
- # Builds the single-file 'git-nested' executable (see
4
- # scripts/create-python-exe.sh) and attaches git-nested_x64_Linux.tar.xz to the
5
- # release, so git-nested can be used on a machine that has no python -- and no
6
- # pip, no uv -- at all.
3
+ # Builds the single-file 'git-nested' executable for Linux, macOS and Windows
4
+ # (see scripts/create-python-exe.sh) and attaches each archive to the release,
5
+ # so git-nested can be used on a machine that has no python -- and no pip, no
6
+ # uv -- at all.
7
7
  #
8
8
  # Separate from publish.yml on purpose. That one is triggered by the tag push
9
9
  # and uploads to PyPI, while attaching an asset needs the GitHub *release* to
@@ -34,17 +34,33 @@ env:
34
34
  # produce an executable that misreports itself. Empty on a plain
35
35
  # workflow_dispatch -- then the triggering ref is built as-is.
36
36
  REF: ${{ github.event.release.tag_name || inputs.tag || github.ref }}
37
- ARCHIVE: git-nested_x64_Linux.tar.xz
38
37
 
39
38
  jobs:
40
39
  # the glibc floor and every other build decision live there, shared with
41
40
  # test.yml so both exercise the same executable. 'env.REF' is not available
42
41
  # to a reusable workflow's inputs, so the ref is spelled out again.
43
42
  build:
43
+ strategy:
44
+ fail-fast: false
45
+ matrix:
46
+ include:
47
+ # Intel macOS is deliberately absent: those runners are gone, and
48
+ # the arm64 binary is what a current Mac needs.
49
+ - target: linux
50
+ runs-on: ubuntu-latest
51
+ container: almalinux:8
52
+ - target: macos
53
+ runs-on: macos-latest
54
+ container: ''
55
+ - target: windows
56
+ runs-on: windows-latest
57
+ container: ''
44
58
  uses: ./.github/workflows/build-binary.yml
45
59
  with:
46
60
  ref: ${{ github.event.release.tag_name || inputs.tag || github.ref }}
47
- artifact: git-nested-binary
61
+ artifact: git-nested-binary-${{ matrix.target }}
62
+ runs-on: ${{ matrix.runs-on }}
63
+ container: ${{ matrix.container }}
48
64
 
49
65
  # The whole pytest suite, driven through the binary that is about to be
50
66
  # attached -- the check that it is functionally complete, not just startable.
@@ -53,7 +69,7 @@ jobs:
53
69
  uses: ./.github/workflows/test-binary.yml
54
70
  with:
55
71
  ref: ${{ github.event.release.tag_name || inputs.tag || github.ref }}
56
- artifact: git-nested-binary
72
+ artifact: git-nested-binary-linux
57
73
 
58
74
  # Proves the "runs on any x86_64 Linux" claim rather than assuming it. The
59
75
  # binary is dropped into stock distro images that have no python installed,
@@ -82,12 +98,14 @@ jobs:
82
98
  - image: archlinux:latest
83
99
  install: pacman -Sy --noconfirm git
84
100
  steps:
85
- - uses: actions/download-artifact@v4
101
+ - uses: actions/download-artifact@v8
86
102
  with:
87
- name: git-nested-binary
103
+ name: git-nested-binary-linux
88
104
 
105
+ # Named git-nested-<version>-<arch>-linux.tar.xz -- resolved by glob
106
+ # since the version isn't known here.
89
107
  - name: Unpack
90
- run: tar -xf "$ARCHIVE"
108
+ run: tar -xf git-nested-*-linux.tar.xz
91
109
 
92
110
  # git is the one thing that does have to be installed -- git-nested
93
111
  # drives it and refuses to start without it. Python deliberately is not:
@@ -127,31 +145,44 @@ jobs:
127
145
 
128
146
  # The binary and the script are mounted in, so the distro images need
129
147
  # neither tar/xz nor anything else to take part beyond git -- the point
130
- # is that nothing else is required.
148
+ # is that nothing else is required. 'git-nested' is now a symlink to the
149
+ # versioned binary, so both have to be mounted together (into PATH)
150
+ # rather than just the single file -- a lone symlink mount would
151
+ # dangle, pointing at a sibling that was never brought along.
131
152
  - name: Run on ${{ matrix.image }}
132
153
  run: |
133
154
  docker run --rm \
134
- -v "$PWD/git-nested:/usr/local/bin/git-nested:ro" \
135
- -v "$PWD/verify.sh:/verify.sh:ro" \
155
+ -v "$PWD:/work" -w /work \
136
156
  ${{ matrix.image }} \
137
- sh -c '${{ matrix.install }} >/dev/null && sh /verify.sh'
157
+ sh -c '${{ matrix.install }} >/dev/null && export PATH="/work:$PATH" && sh verify.sh'
138
158
 
139
159
  upload:
140
- needs: [test, verify]
160
+ # 'build' listed directly (not just transitively via 'test'/'verify')
161
+ # because a job's outputs are only visible to jobs that name it in
162
+ # 'needs'.
163
+ needs: [build, test, verify]
141
164
  # nothing to attach when workflow_dispatch ran without a tag
142
165
  if: github.event_name == 'release' || inputs.tag != ''
143
166
  runs-on: ubuntu-latest
144
167
  permissions:
145
168
  contents: write
146
169
  steps:
147
- - uses: actions/download-artifact@v4
170
+ # every target's artifact, unpacked side by side. 'build' is a matrix,
171
+ # and a matrix job's outputs are last-one-wins, so the exact file names
172
+ # are read off disk here rather than composed from an output.
173
+ - uses: actions/download-artifact@v8
148
174
  with:
149
- name: git-nested-binary
175
+ pattern: git-nested-binary-*
176
+ merge-multiple: true
150
177
 
151
178
  # --clobber so re-running against an already-attached release replaces
152
- # the asset instead of failing halfway.
153
- - name: Attach ${{ env.ARCHIVE }} to ${{ env.REF }}
179
+ # the assets instead of failing halfway.
180
+ - name: Attach the binaries to ${{ env.REF }}
154
181
  env:
155
182
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
156
183
  GH_REPO: ${{ github.repository }}
157
- run: gh release upload "$REF" "$ARCHIVE" --clobber
184
+ run: |
185
+ mapfile -t assets < <(ls git-nested-*.tar.xz git-nested-*.zip 2>/dev/null)
186
+ test "${#assets[@]}" -gt 0 || { echo "no archives downloaded" >&2; exit 1; }
187
+ printf '%s\n' "${assets[@]}"
188
+ gh release upload "$REF" "${assets[@]}" --clobber
@@ -1,7 +1,7 @@
1
1
  name: Test binary
2
2
 
3
- # Runs the *whole* pytest suite against the standalone executable instead of
4
- # against the git_nested module in the checkout: conftest's GIT_NESTED_EXE
3
+ # Runs the *whole* pytest suite against the standalone Linux executable rather
4
+ # than against the git_nested module in the checkout: conftest's GIT_NESTED_EXE
5
5
  # routes every cmd_git_nested() call through `git nested ...` on PATH, so the
6
6
  # ~130 tests drive the frozen binary as a user would. That is what catches the
7
7
  # failures unique to freezing -- a module PyInstaller did not collect, package
@@ -30,7 +30,7 @@ jobs:
30
30
  test:
31
31
  runs-on: ubuntu-latest
32
32
  steps:
33
- - uses: actions/checkout@v4
33
+ - uses: actions/checkout@v7
34
34
  with:
35
35
  ref: ${{ inputs.ref }}
36
36
  # no fetch-depth: 0 needed -- the version under test is read out of
@@ -56,16 +56,19 @@ jobs:
56
56
  git config --global --add safe.directory "$PWD";
57
57
  git config --global --add safe.directory "$PWD.git";
58
58
 
59
- - uses: actions/download-artifact@v4
59
+ - uses: actions/download-artifact@v8
60
60
  with:
61
61
  name: ${{ inputs.artifact }}
62
62
 
63
63
  # into its own directory: the env fixture puts the binary's directory on
64
- # PATH, and the repo root is not a good thing to put there.
64
+ # PATH, and the repo root is not a good thing to put there. Named
65
+ # git-nested-<version>-<arch>-linux.tar.xz, so matched by glob. 'git-nested'
66
+ # inside is a symlink to the versioned binary, so both land in bin/
67
+ # together.
65
68
  - name: Unpack the binary
66
69
  run: |
67
70
  mkdir -p bin
68
- tar -C bin -xf git-nested_x64_Linux.tar.xz
71
+ tar -C bin -xf git-nested-*-linux.tar.xz
69
72
  bin/git-nested --version
70
73
 
71
74
  # no coverage flags: the code being executed lives in another process
@@ -0,0 +1,102 @@
1
+ name: Run Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: ['**']
8
+
9
+ # One run per branch/PR at a time -- a new commit cancels whatever this
10
+ # workflow is still running for the same ref. Not on main: every push there
11
+ # is a merge, and each one should run to completion rather than being
12
+ # canceled by the next.
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
15
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
16
+
17
+ jobs:
18
+ # Builds the standalone executable with the very script the release uses
19
+ # (scripts/create-python-exe.sh), so a change that breaks the freeze -- a new
20
+ # import, a moved data file -- fails here rather than on release day. All
21
+ # three targets, because a break is usually a break on one of them only. The
22
+ # script smoke-tests each binary it produces; release-binary.yml additionally
23
+ # runs the Linux one across distros before attaching it to a release.
24
+ binary:
25
+ strategy:
26
+ fail-fast: false
27
+ matrix:
28
+ include:
29
+ # Intel macOS is deliberately absent: those runners are gone, and
30
+ # the arm64 binary is what a current Mac needs.
31
+ - target: linux
32
+ runs-on: ubuntu-latest
33
+ container: almalinux:8
34
+ - target: macos
35
+ runs-on: macos-latest
36
+ container: ''
37
+ - target: windows
38
+ runs-on: windows-latest
39
+ container: ''
40
+ uses: ./.github/workflows/build-binary.yml
41
+ with:
42
+ artifact: git-nested-binary-ci-${{ matrix.target }}
43
+ runs-on: ${{ matrix.runs-on }}
44
+ container: ${{ matrix.container }}
45
+
46
+ # ... and then runs the full pytest suite through the Linux executable, so a
47
+ # binary that builds but does not work still fails the PR. Linux only: the
48
+ # suite is the same suite either way, and what it is checking here is that
49
+ # freezing did not drop anything -- a per-platform answer the smoke test in
50
+ # create-python-exe.sh already gives for the other two.
51
+ binary-test:
52
+ needs: binary
53
+ uses: ./.github/workflows/test-binary.yml
54
+ with:
55
+ artifact: git-nested-binary-ci-linux
56
+
57
+ test:
58
+ runs-on: ${{ matrix.os }}
59
+ strategy:
60
+ matrix:
61
+ os: [ubuntu-latest, macos-latest]
62
+ python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
63
+
64
+ steps:
65
+ - name: Checkout code
66
+ uses: actions/checkout@v7
67
+ with:
68
+ # SonarCloud's blame-based analysis (new-code detection, issue
69
+ # authorship) needs real history, not the default shallow, tagless
70
+ # checkout.
71
+ fetch-depth: 0
72
+ - name: Install uv
73
+ uses: astral-sh/setup-uv@v7
74
+ with:
75
+ python-version: ${{ matrix.python-version }}
76
+ enable-cache: true
77
+ - name: Setup project
78
+ run: uv sync --frozen
79
+ - name: git config
80
+ run: |
81
+ git config --global user.email "you@example.com";
82
+ git config --global user.name "Your Name";
83
+ git config --global init.defaultBranch "master";
84
+ git config --global --add safe.directory "$PWD";
85
+ git config --global --add safe.directory "$PWD.git";
86
+ - name: Run poe all
87
+ run: uv run poe all
88
+ - name: Upload coverage reports to Codecov
89
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
90
+ uses: codecov/codecov-action@v7
91
+ with:
92
+ token: ${{ secrets.CODECOV_TOKEN }}
93
+ - name: Upload test results to Codecov
94
+ if: ${{ !cancelled() }}
95
+ uses: codecov/test-results-action@v1
96
+ with:
97
+ token: ${{ secrets.CODECOV_TOKEN }}
98
+ - name: SonarCloud Scan
99
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
100
+ uses: SonarSource/sonarqube-scan-action@v8
101
+ env:
102
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -1,4 +1,4 @@
1
- /test/tmp/
1
+ /tests/tmp/
2
2
  __pycache__
3
3
  .venv/
4
4
  *.pyc
@@ -10,6 +10,7 @@ build/
10
10
  .coverage
11
11
  htmlcov/
12
12
  coverage.xml
13
+ .coverage*
13
14
  junit.xml
14
15
  *.whl
15
16
  *.tar.gz
@@ -0,0 +1,63 @@
1
+ # Repo-wide hygiene gate. Run over the whole tree by `uv run poe pre-commit`,
2
+ # the first step of `uv run poe all`. Nothing installs an actual git hook --
3
+ # that stays a per-developer `pre-commit install` if you want it.
4
+ #
5
+ # Everything language-specific already has its own poe task backed by a version
6
+ # pinned in pyproject.toml's `lint` dependency group -- ruff, mypy, pyright,
7
+ # bandit, pip-audit, complexipy. Duplicating any of them here would mean a
8
+ # second, independently-pinned copy drifting from the one CI runs, so this file
9
+ # deliberately stays limited to the checks nothing else covers.
10
+ repos:
11
+ # General pre-commit hooks
12
+ - repo: https://github.com/pre-commit/pre-commit-hooks
13
+ rev: v6.0.0
14
+ hooks:
15
+ # --- whitespace -----------------------------------------------------
16
+ # .patch/.diff are excluded throughout: trailing whitespace inside a
17
+ # hunk is content, and git's "-- \n" signature separator is load-bearing.
18
+ # Rewriting either corrupts the patch.
19
+ - id: trailing-whitespace
20
+ exclude: ^.*\.(patch|diff)$
21
+ - id: end-of-file-fixer
22
+ exclude: ^.*\.(patch|diff)$
23
+ - id: mixed-line-ending
24
+ args: ['--fix=lf']
25
+ exclude: ^.*\.(patch|diff)$
26
+
27
+ # --- parseability of the files that configure everything else -------
28
+ - id: check-yaml
29
+ - id: check-toml
30
+ - id: check-json
31
+
32
+ # --- python ---------------------------------------------------------
33
+ - id: debug-statements
34
+ - id: name-tests-test
35
+ args: ['--pytest-test-first']
36
+ # tests/unit/fakes.py holds the shared test doubles. It cannot be a
37
+ # conftest.py -- pytest registers every conftest under the bare name
38
+ # 'conftest', so a second one would collide in sys.modules with
39
+ # tests/conftest.py, which the whole e2e suite imports by that name.
40
+ exclude: ^tests/unit/fakes\.py$
41
+
42
+ # --- scripts --------------------------------------------------------
43
+ - id: check-executables-have-shebangs
44
+ - id: check-shebang-scripts-are-executable
45
+
46
+ # --- repo integrity -------------------------------------------------
47
+ - id: detect-private-key
48
+ - id: check-added-large-files
49
+ args: ['--maxkb=500', '--enforce-all']
50
+ - id: check-case-conflict
51
+ - id: check-merge-conflict
52
+ - id: check-symlinks
53
+ - id: destroyed-symlinks
54
+ - id: forbid-submodules
55
+
56
+
57
+ # Configuration
58
+ default_language_version:
59
+ python: python3.12
60
+
61
+ # Minimum pre-commit version -- matches the floor pyproject.toml's `lint`
62
+ # dependency group pins.
63
+ minimum_pre_commit_version: '4.0.0'
@@ -13,7 +13,13 @@ GIT_NESTED_ROOT=$(
13
13
  ) || return
14
14
 
15
15
  export GIT_NESTED_ROOT
16
- export PATH=$GIT_NESTED_ROOT/lib:$PATH
16
+ export PATH=$GIT_NESTED_ROOT/bin:$PATH
17
17
  export MANPATH=$GIT_NESTED_ROOT/man:$MANPATH
18
18
 
19
- source "$GIT_NESTED_ROOT/share/enable-completion.sh"
19
+ # Tab completion. The script is generated by git-nested itself, from the
20
+ # same tables the argument parser is built from, so it can never drift.
21
+ if [[ -n ${ZSH_VERSION-} ]]; then
22
+ eval "$(git-nested completion zsh)"
23
+ else
24
+ eval "$(git-nested completion bash)"
25
+ fi