-
Notifications
You must be signed in to change notification settings - Fork 285
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
✨(clone): set publicheads to remote HEAD when cloning #607
Conversation
Summary: c8b66c6 added support for cloning the remote git repo's HEAD (in this case `develop`), instead of main/master by default. However, this doesn't mark `remote/develop` and its ancestors as public commits. This commit will also set remote git repo's HEAD as a public commit Closes facebook#600 Pull Request resolved: facebook#607 Test Plan: - Added test `test-git-clone-sets-publicheads.t`
Summary: c8b66c6 added support for cloning the remote git repo's HEAD (in this case `develop`), instead of main/master by default. However, this doesn't mark `remote/develop` and its ancestors as public commits. This commit will also set remote git repo's HEAD as a public commit Closes facebook#600 Pull Request resolved: facebook#607 Test Plan: - Added test `test-git-clone-sets-publicheads.t`
question for reviewer: should I add
If a repo sets its default branch to However, upon further inspection I might be wrong. Maybe I don't need to re-add Steps to reproduce:
❯ sl hide remote/master
abort: cannot hide immutable commit: 1b4babc6843b
(see 'sl help phases' for details) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing it, looks goods to me!
I just had some minor suggestions
eden/scm/edenscm/git.py
Outdated
rcutil.editconfig(repo.ui, | ||
repo.localvfs.join(configfilename), | ||
'remotenames', 'publicheads', | ||
all_publicheads) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could you move this logic into a separate function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think? I added a function update_and_persist_repo_config
in rcutil
, but maybe it would be better to add a method to localrepository
so this line would become
repo.update_and_persist_config(`remotenames`, `publicheads`, all_publicheads)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and did it. Please see the latest version of this PR.
(If you want to see what I did before, check Version 4 in ReviewStack https://reviewstack.dev/facebook/sapling/pull/607)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer keep it in git.py
, but I don't think it should be a blocker for this PR. I am importing it now.
You need to use |
Hi @vegerot, just wondering if you plan to update this PR to fix those small comments? it would be great if we can include in the next release. If you don't have time, I can also import this PR and fix them. |
@zzl0 most of my free time is on the weekends. When's the cutoff for the next Sapling release? |
@vegerot there is no exact cutoff date, our next release schedule is next week. With that said, it's not urgent, take your time. I just wanted to check if it's on your plan. |
@zzl0 thanks! I'll probably do it this weekend. If not, feel free to import and patch this |
Summary: c8b66c6 added support for cloning the remote git repo's HEAD (in this case `develop`), instead of main/master by default. However, this doesn't mark `remote/develop` and its ancestors as public commits. This commit will also set remote git repo's HEAD as a public commit Closes facebook#600 Pull Request resolved: facebook#607 Test Plan: - Added test `test-git-clone-sets-publicheads.t`
Summary: c8b66c6 added support for cloning the remote git repo's HEAD (in this case `develop`), instead of main/master by default. However, this doesn't mark `remote/develop` and its ancestors as public commits. This commit will also set remote git repo's HEAD as a public commit Closes facebook#600 Pull Request resolved: facebook#607 Test Plan: - Added test `test-git-clone-sets-publicheads.t`
Summary: c8b66c6 added support for cloning the remote git repo's HEAD (in this case `develop`), instead of main/master by default. However, this doesn't mark `remote/develop` and its ancestors as public commits. This commit will also set remote git repo's HEAD as a public commit Closes facebook#600 Pull Request resolved: facebook#607 Test Plan: - Added test `test-git-clone-sets-publicheads.t`
Summary: c8b66c6 added support for cloning the remote git repo's HEAD (in this case `develop`), instead of main/master by default. However, this doesn't mark `remote/develop` and its ancestors as public commits. This commit will also set remote git repo's HEAD as a public commit Closes facebook#600 Pull Request resolved: facebook#607 Test Plan: - Added test `test-git-clone-sets-publicheads.t`
@zzl0 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
✨(clone): set publicheads to remote HEAD when cloning
Summary:
c8b66c6 added support for cloning the remote git repo's HEAD (in this
case
develop
), instead of main/master by default.However, this doesn't mark
remote/develop
and its ancestors as publiccommits.
This commit will also set remote git repo's HEAD as a public commit
Closes #600
Pull Request resolved: #607
Test Plan:
test-git-clone-sets-publicheads.t