Revert skipFetchAll Stamping Logic · Entire
The change in URL Handling
The change in the GitHub pull request marks all remotes with a full URL as skipFetchAll. The intention here is to revert that and ensure that every time a new remote is created, we set that value to avoid changing user settings and keep adhoc remotes from cluttering user git configs.
Implementation Details
To clarify my approach, I have been exploring where the CLI creates remotes. In the production code paths I've checked, filtered fetches target a bare URL, and git implicitly logs the remote.<URL>.promisor section — there's typically no explicit invocation of git remote add. If a specific remote-creation site is of concern (e.g., in the git remote-entire helper, during checkpoint setup, or elsewhere), it should be addressed.
Changes Made
remote/git.go- Removed the previous behavior where
markPromisorEntrySkippedread theremote.<url>.promisorand re-stampedskipFetchAll/skipDefaultUpdatefor all filtered fetches, as it marked remotes with a full URL. This was reverted to only consider newly established remotes. - Added the
gitRemoteSectionExistsfunction to check existence ofremote.<url>.*sections prior to fetch. - Introduced
markRemoteSkipped, which sets theskipFetchAllwithout conducting promisor checks. - Now,
Fetch()only applies the stamps when the remote was newly created and had not existed previously.
- Removed the previous behavior where
git_test.go- Renamed the new remote test, ensuring pre-existing URL remotes remain untouched.
- Verified the functionality for existing remotes with new test cases.
Key Decisions
- The logic for filtered fetches is retained, as an unfiltered URL fetch will lead to no recording of a
remote.<url>section, thus avoiding unnecessary clutter from stamping.
Verified Changes
Following the changes, I have confirmed that pre-existing remote configurations remain intact, thus aligning with your aim to avoid rewriting user settings. All tests, including format and lint checks, have successfully passed.