From: Josh Steadmon <steadmon@google.com>
To: git@vger.kernel.org
Subject: [PATCH 0/2] commit-graph: suggest deleting corrupt graphs
Date: Thu, 22 Feb 2024 15:19:05 -0800 [thread overview]
Message-ID: <cover.1708643825.git.steadmon@google.com> (raw)
At $WORK, we've had a few occasions where someone's commit-graph becomes
corrupt, and hits various BUG()s that block their day-to-day work. When
this happens, we advise the user to either disable the commit graph, or
to delete it and let it be regenerated.
It would be a nicer user experience if we can make this a self-serve
procedure. To do this, let's add a new `git commit-graph clear`
subcommand so that users don't need to manually delete files under their
.git directories. And to make it self-documenting, update various BUG(),
die(), and error() messages to suggest removing the commit graph to
recover from the corruption.
This approach was suggested in [1] and generally positively received
[2], but was never implemented.
[1] https://lore.kernel.org/git/YBoBBie2t1EhcLAN@google.com/
[2] https://lore.kernel.org/git/xmqqk0rpc7uj.fsf@gitster.c.googlers.com/
Open questions for reviewers:
* Should we turn this into an advice setting instead?
* Should we also suggest running `commit-graph write` after clearing
the graph? I lean towards no; everything will still function as normal
without a commit graph.
* Does it make sense to add the suggestion in all of these corruption
error messages? There are many other error()s in commit-graph.c,
should we add this for all of them, or just the ones that specifically
mention corruption? Or maybe just the fatal BUG()s and die()s?
* Any other places this suggestion should be added that I've missed?
Josh Steadmon (2):
commit-graph: add `git commit-graph clear` subcommand
commit-graph: suggest removing corrupt graphs
Documentation/git-commit-graph.txt | 5 ++++
builtin/commit-graph.c | 40 +++++++++++++++++++++++++++
commit-graph.c | 43 +++++++++++++++++++++++++++---
commit-graph.h | 1 +
commit-reach.c | 4 ++-
t/t5318-commit-graph.sh | 17 ++++++++++--
t/t5324-split-commit-graph.sh | 26 ++++++++++++------
7 files changed, 122 insertions(+), 14 deletions(-)
base-commit: 3e0d3cd5c7def4808247caf168e17f2bbf47892b
--
2.44.0.rc0.258.g7320e95886-goog
next reply other threads:[~2024-02-22 23:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 23:19 Josh Steadmon [this message]
2024-02-22 23:19 ` [PATCH 1/2] commit-graph: add `git commit-graph clear` subcommand Josh Steadmon
2024-02-22 23:19 ` [PATCH 2/2] commit-graph: suggest removing corrupt graphs Josh Steadmon
2024-02-23 0:05 ` [PATCH 0/2] commit-graph: suggest deleting " Junio C Hamano
2024-04-24 19:30 ` Josh Steadmon
2024-04-24 21:28 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1708643825.git.steadmon@google.com \
--to=steadmon@google.com \
--cc=git@vger.kernel.org \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.