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 — plumbing: object, Isolate tests from host git config. by cedric-appdirect · Pull Request #2122 · go-git/go-git

Conversation

@cedric-appdirect

@cedric-appdirect cedric-appdirect commented May 13, 2026

Copy link
Copy Markdown
Contributor

Tests that create in-memory repositories and commit via the top-level git.Init/Worktree.Commit API inherit the host global git config through the NewAuto() ConfigLoader plugin. When a developer has commit.gpgSign=true, these tests fail because no ObjectSigner plugin is registered.

Add TestMain to plumbing/object and x/plumbing/worktree that replaces NewAuto() with a static config, mirroring the existing pattern in the root git package.

Assisted-by:i Cursor with Claude Opus 4.6 [email protected]

Sorry, something went wrong.

Uh oh!

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

onee-only reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@cedric-appdirect
cedric-appdirect force-pushed the fix-local-test-with-gpgsign branch from 17852b5 to 2282d86 Compare May 13, 2026 23:25
@AriehSchneier

AriehSchneier commented May 14, 2026

Copy link
Copy Markdown
Contributor

Love this idea, I currently have to turn off gpgSign every time I run CI. My only comment would be, this could be necessary for more folders and we will be duplicating the code, maybe create a util somewhere so that each TestMain is just a call to the single util?

All reactions

Sorry, something went wrong.

Uh oh!

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

pjbgf
pjbgf requested changes May 18, 2026
View reviewed changes

@pjbgf pjbgf left a comment

Copy link
Copy Markdown
Member

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.

I'd agree with @AriehSchneier. We actually already call this in a few locations, let's create a new internal/test/config and add this logic there instead.

Sorry, something went wrong.

Uh oh!

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

cedric-appdirect reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@cedric-appdirect
cedric-appdirect force-pushed the fix-local-test-with-gpgsign branch 2 times, most recently from 8ff8bfb to f65c73b Compare May 19, 2026 16:29
cedric-appdirect added a commit to cedric-appdirect/go-git that referenced this pull request May 19, 2026
@cedric-appdirect @cursoragent
internal: test, Consolidate config loader test helper.
f65c73b
Move the static ConfigLoader registration into internal/test/config
so every package that needs isolation from the host git config can
call a single shared helper instead of duplicating the go:linkname
and plugin.Register boilerplate.

Addresses review feedback from @AriehSchneier and @pjbgf on PR go-git#2122.

Assisted-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@cedric-appdirect
cedric-appdirect requested a review from pjbgf May 19, 2026 16:29
@cedric-appdirect
cedric-appdirect force-pushed the fix-local-test-with-gpgsign branch from f65c73b to d8b2cbf Compare May 29, 2026 15:35
cedric-appdirect added a commit to cedric-appdirect/go-git that referenced this pull request May 29, 2026
@cedric-appdirect @cursoragent
internal: test, Consolidate config loader test helper.
d8b2cbf
Move the static ConfigLoader registration into internal/test/config
so every package that needs isolation from the host git config can
call a single shared helper instead of duplicating the go:linkname
and plugin.Register boilerplate.

Addresses review feedback from @AriehSchneier and @pjbgf on PR go-git#2122.

Assisted-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
cedric-appdirect added a commit to cedric-appdirect/go-git that referenced this pull request May 29, 2026
@cedric-appdirect
internal: test, Consolidate config loader test helper.
099bb51
Move the static ConfigLoader registration into internal/test/config
so every package that needs isolation from the host git config can
call a single shared helper instead of duplicating the go:linkname
and plugin.Register boilerplate.

Addresses review feedback from @AriehSchneier and @pjbgf on PR go-git#2122.

