Thanks to visit codestin.com
Credit goes to github.com

Skip to content

support git 2.19's commit-graph #5757

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

Open
7 of 8 tasks
lhchavez opened this issue Jan 4, 2021 · 0 comments
Open
7 of 8 tasks

support git 2.19's commit-graph #5757

lhchavez opened this issue Jan 4, 2021 · 0 comments

Comments

@lhchavez
Copy link
Contributor

lhchavez commented Jan 4, 2021

Starting from version 2.19, git supports commit-graph, which allows for some significant improvements in the performance of several graph-based operations. Notably computing the merge base between two (or more) commits and determining whether one commit is ahead/behind of another.

This should be relatively straightforward to implement. Similar to #5399, this can be split into several chunks for ease of reviewing:

Relevant documentation:

lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 6, 2021
This change is the first in a series to add support for git's
commit-graph. This should speed up commit graph traversals by avoiding
object parsing and allowing some operations to terminate earlier.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 6, 2021
This change is the first in a series to add support for git's
commit-graph. This should speed up commit graph traversals by avoiding
object parsing and allowing some operations to terminate earlier.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change is the first in a series to add support for git's
commit-graph. This should speed up commit graph traversals by avoiding
object parsing and allowing some operations to terminate earlier.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change introduces `git_commit_graph_entry_find()` and
`git_commit_graph_entry_parent()`. These two functions allow a much
faster lookup of commits by ID, since the ODB does not need to be
consulted, the commit object does not need to be inflated, and the
contents of the commit object do not need to be parsed.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change introduces a function that allows the caller to know whether
the `commit-graph` file has not been modified since it was parsed.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change makes revwalks a bit faster by using the `commit-graph` file
(if present). This is thanks to the `commit-graph` allow much faster
parsing of the commit information by requiring near-zero I/O (aside from
reading a few dozen bytes off of a `mmap(2)`-ed file) for each commit,
instead of having to read the ODB, inflate the commit, and parse it.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change makes calculations of merge-bases a bit faster when there
are complex graphs and the commit times cause visiting nodes multiple
times. This is done by visiting the nodes in the graph in reverse
generation order when the generation number is available instead of
commit timestamp. If the generation number is missing in any pair of
commits, it can safely fall back to the old heuristic with no negative
side-effects.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 7, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 8, 2021
This change is the first in a series to add support for git's
commit-graph. This should speed up commit graph traversals by avoiding
object parsing and allowing some operations to terminate earlier.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 8, 2021
This change introduces `git_commit_graph_entry_find()` and
`git_commit_graph_entry_parent()`. These two functions allow a much
faster lookup of commits by ID, since the ODB does not need to be
consulted, the commit object does not need to be inflated, and the
contents of the commit object do not need to be parsed.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 8, 2021
This change introduces a function that allows the caller to know whether
the `commit-graph` file has not been modified since it was parsed.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 8, 2021
This change makes revwalks a bit faster by using the `commit-graph` file
(if present). This is thanks to the `commit-graph` allow much faster
parsing of the commit information by requiring near-zero I/O (aside from
reading a few dozen bytes off of a `mmap(2)`-ed file) for each commit,
instead of having to read the ODB, inflate the commit, and parse it.

This is done by modifying `git_commit_list_parse()` and letting it use
the ODB-owned commit-graph file.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 8, 2021
This change makes calculations of merge-bases a bit faster when there
are complex graphs and the commit times cause visiting nodes multiple
times. This is done by visiting the nodes in the graph in reverse
generation order when the generation number is available instead of
commit timestamp. If the generation number is missing in any pair of
commits, it can safely fall back to the old heuristic with no negative
side-effects.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 8, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 8, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 10, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 10, 2021
This change adds the git_commit_graph_writer_* functions to allow to
write and create `commit-graph` files from `.idx`/`.pack` files or
`git_revwalk`s.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 10, 2021
This change adds the git_commit_graph_writer_* functions to allow to
write and create `commit-graph` files from `.idx`/`.pack` files or
`git_revwalk`s.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 10, 2021
This change adds the git_commit_graph_writer_* functions to allow to
write and create `commit-graph` files from `.idx`/`.pack` files or
`git_revwalk`s.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jan 11, 2021
This change adds the git_commit_graph_writer_* functions to allow to
write and create `commit-graph` files from `.idx`/`.pack` files or
`git_revwalk`s.

