-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Populate the DAG on git branchless init
#308
Labels
Comments
2 tasks
melko
added a commit
to melko/git-branchless
that referenced
this issue
Nov 22, 2022
DAG initialization can be quite slow for big repos, so first execution of a command can take some time because of this. Populate DAG during init to speedup subsequent commands execution. Fix arxanas#308
melko
added a commit
to melko/git-branchless
that referenced
this issue
Nov 22, 2022
DAG initialization can be quite slow for big repos, so first execution of a command can take some time because of this. Populate DAG during init to speedup subsequent commands execution. Fix arxanas#308
melko
added a commit
to melko/git-branchless
that referenced
this issue
Nov 26, 2022
DAG initialization can be quite slow for big repos, so first execution of a command can take some time because of this. Populate DAG during init to speedup subsequent commands execution. Fix arxanas#308
arxanas
added a commit
that referenced
this issue
Nov 29, 2022
DAG initialization can be quite slow for big repos, so first execution of a command can take some time because of this. Populate DAG during init to speedup subsequent commands execution. Fix #308 Co-authored-by: Waleed Khan <me@waleedkhan.name>
arxanas
added a commit
that referenced
this issue
Dec 1, 2022
DAG initialization can be quite slow for big repos, so first execution of a command can take some time because of this. Populate DAG during init to speedup subsequent commands execution. Fix #308 Co-authored-by: Waleed Khan <me@waleedkhan.name>
arxanas
added a commit
that referenced
this issue
Dec 1, 2022
DAG initialization can be quite slow for big repos, so first execution of a command can take some time because of this. Populate DAG during init to speedup subsequent commands execution. Fix #308 Co-authored-by: Waleed Khan <me@waleedkhan.name>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you run
git branchless init
and thengit smartlog
in a big repository like https://github.com/mozilla/gecko-dev, it takes ~20 seconds to build the initial internal DAG. It would be best to do this during theinit
step, since that's the time you would expect any heavy-lifting operations to be carried out.We just need to add a call to sync the DAG in the
init
function here:git-branchless/src/commands/init.rs
Lines 550 to 556 in 45ace45
The call is to
Dag::open_and_sync
, and looks like this:git-branchless/src/commands/restack.rs
Lines 242 to 251 in 45ace45
To test this:
mozilla/gecko-dev
locally.rm -r /path/to/gecko-dev/.git/branchless/dag/
cargo run -- -C /path/to/gecko-dev init
and confirm that it produces a progress meter like this:and that it terminates after a few seconds.
It would also be cool if you could make the message say "Initializing commit graph" instead of "Updating commit graph" if this is the first time the DAG is being initialized, but it's not important. (That would be a more involved change.)
The text was updated successfully, but these errors were encountered: