GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Keep bare-repository worktrees non-bare by Byron · Pull Request #2224 · gitpython-developers/GitPython

Conversation

@Byron

@Byron Byron commented Sep 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Tasks

This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.

  • refackiew

Everything below this line was generated by Codex GPT-5.

Created by Codex on behalf of Byron. Byron will review before this is ready to merge.

Fixes #2223

Summary

  • Keep linked worktrees non-bare when their common repository has core.bare enabled.
  • Preserve the discovered working_tree_dir so index operations can use the checkout.
  • Add a regression test comparing Repo with native git rev-parse behavior.

Git reference

Git 2.50.1 reports the linked checkout as non-bare. The implementation was checked against Git source baseline 0bd5a6920d7c4238e0d90ddc0e7e08866e84a0f1, notably environment.c is_bare_repository() and setup.c check_repository_format_gently().

Commits

  • d3cb53c fix: keep bare-repository worktrees non-bare (Repo instantiated from a bare-repository worktree incorrectly sets bare = True #2223)
  • 4a6b2f3 test: skip bare worktree regression on old Git

Validation

  • 12 focused repository-discovery/worktree tests passed.
  • 7 test_base.py tests passed.
  • Ruff check, Ruff format check, and codespell passed.
  • Full test_repo.py probe: 90 passed and 2 skipped; 4 unrelated host-state failures remain in tests that assume a master default branch, core.quotePath defaults, or no extra refs in the source repository.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

simu reacted with eyes emoji
All reactions
  • 👀 1 reaction
Copilot AI lite review requested due to automatic review settings September 1, 2026 07:48
Copilot started reviewing on behalf of Byron September 1, 2026 07:49
View session
Copilot AI reviewed Sep 1, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect bare-repo detection when instantiating Repo from a linked worktree created off a bare common repository, ensuring working_tree_dir remains available for index operations and matching native git rev-parse behavior.

Changes:

  • Treat linked worktrees as non-bare even if the common repository has core.bare=true.
  • Preserve the discovered working_tree_dir for linked worktrees so operations like index.add() work.
  • Add a regression test asserting parity with git rev-parse --is-bare-repository and validating working_tree_dir.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
git/repo/base.py Adjusts bare-repo detection to keep linked worktrees non-bare when commondir indicates a linked worktree.
test/test_repo.py Adds a regression test covering Repo discovery from a worktree created from a bare repository.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/test_repo.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Byron @codex
fix: keep bare-repository worktrees non-bare (#2223)
180b1ff
<!-- agent -->
Opening a linked worktree created from a bare repository read `core.bare` from the
common repository and discarded the worktree path.

Keep a discovered linked worktree non-bare when its administrative directory has
a `commondir` marker. The regression compares Git rev-parse behavior and verifies
Repo.bare and working_tree_dir.

Git baseline: 0bd5a6920d7c4238e0d90ddc0e7e08866e84a0f1;
environment.c:is_bare_repository() and setup.c:check_repository_format_gently().
Git 2.50.1 reports the linked checkout as non-bare.

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <[email protected]>
Copilot AI review requested due to automatic review settings September 1, 2026 07:59
@Byron
Byron force-pushed the worktree-from-bare branch from 4a6b2f3 to 180b1ff Compare September 1, 2026 07:59
Copilot started reviewing on behalf of Byron September 1, 2026 08:00
View session
Copilot AI reviewed Sep 1, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI review requested due to automatic review settings September 1, 2026 08:15
Copilot started reviewing on behalf of Byron September 1, 2026 08:15
View session
Copilot AI reviewed Sep 1, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI review requested due to automatic review settings September 1, 2026 08:33
Copilot started reviewing on behalf of Byron September 1, 2026 08:35
View session
Copilot AI reviewed Sep 1, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI review requested due to automatic review settings September 1, 2026 08:39
Copilot started reviewing on behalf of Byron September 1, 2026 08:47
View session
Copilot AI reviewed Sep 1, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/cygwin-test.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI review requested due to automatic review settings September 1, 2026 08:59
Copilot started reviewing on behalf of Byron September 1, 2026 09:00
View session
Copilot AI reviewed Sep 1, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Byron
Byron force-pushed the worktree-from-bare branch from 137342f to 1a4c245 Compare September 1, 2026 09:27
@Byron @codex
ci: restore Cygwin virtual environments on Python 3.9
0e8c23c
<!-- agent -->
Cygwin patches ensurepip to load setuptools and pip wheels from
`/usr/share/python-wheels`. The rolling python-pip-wheel package advanced to pip
26.2.1, which requires Python 3.10 or newer, so every Python 3.9 venv creation
failed—including the installation test's nested virtual environment.

Keep the single Cygwin lane on Python 3.9 because the regular matrix already
covers Python 3.12 and newer. Install Cygwin's setuptools wheel, download pip
26.0.1 from its immutable PyPI URL into ensurepip's shared wheel directory,
verify its SHA-256 digest, and avoid upgrading pip. This fixes all venv creation
without relying on a version that may disappear from rolling Cygwin mirrors.

Assisted-by: GPT 5.6
Co-authored-by: GPT 5.6 <[email protected]>
@Byron
Byron force-pushed the worktree-from-bare branch from 1a4c245 to 0e8c23c Compare September 1, 2026 09:42
@Byron
Byron merged commit 1d47514 into main Sep 1, 2026
53 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Sep 6, 2026
Repo instantiated from a bare-repository worktree incorrectly sets bare = True #2223
Closed
test: cover subdirectory discovery and pathspec commands in bare-repository worktrees #2228
Merged
@blaipr blaipr mentioned this pull request Sep 7, 2026
build: bump gitpython from 3.1.61 to 3.1.62 in /requirements ctrliq/ascender#846
Merged
@Byron
Byron deleted the worktree-from-bare branch October 5, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Repo instantiated from a bare-repository worktree incorrectly sets bare = True

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Byron
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.