Skip to content

odb: track commit graphs via object source

Patrick Steinhardt git 1 version In review

Get series with b4
b4 am [email protected] change-id 20250904-b4-pks-commit-graph-via-source-b4e1a1edd214

Versions newest first

  1. v1 Latest6 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6blame: drop explicit check for commit graphblame.c+0 -31 reply
2/6revision: drop explicit check for commit graphrevision.c+0 -31 reply
3/6commit-graph: return the prepared commit graph from `prepare_commit_graph()`commit-graph.c+32 -501 reply
4/6commit-graph: return commit graph from `repo_find_commit_pos_in_graph()`bloom.c commit-graph.c commit-graph.h+23 -151 reply
5/6commit-graph: pass graphs that are to be merged as parametercommit-graph.c+10 -80 replies
6/6odb: move commit-graph into the object sourcescommit-graph.c commit-graph.h odb.c +2 more+56 -291 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] odb: track commit graphs via object source

Hi,

commit graphs are currently stored on the object database level. This doesn't really make much sense conceptually, given that commit graphs are specific to one object source. Furthermore, with the upcoming pluggable object database effort, an object source's backend may not evene have a commit graph in the first place but store that information in a different format altogether.

This patch series prepares for that by moving the commit graph from struct object_database into struct odb_source.

There's a trivial conflict with tc/last-modified that can be solved like this:

commit-graph.c +0 -0
diff --cc commit-graph.c
index 9929c1ed87,2f20f66cfd..0000000000
@@@ -823,7 -812,12 +823,11 @@@ int corrected_commit_dates_enabled(stru
  
  struct bloom_filter_settings *get_bloom_filter_settings(struct repository *r)
  {
 -	struct commit_graph *g;
 +	struct commit_graph *g = prepare_commit_graph(r);
+ 
 -	if (!prepare_commit_graph(r))
++	if (!g)
+ 	       return NULL;
+ 
 -	g = r->objects->commit_graph;
  	while (g) {
  		if (g->bloom_filter_settings)
  			return g->bloom_filter_settings;

Thanks!

Patrick

---
Patrick Steinhardt (6):
blame: drop explicit check for commit graph
revision: drop explicit check for commit graph
commit-graph: return the prepared commit graph from prepare_commit_graph()
commit-graph: return commit graph from repo_find_commit_pos_in_graph()
commit-graph: pass graphs that are to be merged as parameter
odb: move commit-graph into the object sources

 blame.c        |   3 -
 bloom.c        |   8 ++-
 commit-graph.c | 177 +++++++++++++++++++++++++++++++--------------------------
 commit-graph.h |  14 ++---
 odb.c          |   9 +--
 odb.h          |   6 +-
 packfile.c     |   3 +-
 revision.c     |   3 -
 8 files changed, 118 insertions(+), 105 deletions(-)

---
base-commit: 2462961280690837670d997bde64bd4ebf8ae66d
change-id: 20250904-b4-pks-commit-graph-via-source-b4e1a1edd214