Skip to content

Conversation

@ffranr
Copy link
Contributor

@ffranr ffranr commented Jan 5, 2026

Golangci-lint uses issues.new-from-rev to compare against Git history, but worktrees store .git metadata outside the worktree root. When lint ran in Docker, that history wasn't mounted, causing new-from-rev filtering to fail.

Detect the Git dir and common dir via git rev-parse and bind-mount them into the container when they are absolute and distinct. This preserves existing cache mounts and maintains consistent behavior across local and CI environments.

Golangci-lint uses `issues.new-from-rev` to compare against Git history,
but worktrees store .git metadata outside the worktree root. When lint
ran in Docker, that history wasn't mounted, causing new-from-rev
filtering to fail.

Detect the Git dir and common dir via `git rev-parse` and bind-mount
them into the container when they are absolute and distinct. This
preserves existing cache mounts and maintains consistent behavior across
local and CI environments.
@gemini-code-assist
Copy link

Summary of Changes

Hello @ffranr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where golangci-lint failed to access Git history when executed within Docker containers, particularly when a Git worktree was in use. The core problem stemmed from the .git metadata being stored outside the worktree root, preventing golangci-lint's new-from-rev functionality from working correctly. The solution involves modifying the Makefile to automatically detect and bind-mount the necessary Git metadata directories into the Docker container, thereby restoring proper linting functionality and ensuring a consistent development experience across different environments.

Highlights

  • Worktree Support for Docker Linting: Enabled golangci-lint to correctly utilize Git history (via issues.new-from-rev) when run inside Docker containers, specifically addressing issues encountered with Git worktrees.
  • Dynamic Git Metadata Mounting: Implemented logic within the Makefile to dynamically detect the Git directory and its common directory using git rev-parse, then conditionally bind-mount these paths into the Docker container.
  • Consistent Linting Environment: Ensured that linting behavior remains consistent for users working with Git worktrees, whether they are running lint checks locally or in a Continuous Integration (CI) environment.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a well-thought-out solution to support Git worktrees during Docker-based linting. The changes in the Makefile correctly identify the git directory and common directory using git rev-parse, and conditionally add them as volume mounts to the Docker command only when they are absolute paths. This ensures that golangci-lint can access the full Git history even when using worktrees, which store metadata outside the project root. The implementation is clean, correctly handles the case of standard repositories vs. worktrees, and is applied to both CI and local Docker runs. The logic is sound and I see no issues with the proposed changes.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 20712695291

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 66 unchanged lines in 17 files lost coverage.
  • Overall coverage decreased (-0.002%) to 56.974%

Files with Coverage Reduction New Missed Lines %
fn/iter.go 2 62.07%
rfqmsg/records.go 2 70.32%
tapdb/sqlc/transfers.sql.go 2 82.65%
tapdb/sqlc/universe.sql.go 2 73.71%
universe/archive.go 2 79.91%
itest/assertions.go 3 87.42%
tapchannel/aux_leaf_signer.go 3 43.53%
tapgarden/planter.go 3 80.26%
universe/supplycommit/env.go 3 75.6%
mssmt/compacted_tree.go 4 77.65%
Totals Coverage Status
Change from base Build 20468127774: -0.002%
Covered Lines: 65509
Relevant Lines: 114981

💛 - Coveralls

@ffranr ffranr requested review from darioAnongba and jtobin January 5, 2026 15:36
Copy link
Member

@jtobin jtobin left a comment

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation bot moved this from 🆕 New to 👀 In review in Taproot-Assets Project Board Jan 7, 2026
@jtobin jtobin added this pull request to the merge queue Jan 7, 2026
Merged via the queue into main with commit a53d82e Jan 7, 2026
27 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Taproot-Assets Project Board Jan 7, 2026
@ffranr ffranr deleted the chore/worktree-lint-support branch January 7, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

5 participants