git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: git@vger.kernel.org
Cc: dstolee@microsoft.com, gitster@pobox.com, peff@peff.net,
	szeder.dev@gmail.com
Subject: [PATCH 0/8] commit-graph: drop CHECK_OIDS, peel in callers
Date: Mon, 4 May 2020 19:13:31 -0600	[thread overview]
Message-ID: <cover.1588641176.git.me@ttaylorr.com> (raw)

Hi,

These are a few patches to address [1] by getting rid of the
'COMMIT_GRAPH_WRITE_CHECK_OIDS' flag. A more complete discussion about
why we might want to get rid of that flag can be found in the second
patch, as well as in [1], but the basic gist is as follows:

  - It is often convenient to pipe the output of 'git for-each-ref' into
    'git commit-graph write --stdin-commits', but handling multi-layer
    tags is frustrating (at the very least, you have to peel them
    yourself in 'for-each-ref', incurring a higher-than-necessary cost
    outside of the commit-graph invocation)

  - It would be much more convenient if 'git commit-graph write
    --stdin-commits' ignored OIDs that peel down to non-commit objects
    silently, while still warning the caller about objects that (a)
    don't exist, or (b) invalid hash inputs (for e.g., "HEAD", or
    "refs/heads/foo").

  - By making this change, we are allowing *more* possible behaviors
    than in previous versions, and the only case that we are breaking
    (that 'git commit-graph write --stdin-commits' complains on
    non-commit OIDs) can be addressed by peeling outside of
    'commit-graph write' [2].

The first six patches move peeling refs out from the commit-graph
internals, and into the callers.

This has no impact on the '--stdin-commits' case, but is a potential
improvement for '--reachable', where it is more efficient to call
'peel_ref()' than 'lookup_commit_reference_gently()'. There is an
intermediate state (that is resolved in the final patch) where we can
have more than one progress meter (since the progress meter moved with
the perhaps-expensive operations out of the commit-graph internals,
too), but the final patch addresses this.

The last two patches lift the restriction on input to '--stdin-commits'
resolving to commit objects, instead making the behavior to silently
drop non-commit OIDs, and continue complain about invalid OIDs, and
valid-but-missing OIDs.

Finally, this topic isn't based on anything that isn't already in
'master', so I think the days of many tangle commit-graph topics are
behind us.

Thanks in advance for your review.

Thanks,
Taylor

Taylor Blau (8):
  commit-graph.c: extract 'refs_cb_data'
  commit-graph.c: show progress of finding reachable commits
  commit-graph.c: peel refs in 'add_ref_to_set'
  builtin/commit-graph.c: extract 'read_one_commit()'
  builtin/commit-graph.c: dereference tags in builtin
  commit-graph.c: simplify 'fill_oids_from_commits'
  t5318: reorder test below 'graph_read_expect'
  commit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag

 Documentation/git-commit-graph.txt |  6 ++-
 builtin/commit-graph.c             | 73 ++++++++++++++++++++----------
 commit-graph.c                     | 61 +++++++++++--------------
 commit-graph.h                     | 10 ++--
 t/t5318-commit-graph.sh            | 25 ++++++----
 5 files changed, 98 insertions(+), 77 deletions(-)

