Skip to content

fix: prune deleted remotes during git import#9175

Open
cormacrelf wants to merge 1 commit intomainfrom
prune-deleted-remotes
Open

fix: prune deleted remotes during git import#9175
cormacrelf wants to merge 1 commit intomainfrom
prune-deleted-remotes

Conversation

@cormacrelf
Copy link
Copy Markdown

I only noticed this issue when I accidentally used git remote remove xxx, a typo where the jj got lost. I kept trying to track branches and then finding myself unable to push them because JJ kept creating remote-tracking branches for @xxx as well, and jj git remote list was not showing xxx. I guess it's a separate bug that jj git remote list does not list jj's actual list of remote views... but at least we can prune them.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added/updated tests to cover my changes
  • I fully understand the code that I am submitting (what it does,
    how it works, how it's organized), including any code drafted by an LLM.
  • For any prose generated by an LLM, I have proof-read and copy-edited with
    an eye towards deleting anything that is irrelevant, clarifying anything
    that is confusing, and adding details that are relevant. This includes,
    for example, commit descriptions, PR descriptions, and code comments.

@cormacrelf cormacrelf requested a review from a team as a code owner March 23, 2026 23:50
@cormacrelf cormacrelf force-pushed the prune-deleted-remotes branch 3 times, most recently from 695c376 to bb4b84e Compare March 24, 2026 00:02
We had the ability to import externally added git remotes (git remote add xxx ...)
but not the ability to delete them from our view of the repo when they were
removed from the git config.

This prunes them in much the same way.
@cormacrelf cormacrelf force-pushed the prune-deleted-remotes branch from bb4b84e to ff06f0f Compare March 24, 2026 00:10
@yuja
Copy link
Copy Markdown
Contributor

yuja commented Mar 24, 2026

I think it's better to add a command (or flag) to remove remotes after the fact. #7143

Deleting an empty remote view should be harmless, but it's odd that absent tracking can also be discarded implicitly.

@PhilipMetzger
Copy link
Copy Markdown
Contributor

if you read our contributing guidelines you should know that we don't allow fix: for titles except for the apty named command, so please change it to something like git:

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.

3 participants