Skip to content

Conversation

@layou233
Copy link
Contributor

This is based on codes and talks in #1644. This PR makes the NEU manager use fetch --depth 1 to update the remote ref and then hard reset the local branch to it. Auto stash is also introduced to preserve the old feature of keeping local changes, like smart checkout in some IDEs.

pros:

  • Extend shallow state to every commit. The repo will always have only 1 shallow commit after updates.
  • Enhanced error resistantance (for remote force-push, etc.)

cons:

  • More Git operations needed for updating repo.
  • Logs in .git/shallow will grow and not be truncated (see Do shallow clone for NEU repo #1644 (comment))
  • The benefit of shallowing new commits may not be as obvious as cloning, because only a small number of commits are updated at a time, and the old contents are still stored compressed in .git/objects/pack as the requirement of incremental update.

So it's also ok if we ain't gonna merge this. 👌

@LifeIsAParadox LifeIsAParadox added the reviews needed This PR needs reviews label Sep 13, 2025
@Alex33856 Alex33856 added merge conflicts This PR has merge conflicts that need solving. and removed reviews needed This PR needs reviews labels Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflicts This PR has merge conflicts that need solving.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants