append remote name to issue/PR creation output #28

Manually merged
heiko merged 3 commits from fix/4-show-remote into master 2026-05-18 20:51:30 +02:00
Owner

Closes #4.

Summary

  • Added Remote string field to api.Client, populated from the detected git remote in newClient()
  • Exported repo.RemoteName() to surface the resolved remote short name
  • Extracted shared formatCreated() helper; formatCreatedPR and formatCreatedIssue delegate to it
  • Creation output now reads e.g. Created issue #5 Title on origin

Test plan

  • go test ./... passes
  • fj issue create shows Created issue #N ... on <remote> in the output
  • fj pr create shows Created PR #N ... on <remote> in the output
Closes #4. ## Summary - Added `Remote string` field to `api.Client`, populated from the detected git remote in `newClient()` - Exported `repo.RemoteName()` to surface the resolved remote short name - Extracted shared `formatCreated()` helper; `formatCreatedPR` and `formatCreatedIssue` delegate to it - Creation output now reads e.g. `Created issue #5 Title on origin` ## Test plan - [x] `go test ./...` passes - [ ] `fj issue create` shows `Created issue #N ... on <remote>` in the output - [ ] `fj pr create` shows `Created PR #N ... on <remote>` in the output
feat: add fj remote [show] subcommand
All checks were successful
nagonag (Push) / nagonag (push) Successful in 1m31s
d8aeecc268
Shows the current branch, short remote name, and the HTTPS URL fj
derives from the remote. If git is configured with a different URL
(SSH, or pre-insteadOf), appends it as "(git: <url>)".

Refs #4.
heiko force-pushed fix/4-show-remote from d8aeecc268
All checks were successful
nagonag (Push) / nagonag (push) Successful in 1m31s
to 40aa926637
All checks were successful
nagonag (Push) / nagonag (push) Successful in 1m32s
2026-05-18 20:41:41 +02:00
Compare
Author
Owner

Review

Issues

Dead commented-out code in remote.go (must fix)

Lines 37 and 58-59 are commented-out dead code that should not be committed:

//branch := repo.CurrentBranch(dir)
...
//line := branch + " " + remoteName + " " + fjURL
line := remoteName + " " + fjURL

If the decision was to drop branch from the output, delete those lines.

.git-suffix false positive in remote show

When the remote is a plain HTTPS URL, configURL and fjURL differ only by the .git suffix:

configURL = https://git.schlittermann.de/heiko/fj.git
fjURL     = https://git.schlittermann.de/heiko/fj

This triggers (git: https://git.schlittermann.de/heiko/fj.git) in the output, which is misleading — stripping .git is an fj implementation detail, not a meaningful URL conversion. The guard should normalise the .git suffix away before comparing.

Duplicate Short on remoteCmd and remoteShowCmd

Both read "Show remote information". Suggest "Remote information" for the parent remoteCmd to match the convention of e.g. labelCmd ("Manage labels").

No test for remoteShowRun

remote.go has no test coverage. A unit test for the formatting logic (similar to TestFormatCreatedPR_IncludesRemote) would help catch regressions.

Minor

  • Remote string on api.Client is slightly leaky (git concept in HTTP layer) but acceptable given the 20+ newClient() call sites.
  • RawURL mirrors logic in Detect — small duplication, different semantics (display vs. parse), acceptable.
  • formatCreated shared helper in root.go is clean.

Summary

Block on: dead commented-out code and .git-suffix false positive. The rest is mergeable with minor polish.

🤖 Generated with Claude Code (claude-sonnet-4-6)

## Review ### Issues **Dead commented-out code in `remote.go` (must fix)** Lines 37 and 58-59 are commented-out dead code that should not be committed: ```go //branch := repo.CurrentBranch(dir) ... //line := branch + " " + remoteName + " " + fjURL line := remoteName + " " + fjURL ``` If the decision was to drop branch from the output, delete those lines. **`.git`-suffix false positive in `remote show`** When the remote is a plain HTTPS URL, `configURL` and `fjURL` differ only by the `.git` suffix: ``` configURL = https://git.schlittermann.de/heiko/fj.git fjURL = https://git.schlittermann.de/heiko/fj ``` This triggers `(git: https://git.schlittermann.de/heiko/fj.git)` in the output, which is misleading — stripping `.git` is an fj implementation detail, not a meaningful URL conversion. The guard should normalise the `.git` suffix away before comparing. **Duplicate `Short` on `remoteCmd` and `remoteShowCmd`** Both read `"Show remote information"`. Suggest `"Remote information"` for the parent `remoteCmd` to match the convention of e.g. `labelCmd` ("Manage labels"). **No test for `remoteShowRun`** `remote.go` has no test coverage. A unit test for the formatting logic (similar to `TestFormatCreatedPR_IncludesRemote`) would help catch regressions. ### Minor - `Remote string` on `api.Client` is slightly leaky (git concept in HTTP layer) but acceptable given the 20+ `newClient()` call sites. - `RawURL` mirrors logic in `Detect` — small duplication, different semantics (display vs. parse), acceptable. - `formatCreated` shared helper in `root.go` is clean. ### Summary Block on: **dead commented-out code** and **`.git`-suffix false positive**. The rest is mergeable with minor polish. — 🤖 Generated with Claude Code (claude-sonnet-4-6)
heiko manually merged commit bb96c3b3ca into master 2026-05-18 20:51:30 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
heiko/fj!28
No description provided.