git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/6] commit-graph: use 'struct object_directory *' everywhere
@ 2020-01-30 23:00 Taylor Blau
  2020-01-30 23:00 ` [PATCH 1/6] t5318: don't pass non-object directory to '--object-dir' Taylor Blau
                   ` (7 more replies)
  0 siblings, 8 replies; 28+ messages in thread
From: Taylor Blau @ 2020-01-30 23:00 UTC (permalink / raw)
  To: git; +Cc: peff, dstolee, gitster

Hi,

While working on deploying layered commit-graphs at GitHub, I noticed
that I was able to trigger the mechanism to prevent merging
cross-alternate commit-graph layers in funny ways, like claiming that
"./objects" and "objects" were in different directories.

This resulted in removing all of the places in the commit-graph.c code
that use 'char *object_dir's with 'struct object_directory *'s instead.
This allows us to replace brittle string-based path comparisons with raw
pointer comparisons to check whether two commit-graphs belong to the
same object store or not.

This has a pleasant side effect in PATCH 5/6 of fixing an uninitialized
read as described in [1].

This series became a little bit longer than I was expecting it to be, so
here is the high-level structure:

  - 1/6 fixes a bug in a test that would cause a subsequent failure if
    unaddressed.

  - 2/6 does the first half of the removal by using 'struct
    object_directory *'s within the 'commit_graph' structure.

  - 4/6 does the second half by removing 'char *object_dir' usage in the
    'write_commit_graph_context' structure.

  - 5/6 ties 2/6 and 4/6 together by removing all path normalization
    completely, fixing the uninitialized read bug.

  - And 6/6 cleans up.

We've been running a version of this series based on our fork (which is
in turn based on 2.24) for a few hours without issue.

Thanks in advance for your review.

[1]: https://lore.kernel.org/git/20191027042116.GA5801@sigill.intra.peff.net/

Taylor Blau (6):
  t5318: don't pass non-object directory to '--object-dir'
  commit-graph.h: store object directory in 'struct commit_graph'
  builtin/commit-graph.c: die() with unknown '--object-dir'
  commit-graph.h: store an odb in 'struct write_commit_graph_context'
  commit-graph.c: remove path normalization, comparison
  commit-graph.h: use odb in 'load_commit_graph_one_fd_st'

 Documentation/git-commit-graph.txt |   5 +-
 builtin/commit-graph.c             |  25 ++++--
 builtin/commit.c                   |   3 +-
 builtin/fetch.c                    |   2 +-
 builtin/gc.c                       |   2 +-
 commit-graph.c                     | 135 +++++++++++++++--------------
 commit-graph.h                     |  17 ++--
 t/helper/test-read-graph.c         |   8 +-
 t/t5318-commit-graph.sh            |   4 +-
 9 files changed, 114 insertions(+), 87 deletions(-)

--
2.25.0.dirty

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2020-02-05 12:30 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 23:00 [PATCH 0/6] commit-graph: use 'struct object_directory *' everywhere Taylor Blau
2020-01-30 23:00 ` [PATCH 1/6] t5318: don't pass non-object directory to '--object-dir' Taylor Blau
2020-01-30 23:00 ` [PATCH 5/6] commit-graph.c: remove path normalization, comparison Taylor Blau
2020-01-30 23:00 ` [PATCH 6/6] commit-graph.h: use odb in 'load_commit_graph_one_fd_st' Taylor Blau
2020-01-30 23:00 ` [PATCH 2/6] commit-graph.h: store object directory in 'struct commit_graph' Taylor Blau
2020-01-31  6:52   ` Martin Ågren
2020-01-31 10:20     ` Jeff King
2020-01-31 19:19       ` Martin Ågren
2020-02-03  4:36       ` Taylor Blau
2020-02-03  8:36         ` Jeff King
2020-01-31 20:49     ` Junio C Hamano
2020-02-03  3:58     ` Taylor Blau
2020-01-30 23:00 ` [PATCH 4/6] commit-graph.h: store an odb in 'struct write_commit_graph_context' Taylor Blau
2020-01-30 23:00 ` [PATCH 3/6] builtin/commit-graph.c: die() with unknown '--object-dir' Taylor Blau
2020-01-31 10:30 ` [PATCH 0/6] commit-graph: use 'struct object_directory *' everywhere Jeff King
2020-01-31 13:22   ` Derrick Stolee
2020-02-03  4:38     ` Taylor Blau
2020-02-03 21:17 ` [PATCH v2 0/5] " Taylor Blau
2020-02-03 21:17   ` [PATCH v2 1/5] t5318: don't pass non-object directory to '--object-dir' Taylor Blau
2020-02-03 21:17   ` [PATCH v2 2/5] commit-graph.h: store an odb in 'struct write_commit_graph_context' Taylor Blau
2020-02-04  5:51     ` Taylor Blau
2020-02-04 19:54       ` Junio C Hamano
2020-02-04 21:28         ` Taylor Blau
2020-02-04 21:44           ` Junio C Hamano
2020-02-03 21:18   ` [PATCH v2 3/5] commit-graph.h: store object directory in 'struct commit_graph' Taylor Blau
2020-02-03 21:18   ` [PATCH v2 4/5] commit-graph.c: remove path normalization, comparison Taylor Blau
2020-02-03 21:18   ` [PATCH v2 5/5] commit-graph.h: use odb in 'load_commit_graph_one_fd_st' Taylor Blau
2020-02-05 12:30   ` [PATCH v2 0/5] commit-graph: use 'struct object_directory *' everywhere Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).