Skip to content

test issue#147

Closed
host6 wants to merge 1 commit into
untillpro:mainfrom
host6:test-issue-pr
Closed

test issue#147
host6 wants to merge 1 commit into
untillpro:mainfrom
host6:test-issue-pr

Conversation

@host6

@host6 host6 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

test issue

@augmentcode

augmentcode Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deep Code Review Agent🐛

Started — view session to follow along.

@augmentcode

augmentcode Bot commented Jun 9, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR refactors qs dev to pre-load repository metadata and reduces redundant git/GitHub CLI calls.

Changes:

  • Introduced gitcmds.RepoContext and LoadRepoContext() to gather repo/org, branch, upstream, and working tree state up front (with concurrent local git commands).
  • Split parent-repo lookup into a helper that takes org/repo, then reused it from existing code paths.
  • Updated qs dev flow to use the preloaded context for fork detection, main-branch enforcement, stashing, syncing, and GitHub issue linking.
  • Extended git status parsing to recognize an additional status combination (AD).
  • Bumped Go toolchain version and refreshed several dependencies in go.mod.
  • Added a benchmark around git ls-remote performance for diagnostics.

Technical Notes: The new context loader aims to minimize round-trips by running independent git checks in parallel and doing the GitHub API call only after org/repo are known.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread gitcmds/gitcmds.go
// getParentRepoByOrgRepo fetches the parent repository full name via the GitHub API.
func getParentRepoByOrgRepo(wd, org, repo string) (string, error) {
stdout, stderr, err := new(exec.PipedExec).
Command("gh", "api", "repos/"+org+slash+repo, "--jq", ".parent.full_name").

@augmentcode augmentcode Bot Jun 9, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

gitcmds/gitcmds.go:485: Using --jq ".parent.full_name" can return the literal string null for non-fork repos, which would make len(parentRepo) > 0 checks mis-detect a fork and potentially break single-remote workflows.

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread gitcmds/status.go
oldSize = newFileSize
case `??`:
newFileSize, err2 = getFileSize(wd, name)
case `AD`:

@augmentcode augmentcode Bot Jun 9, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

gitcmds/status.go:168: Treating status AD as "never existed" and continue may hide a real staged add (index) vs deleted working-tree state, causing changed-file accounting to be silently wrong for that edge case.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

b.Helper()
out, err := exec.Command("git", "rev-parse", "--show-toplevel").Output()
require.NoError(b, err)
return string(out[:len(out)-1]) // trim trailing newline

@augmentcode augmentcode Bot Jun 9, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

internal/commands/dev_test.go:27: string(out[:len(out)-1]) assumes non-empty output and \n line endings; on Windows (\r\n) or unexpected output this can leave a trailing \r or panic, which makes the benchmark brittle.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

Review completed with 1 suggestions.

Fix in Cosmos

Comment thread gitcmds/status.go
oldSize = newFileSize
case `??`:
newFileSize, err2 = getFileSize(wd, name)
case `AD`:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

AD means the blob is still staged even though the working-tree file was deleted, so continue hides content that would still be included by git commit. This makes qs status omit the staged file from the positive-delta summary instead of reporting the indexed addition.

Severity: low


🤖 Was this useful? React with 👍 or 👎

@host6 host6 closed this Jun 10, 2026
@host6
host6 deleted the test-issue-pr branch June 10, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant