-
Notifications
You must be signed in to change notification settings - Fork 350
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
Import refs with filter #1326
Merged
samueltardieu
merged 5 commits into
jj-vcs:main
from
samueltardieu:import-refs-with-filter
Mar 2, 2023
Merged
Import refs with filter #1326
samueltardieu
merged 5 commits into
jj-vcs:main
from
samueltardieu:import-refs-with-filter
Mar 2, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using &[String] forces the caller to materalize owned strings if they have only references, which is costly. Using &[&str] makes it cheap if the caller owns strings as well.
samueltardieu
force-pushed
the
import-refs-with-filter
branch
from
March 1, 2023 16:36
a14e96c
to
649e431
Compare
martinvonz
reviewed
Mar 1, 2023
In `git_fetch()`, any glob present in `globs` is an "allow" mark. Using `&[]` to represent an "allow-all" may be misleading, as it could indicate that no branch (only the git HEAD) should be fetched. By using an `Option<&[&str]>`, it is clearer that `None` means that all branches are fetched.
samueltardieu
force-pushed
the
import-refs-with-filter
branch
2 times, most recently
from
March 1, 2023 22:47
61444df
to
ebc380e
Compare
martinvonz
approved these changes
Mar 2, 2023
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.
Thanks for fixing!
ilyagr
reviewed
Mar 2, 2023
Thank you so much! This looks great to me, and I'm very glad this bug is fixed. While it looks good to me, I'm not super-comfortable with this part of |
samueltardieu
force-pushed
the
import-refs-with-filter
branch
from
March 2, 2023 08:49
ebc380e
to
be46e48
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch series implements what is necessary to selectively import git references into jj. The first part was implemented by @ilyagr one week ago (avoid fetching uninteresting heads from a remote repo), and this is the second part, which also fixes some bugs:
jujutsu_lib::git::import_some_refs()
does the same thing asgit/import_refs()
but ignores all references not matched by a filter. Ignored references will never cause a branch to be added, moved, or deleted in the jj repo. We could merge the functions, but that will be a backwards incompatible change.jujutsu_lib::git::fetch()
usesimport_some_refs()
when filtering is required. A trace has been let in if at some points the regex built from the globs must be analyzed/optimized.The
CHANGELOG.md
file was not updated, asjj git fetch --branch
is the sole user-facing change and it has been documented by @ilyagr aready.Checklist
If applicable:
CHANGELOG.md
Fixes #1300