Skip to content

test issue#146

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

test issue#146
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
🤖 Augment PR Summary

Summary: This PR refactors how qs dev gathers repository metadata and adds a small git-status edge case handling.

Changes:

  • Introduces gitcmds.RepoContext and a new LoadRepoContext() helper intended to gather key repo state up front (branch info, upstream presence, uncommitted changes, parent repo).
  • Refactors parent-repo detection by extracting the GitHub API call into getParentRepoByOrgRepo() and reusing it from GetParentRepoName().
  • Updates qs dev to use the preloaded context values instead of issuing repeated git/gh queries inline.
  • Extends git status parsing to handle the AD status by skipping those entries.
  • Bumps Go toolchain version and updates several module dependencies.
  • Adds a benchmark that measures git ls-remote performance in the current repo.

Technical Notes: The intent appears to be fewer round-trips and better responsiveness by parallelizing independent git calls and deferring the single GitHub API call until 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) {

@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.

In non-fork repositories, gh api ... --jq .parent.full_name may yield null, which would be returned as a non-empty string and could incorrectly trigger fork/upstream behavior (e.g., treating parent repo as "null"). Consider normalizing a missing parent (null) to an empty value before returning.

Severity: medium

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.

Porcelain status AD typically means “added to index, deleted in working tree”; the file can still be staged and included in the next commit. Skipping it here may cause staged additions (including large files) to bypass whatever checks rely on getListOfChangedFiles().

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.

return string(out[:len(out)-1]) assumes the output ends with exactly one \n; on Windows (\r\n) this can leave a trailing \r in the path and break cmd.Dir. A whitespace-based trim would be more robust.

Severity: low

Fix This in Augment

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

@host6 host6 closed this Jun 9, 2026
@host6
host6 deleted the test-issue-pr branch June 9, 2026 13:01
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