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

gix feature toggles #1010

Merged
merged 23 commits into from
Sep 8, 2023
Merged

gix feature toggles #1010

merged 23 commits into from
Sep 8, 2023

Conversation

Byron
Copy link
Owner

@Byron Byron commented Sep 6, 2023

Based on #1008 .

Implement a proper worktree reset, eventually leading to a high-level reset similar to how git supports it.

Facilitate compile time reduction

  • split gix-pack data-io off using feature toggles
  • Add gix feature toggles: remote-connection, blob-diff, revision, attributes, mailmap, regex
  • make gix-prompt and gix-credentials depend on one of the transport features
  • check gix-index and others - some might be easily put behind feature toggles
  • security: assure we don't read outside of the repository when refs are ../../../. Further, assure that we don't write such refs when receiving them from the server.

Tasks

  • upgrade to
  • worktree reset to match new index, with or without safety checks to prevent overwriting modified files or untracked files.
  • figure out how this relates to the current checkout() method as technically that's a reset --hard with optional overwrite check. Could it be rolled into one, with pathspec support added?
  • TBD

Postponed

What follows is important for resets, but won't be needed for cargo worktree resets.

  • insert entry into index
  • traverse tree with pathspec matching and insert entry into index.

Research

  • How to integrate submodules
  • How to deal with various modes like merge and keep? How to control refresh?
  • Worthwhile to make explicit the difference between git reset and git checkout in terms of HEAD modifications. With the former changing HEADs referent, and the latter changing HEAD itself.

…ndex

This doesn't happen here though, so nothing special we could trigger.
That way, it's possible to not compile a bunch of code in `gix` if
the writing of packs isn't required.
This should make optimizing compile time and performance easier, while
assuring these options aren't pre-determined by library providers.
This also removes all diff capabilities.
That way users can more precisely decide what they want to use.
Note that spec-parsing is so foundational that it's always included.
Those who don't need it nor need describe don't need the crate in the
fist place.
`revparse-regex` is only used when parsing revspecs that use a special syntax.
This feature is also enabled by default.
@Byron Byron force-pushed the reset branch 5 times, most recently from af00322 to 8c56076 Compare September 8, 2023 11:58
@Byron Byron force-pushed the reset branch 2 times, most recently from f973319 to e49da62 Compare September 8, 2023 12:21
Even though there is a chance that overall, it will compile multiple
different versions of the same thing so it's not actually faster.

But let's not think too much about that.
@Byron Byron merged commit 6135a5e into main Sep 8, 2023
18 checks passed
@Byron Byron deleted the reset branch September 8, 2023 16:58
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.

1 participant