Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git: on fetch, pin visible untracked remote refs #3500

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

yuja
Copy link
Collaborator

@yuja yuja commented Apr 13, 2024

#3495

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 tests to cover my changes

Copy link
Collaborator

@emesterhazy emesterhazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but there are a few things I don't fully understand. If you could clarify I would appreciate it 🙏

lib/src/git.rs Outdated Show resolved Hide resolved
lib/src/git.rs Show resolved Hide resolved
lib/tests/test_git.rs Outdated Show resolved Hide resolved
This implements the other workaround described in 57167ce "git: on
import_refs(), don't abandon ancestors of newly fetched refs":

> I think there are two ways to fix the problem:
>  a. pin non-tracking remote branches just like local refs
>  b. pin newly fetched refs in addition to local refs
> This patch implements (b) because it's simpler and more obvious that the
> fetched commits would never be abandoned immediately.

The idea of (a) is that untracked remote branches are independent read-only
refs, and read-only branches shouldn't be rewritten implicitly. Once the
branch gets rewritten or abandoned by user, these remote refs will be hidden,
and won't be pinned anymore.

Since (a) effectively supersedes (b), this patch also removes the original
workaround.

Fixes martinvonz#3495
@yuja yuja merged commit aaa2025 into martinvonz:main Apr 14, 2024
16 checks passed
@yuja yuja deleted the push-nszkuvxusnwl branch April 14, 2024 02:38
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