https://github.com/twitter/focus
Focus aligns Git worktree content based on outlines of a repository's Bazel build graph. Focused repos are sparse, shallow, and thin and unlock markedly better performance in large repos.
https://github.com/twitter/focus
bazel git source-control sparse-checkout
Last synced: 3 months ago
JSON representation
Focus aligns Git worktree content based on outlines of a repository's Bazel build graph. Focused repos are sparse, shallow, and thin and unlock markedly better performance in large repos.
- Host: GitHub
- URL: https://github.com/twitter/focus
- Owner: twitter
- License: apache-2.0
- Created: 2022-08-30T03:21:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-12T12:23:02.000Z (over 2 years ago)
- Last Synced: 2024-05-09T19:35:22.158Z (over 1 year ago)
- Topics: bazel, git, source-control, sparse-checkout
- Language: Rust
- Homepage:
- Size: 2.03 MB
- Stars: 91
- Watchers: 6
- Forks: 27
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Focused Development
`focus` is a tool to manage [Git sparse checkouts](https://github.blog/2020-01-17-bring-your-monorepo-down-to-size-with-sparse-checkout/) derived from the [Bazel](https://bazel.build/) build graph.
# Installation
`focus` is written in [Rust](https://www.rust-lang.org/) and supports macOS and Linux. Git v2.35+ and Bazel need to be installed in the PATH env. General
## MacOS Prerequisites
[Install Bazel](https://bazel.build/install/os-x)[Install Git > 2.35](https://formulae.brew.sh/formula/git)
*Warning*: If you run a `cargo test` you may run out of file descriptors. On MacOS you will need to use `ulimit -n X` to set a large file limit for the current shell. On macOS Big Sur, you can write a plist to do this permanently:
Write the following to a file named `/Library/LaunchDaemons/limit.maxfiles.plist` (_hint: you'll need to invoke your editor with `sudo` because this file is protected_):
```
Label
limit.maxfiles
ProgramArguments
sudo
launchctl
limit
maxfiles
655360
1048576
RunAtLoad
```
then load it with `sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist`. This seems to work better if you restart your Mac.Note: these instructions are from a GitHub issue https://github.com/gradle/gradle/issues/17274. Thanks to those folks.
## Linux Prerequisites
*Install Git*: Git 2.35+: get this through your distro's package manager or [download pre-built binaries or sources here](https://git-scm.com/downloads).
*Install Bazel*: You'll need Bazel installed. See [these instructions](https://bazel.build/install/) for details on how to install on mainstream Linux distros. Alternative distros probably have a reasonable Bazel package available by now.
## Common
[Install Rust](https://rustup.rs/), then install `focus` with```
$ cargo install --locked --git https://github.com/twitter/focus
```# Usage
If you are the repository administrator, first configure `focus` for your repo using the [Administration](focus/doc/administration.md) instructions.
For end-users, see [Usage](focus/doc/usage.md) for instructions on how to use `focus` to manage your sparse checkouts.
For new or curious users, see [Bazel Tutorial](focus/doc/bazel_tutorial.md) for instructions on how to try `focus` on the [bazel repository](https://github.com/bazelbuild/bazel) itself.
# Design
See various design documents at https://github.com/twitter/focus/tree/main/focus/doc. Focus was presented at [Git Merge 2022](https://git-merge.com/); [see the slides here](https://docs.google.com/presentation/d/12RVWPIms-rFKfteqYa5bpSWElIiJ1oCAYobLb5DihQo/edit?usp=sharing).