Assisted-by: Cursor with Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Cedric BAIL <[email protected]>
@cedric-appdirect
cedric-appdirect force-pushed the fix-local-test-with-gpgsign branch from d8b2cbf to 099bb51 Compare May 29, 2026 15:42
cedric-appdirect added a commit to cedric-appdirect/go-git that referenced this pull request May 29, 2026
@cedric-appdirect
internal: test, Consolidate config loader test helper.
e69df9b
Move the static ConfigLoader registration into internal/test/config
so every package that needs isolation from the host git config can
call a single shared helper instead of duplicating the go:linkname
and plugin.Register boilerplate.

Addresses review feedback from @AriehSchneier and @pjbgf on PR go-git#2122.

Assisted-by: Cursor with Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Cedric BAIL <[email protected]>
@cedric-appdirect
cedric-appdirect force-pushed the fix-local-test-with-gpgsign branch from 099bb51 to e69df9b Compare May 29, 2026 22:47
cedric-appdirect added a commit to cedric-appdirect/go-git that referenced this pull request Jun 23, 2026
@cedric-appdirect
internal: test, Consolidate config loader test helper.
03c95d7
Move the static ConfigLoader registration into internal/test/config
so every package that needs isolation from the host git config can
call a single shared helper instead of duplicating the go:linkname
and plugin.Register boilerplate.

Addresses review feedback from @AriehSchneier and @pjbgf on PR go-git#2122.

Assisted-by: Cursor with Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Cedric BAIL <[email protected]>
@cedric-appdirect
cedric-appdirect force-pushed the fix-local-test-with-gpgsign branch 2 times, most recently from 03c95d7 to 3c71676 Compare June 26, 2026 19:40
cedric-appdirect added a commit to cedric-appdirect/go-git that referenced this pull request Jun 26, 2026
@cedric-appdirect
internal: test, Consolidate config loader test helper.
3c71676
Move the static ConfigLoader registration into internal/test/config
so every package that needs isolation from the host git config can
call a single shared helper instead of duplicating the go:linkname
and plugin.Register boilerplate.

Addresses review feedback from @AriehSchneier and @pjbgf on PR go-git#2122.

Assisted-by: Cursor with Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Cedric BAIL <[email protected]>
cedric-appdirect added 2 commits June 30, 2026 12:22
@cedric-appdirect @pjbgf
plumbing: object, Isolate tests from host git config.
0d5c1c0
Tests that create in-memory repositories and commit via the top-level
git.Init/Worktree.Commit API inherit the host global git config
through the NewAuto() ConfigLoader plugin. When a developer has
commit.gpgSign=true, these tests fail because no ObjectSigner plugin
is registered.

Add TestMain to plumbing/object and x/plumbing/worktree that replaces
NewAuto() with a static config, mirroring the existing pattern in the
root git package.

Assisted-by:i Cursor with Claude Opus 4.6 <[email protected]>
Signed-off-by: Cedric BAIL <[email protected]>
@cedric-appdirect @pjbgf
internal: test, Consolidate config loader test helper.
6109f8f
Move the static ConfigLoader registration into internal/test/config
so every package that needs isolation from the host git config can
call a single shared helper instead of duplicating the go:linkname
and plugin.Register boilerplate.

Addresses review feedback from @AriehSchneier and @pjbgf on PR go-git#2122.

Assisted-by: Cursor with Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Cedric BAIL <[email protected]>
@pjbgf
pjbgf force-pushed the fix-local-test-with-gpgsign branch from 3c71676 to 6109f8f Compare June 30, 2026 11:22
pjbgf
pjbgf approved these changes Jun 30, 2026
View reviewed changes

@pjbgf pjbgf left a comment

Copy link
Copy Markdown
Member

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.

@cedric-appdirect thanks for improving our test harness! 🙇

Sorry, something went wrong.

Uh oh!

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

All reactions
@pjbgf
pjbgf merged commit c543666 into go-git:main Jun 30, 2026
16 checks passed

Uh oh!

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

@cedric-appdirect
cedric-appdirect deleted the fix-local-test-with-gpgsign branch July 6, 2026 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pjbgf pjbgf pjbgf approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@cedric-appdirect @AriehSchneier @pjbgf
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 01402775 — 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.