Part of: libgit2#5757
ethomson pushed a commit that referenced this issue Feb 1, 2021
This change is the first in a series to add support for git's
commit-graph. This should speed up commit graph traversals by avoiding
object parsing and allowing some operations to terminate earlier.

Part of: #5757
ethomson pushed a commit that referenced this issue Mar 4, 2021
This change introduces `git_commit_graph_entry_find()` and
`git_commit_graph_entry_parent()`. These two functions allow a much
faster lookup of commits by ID, since the ODB does not need to be
consulted, the commit object does not need to be inflated, and the
contents of the commit object do not need to be parsed.

Part of: #5757
ethomson pushed a commit that referenced this issue Mar 4, 2021
This change introduces a function that allows the caller to know whether
the `commit-graph` file has not been modified since it was parsed.

Part of: #5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Mar 10, 2021
This change makes revwalks a bit faster by using the `commit-graph` file
(if present). This is thanks to the `commit-graph` allow much faster
parsing of the commit information by requiring near-zero I/O (aside from
reading a few dozen bytes off of a `mmap(2)`-ed file) for each commit,
instead of having to read the ODB, inflate the commit, and parse it.

This is done by modifying `git_commit_list_parse()` and letting it use
the ODB-owned commit-graph file.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Mar 11, 2021
This change adds the git_commit_graph_writer_* functions to allow to
write and create `commit-graph` files from `.idx`/`.pack` files or
`git_revwalk`s.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jul 27, 2021
This change makes calculations of merge-bases a bit faster when there
are complex graphs and the commit times cause visiting nodes multiple
times. This is done by visiting the nodes in the graph in reverse
generation order when the generation number is available instead of
commit timestamp. If the generation number is missing in any pair of
commits, it can safely fall back to the old heuristic with no negative
side-effects.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jul 27, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jul 27, 2021
This change adds the git_commit_graph_writer_* functions to allow to
write and create `commit-graph` files from `.idx`/`.pack` files or
`git_revwalk`s.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jul 27, 2021
This change adds the git_commit_graph_writer_* functions to allow to
write and create `commit-graph` files from `.idx`/`.pack` files or
`git_revwalk`s.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jul 27, 2021
This change introduces a new API function
`git_graph_reachable_from_any()`, that answers the question whether a
commit is reachable from any of the provided commits through following
parent edges.

This function can take advantage of optimizations provided by the
existence of a `commit-graph` file, since it makes it faster to know
whether, given two commits X and Y, X cannot possibly be an reachable
from Y.

Part of: libgit2#5757
lhchavez added a commit to lhchavez/libgit2 that referenced this issue Jul 27, 2021
This change adds the git_commit_graph_writer_* functions to allow to
write and create `commit-graph` files from `.idx`/`.pack` files or
`git_revwalk`s.

Part of: libgit2#5757
personalizedrefrigerator pushed a commit to personalizedrefrigerator/libgit2 that referenced this issue Jul 30, 2021
This change introduces `git_commit_graph_entry_find()` and
`git_commit_graph_entry_parent()`. These two functions allow a much
faster lookup of commits by ID, since the ODB does not need to be
consulted, the commit object does not need to be inflated, and the
contents of the commit object do not need to be parsed.

Part of: libgit2#5757
personalizedrefrigerator pushed a commit to personalizedrefrigerator/libgit2 that referenced this issue Jul 30, 2021
This change introduces a function that allows the caller to know whether
the `commit-graph` file has not been modified since it was parsed.

Part of: libgit2#5757
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

No branches or pull requests

1 participant