--
2.26.0.113.ge9739cdccc

             reply	other threads:[~2020-05-05  1:13 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  1:13 Taylor Blau [this message]
2020-05-05  1:13 ` [PATCH 1/8] commit-graph.c: extract 'refs_cb_data' Taylor Blau
2020-05-05  1:13 ` [PATCH 2/8] commit-graph.c: show progress of finding reachable commits Taylor Blau
2020-05-05 11:50   ` Derrick Stolee
2020-05-05 16:13     ` Taylor Blau
2020-05-05  1:13 ` [PATCH 3/8] commit-graph.c: peel refs in 'add_ref_to_set' Taylor Blau
2020-05-07 19:54   ` Jeff King
2020-05-13 19:48     ` Taylor Blau
2020-05-13 20:17       ` Jeff King
2020-05-05  1:13 ` [PATCH 4/8] builtin/commit-graph.c: extract 'read_one_commit()' Taylor Blau
2020-05-07 20:03   ` Jeff King
2020-05-13 20:01     ` Taylor Blau
2020-05-05  1:13 ` [PATCH 5/8] builtin/commit-graph.c: dereference tags in builtin Taylor Blau
2020-05-05 12:01   ` Derrick Stolee
2020-05-05 16:14     ` Taylor Blau
2020-05-07 20:14   ` Jeff King
2020-05-05  1:13 ` [PATCH 6/8] commit-graph.c: simplify 'fill_oids_from_commits' Taylor Blau
2020-05-05 12:05   ` Derrick Stolee
2020-05-07 20:21   ` Jeff King
2020-05-05  1:14 ` [PATCH 7/8] t5318: reorder test below 'graph_read_expect' Taylor Blau
2020-05-05  1:14 ` [PATCH 8/8] commit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag Taylor Blau
2020-05-05 12:10   ` Derrick Stolee
2020-05-05 16:16     ` Taylor Blau
2020-05-07 20:40   ` Jeff King
2020-05-13 21:32     ` Taylor Blau
2020-05-05 11:35 ` [PATCH 0/8] commit-graph: drop CHECK_OIDS, peel in callers Derrick Stolee
2020-05-05 16:11   ` Taylor Blau
2020-05-06  0:07 ` [PATCH v2 " Taylor Blau
2020-05-06  0:07   ` [PATCH v2 1/8] commit-graph.c: extract 'refs_cb_data' Taylor Blau
2020-05-06  0:07   ` [PATCH v2 2/8] commit-graph.c: show progress of finding reachable commits Taylor Blau
2020-05-06  0:07   ` [PATCH v2 3/8] commit-graph.c: peel refs in 'add_ref_to_set' Taylor Blau
2020-05-06  0:07   ` [PATCH v2 4/8] builtin/commit-graph.c: extract 'read_one_commit()' Taylor Blau
2020-05-06  0:07   ` [PATCH v2 5/8] builtin/commit-graph.c: dereference tags in builtin Taylor Blau
2020-05-06  0:07   ` [PATCH v2 6/8] commit-graph.c: simplify 'fill_oids_from_commits' Taylor Blau
2020-05-06  0:07   ` [PATCH v2 7/8] t5318: reorder test below 'graph_read_expect' Taylor Blau
2020-05-06  0:07   ` [PATCH v2 8/8] commit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag Taylor Blau
2020-05-07 20:42   ` [PATCH v2 0/8] commit-graph: drop CHECK_OIDS, peel in callers Jeff King
2020-05-13 21:59 ` [PATCH v3 " Taylor Blau
2020-05-13 21:59   ` [PATCH v3 1/8] commit-graph.c: extract 'refs_cb_data' Taylor Blau
2020-05-13 21:59   ` [PATCH v3 2/8] commit-graph.c: show progress of finding reachable commits Taylor Blau
2020-05-13 21:59   ` [PATCH v3 3/8] commit-graph.c: peel refs in 'add_ref_to_set' Taylor Blau
2020-05-13 21:59   ` [PATCH v3 4/8] builtin/commit-graph.c: extract 'read_one_commit()' Taylor Blau
2020-05-14 17:56     ` Jeff King
2020-05-14 18:02       ` Taylor Blau
2020-05-14 18:27         ` Junio C Hamano
2020-05-18 19:27           ` Taylor Blau
2020-05-13 21:59   ` [PATCH v3 5/8] builtin/commit-graph.c: dereference tags in builtin Taylor Blau
2020-05-14 18:01     ` Jeff King
2020-05-14 18:04       ` Taylor Blau
2020-07-10 19:02     ` [PATCH] commit-graph: fix "Collecting commits from input" progress line SZEDER Gábor
2020-07-10 19:17       ` Taylor Blau
2020-07-15 18:33       ` SZEDER Gábor
2020-07-15 18:43         ` Derrick Stolee
2020-07-15 18:58           ` Junio C Hamano
2020-05-13 21:59   ` [PATCH v3 6/8] commit-graph.c: simplify 'fill_oids_from_commits' Taylor Blau
2020-05-13 21:59   ` [PATCH v3 7/8] t5318: reorder test below 'graph_read_expect' Taylor Blau
2020-05-13 21:59   ` [PATCH v3 8/8] commit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag Taylor Blau
2020-05-14 18:09     ` Jeff King
2020-05-14 18:12   ` [PATCH v3 0/8] commit-graph: drop CHECK_OIDS, peel in callers Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1588641176.git.me@ttaylorr.com \
    --to=me@ttaylorr.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).