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-repository/gix towards 1.0 #470

Open
16 of 58 tasks
Byron opened this issue Jul 26, 2022 · 0 comments
Open
16 of 58 tasks

git-repository/gix towards 1.0 #470

Byron opened this issue Jul 26, 2022 · 0 comments
Labels
C-tracking-issue An issue to track to track the progress of multiple PRs or issues

Comments

@Byron
Copy link
Owner

Byron commented Jul 26, 2022

A probably incomplete collection of features we still want to see in git-repository before it can possibly see a first stable release.

initialization

  • make it easy to change configuration during discovery into something restrictive, accommodating starship and helix-editor.

Diff

Submodules

Lock

  • a configurable option to emit traces in case somebody is blocked on a lock for too long.

Pathspecs

Protocol

  • remove duplicate parts of the fetch implementation, as well as Delegates as much as possible.

Remotes

An abstractions to list them and learn about which branches interact.

  • list remotes
  • anonymous remotes
  • fetch refs and build ref-map
    • optimization: don't list refs if all refspecs denote objects by hash (git implements this)
  • save to configuration in memory
  • authentication function should be configured per passed URL, which needs rewriting too (on demand). This is relevant for redirects where a new URL is passed that currently doesn't trigger rewrites nor finding the correct credential helper.
  • fast connectivity validation of objects in received pack, see c6807a4 in git for all the details
  • save to configuration on disk
  • respect fetch.unpackLimit - important as it helps keeping repos usable, probably good along with a way to build bigger packs from X loose objects.
  • option to turn off fast-forward checks for forced refs (this is to speed up typical API usage where the information isn't used anyway)
  • consecutive fetch negotiation algorithm (the default in git)
  • FETCHHEAD updates
  • an easy way to find the local tracking branch of any reference (also called upstream branch now)
  • respect remote configuration
    • tagOpt (autotags or tag-following, "include-tag" as arg for 'fetch' command (and is the reason that git pulls tags by default if they are pointing to commits that are fetched).
      • This also affects clone as we should allow this option to be configured.
      • V1 'include-tag' support - needs another fetch round, or maybe rather not implement it or just fetch all tags? V1 doesn't have include-tag I think so one will have to fetch the refs and when commits are there, we traverse the commits received to match them with tags we know. Then we fetch these tag objects if they are annotated tags, and create tags in any way.
    • prune refs - be aware that there are side-effects between --tags and --prune, so probably this is more than just a boolean to make desired effects explicit.
    • Maintenance
      • ideally, make this available as object that can be executed by the user, potentially queuing other maintenance operations as well so users can execute them on a separate thread. It should just be a list of tasks, which can be executed once a repo is provided.
      • explode smaller packs into loose objects automatically (see fetch.unpackLimit). Having this is really important to avoid running out of ODB slots for packs in long-running applications that fetch a lot during their runtime.
    • support for anonymous remotes (to be (re-)configured by owner)
  • http transport configuration (auto-configure based on git-config)
    • custom headers for http transports via extra.headers
    • http.followRedirect and override
    • http proxy settings
    • complex http..* based option overrides
  • access to remote groups and a way to fetch them?
  • merge configuration in bare repos - it probably should update the respective branch if checked out.

Questions

What about auto-tags? Maybe if enabled, we will automatically add a ref-prefix to receive tag information, and then auto-create annotated tags according to the typical refspec?

Should we generally only provide options for values that are not in the git-config? Probably… It's easy enough to use config_snapshot_mut() and can be a general directive that leverages git configuration docs.
However, it must be possible to set these settings in bulk in case of anonymous remotes, but separated by transport config and remote config.

Outscoped

Decide what's needed of these, if any, and keep track of them.

  • proxy support
  • mirror support
  • All information related to pushing
  • promisor objects
  • branch.<name>.merge support, as we don't yet merge anything and fetching still fetches the entire refspec of as configured in the remote.

rev-walk

  • add tips by iterator
  • add rev-specs (basically includes and excludes in one)
  • add commits for exclusion

git-revision

  • a graph type to implement describe() with
  • calculate the merge base of commits using a ref-spec maybe
  • support the commit-graph (see this explanation for details)

Cloning

  • recursive submodule checkout
  • worktree checkout
    • apply standard filters
    • run filter programs
      • with both one-off and long-running protocols
  • directory to clone into is specified so that it can be adjusted based on the final (potentially redirected) url if this is what git does (to be validated). In any case, implement it correctly and so that everybody can use it (probably the logic should go into a re-usable function or method) or use an enum for the directory instead.
  • support --mirror option (see this comment for initial analysis)

Out of scope

  • local-clone options (i.e. copy ODB files directly, hard-link, symlink, alternates)

rev-parse

  • Support for main@{push} handling, which depends on properly resolving push.default
  • Support for main@{upstream} which needs fiddling with ref-specs for remotes
  • Support for reflog access by date, depends on gix-date towards 1.0 #471 .
  • @: empty - paths should yield the tree, and not an error that says "" could not be found

Config

  • add config() which assures the returned snapshot is up-to-date. Metadata allows to remove outdated files and replace them with their updated counterparts. Includes can be detected and re-resolved (but that needs configuration), and the cache needs to be updated afterwards too. There is definitely some details to consider, but it's possible.
  • config_mut() to take a lock file at the repository local configuration, collecting changes in memory and writing only those back to disk on drop, or when commit() is called similar to SnapshotMut. Sister-method config_mut_at() to chose a particular file for writing given a path. Assume that config() will pick it up when called again, and it has to be as _mut() need a mutable Repository to use Rust semantics to protect against surprises.
  • use configuration trust of returned value and warn on invalid value if untrusted, abort otherwise. That way, invalid configuration can't be preventing us from coming up. Make sure this is configurable so it's part of the trust map. (lenient configuration)
  • review all gix progress environment variables and implement as many as feasible.
  • Add open::Option parameter to allow parsing the GIT_CONFIG_PARAMETERS environment variable which is a way of storing -c flags in git. Useful when implementing remote-helpers and probably hooks as well (or any program that git runs. Consider reviewing the git-command as it could reasonably pass API and CLI overrides that way as well.

Build

  • fine-grained control over dependencies, with switches for
    • worktree
    • only initialization, nothing else (for tokei tests)
@Byron Byron added the C-tracking-issue An issue to track to track the progress of multiple PRs or issues label Jul 26, 2022
@Byron Byron changed the title git-repository towards 1.0 git-repository towards 1.0 Jul 26, 2022
@Byron Byron added this to Journeys in Collaboration Board Jul 27, 2022
Byron added a commit that referenced this issue Sep 19, 2022
Byron added a commit that referenced this issue Sep 19, 2022
Byron added a commit that referenced this issue Sep 19, 2022
Byron added a commit that referenced this issue Sep 19, 2022
Byron added a commit that referenced this issue Sep 19, 2022
Byron added a commit that referenced this issue Sep 19, 2022
Byron added a commit that referenced this issue Sep 19, 2022
Byron added a commit that referenced this issue Sep 19, 2022
…#470)

Even though the empty-tree object can be found when searched via
`Repository::find_object()`, previously it was not locatable when
used during rev-spec parsing.
Byron added a commit that referenced this issue Sep 19, 2022
Byron added a commit that referenced this issue Sep 19, 2022
Byron added a commit that referenced this issue Sep 19, 2022
…e. (#470)

This is a first and maybe the last step towards providing diffing
functionality, and it seems like the right choice to keep this in
similar and contribute there as needed. All algorithms are well
described and thus shouldn't be git-specific per-se, and `similar`
is the best the community has to offer.
Byron added a commit that referenced this issue Sep 19, 2022
…mmit ancestor iteration. (#470)

This is useful to avoid additional lookups of the same object for
reading additional data from it.

Currently one needs an object cache to avoid duplciate object extraction
work, with such a cache being slower than accessing the same buffer
again.
Byron added a commit that referenced this issue Sep 19, 2022
…ut consumption. (#470)

This is useful if these provide additional out-of-band information.
Byron added a commit that referenced this issue Sep 19, 2022
…thor. (#470)

Note that these are expensive and unconditionally use threads to speed
up these computations.
Byron added a commit that referenced this issue Sep 20, 2022
This allows path conversions there to be just as efficient as on unix.

This was adopted from [a PR in the
hexlix-editor](https://github.com/helix-editor/helix/pull/3890/files#diff-504515b66023120e75a921cd56a932aed76c0ff62593fbb69d92e0ef65089501R47).
Byron added a commit that referenced this issue Sep 20, 2022
Byron added a commit that referenced this issue Sep 20, 2022
The disadvantage of doing that is that we copy the name, which
allocates, instead of just returning it by reference.
Byron added a commit that referenced this issue Sep 20, 2022
Byron added a commit that referenced this issue Sep 20, 2022
It's very common to try to work with trees, so let's make that easier.
Byron added a commit that referenced this issue Sep 20, 2022
But for some reason, the counter stays at 0 despite sharing the counter
stat.
Byron added a commit that referenced this issue Sep 20, 2022
Finally, issues due to bugs in prodash.
Byron added a commit that referenced this issue Sep 20, 2022
Even though failing is cheap, it's not free and can be done a million
times.
Byron added a commit that referenced this issue Sep 20, 2022
…line-stats`. (#470)

That way more information is generated at increasingly high costs.
Byron added a commit that referenced this issue Sep 20, 2022
Byron added a commit that referenced this issue Sep 20, 2022
Byron added a commit that referenced this issue Sep 20, 2022
Byron added a commit that referenced this issue Sep 20, 2022
…). (#470)

We assume unguessable ones are a plain text file, like one without
extension.
Byron added a commit that referenced this issue Sep 20, 2022
Byron added a commit that referenced this issue Sep 20, 2022
@Byron Byron changed the title git-repository towards 1.0 git-repository/gix towards 1.0 Aug 7, 2023
@Byron Byron pinned this issue Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue An issue to track to track the progress of multiple PRs or issues
Projects
Development

No branches or pull requests

1 participant