mbox series

[0/2] replace die("BUG: ...") with BUG("...")

Message ID cover-0.2-00000000000-20211206T162442Z-avarab@gmail.com (mailing list archive)
Headers show
Series replace die("BUG: ...") with BUG("...") | expand

Message

Ævar Arnfjörð Bjarmason Dec. 6, 2021, 4:25 p.m. UTC
A trivial clean-up to change a couple of die() uses to BUG() where
appropriate. This is split off from an earlier RFC series I sent
in[1], as the range-diff to the relevant patches there shown there are
no changes since then.

1. https://lore.kernel.org/git/RFC-patch-07.21-3f897bf6b0e-20211115T220831Z-avarab@gmail.com/

Ævar Arnfjörð Bjarmason (2):
  pack-objects: use BUG(...) not die("BUG: ...")
  strbuf.h: use BUG(...) not die("BUG: ...")

 builtin/pack-objects.c | 2 +-
 strbuf.h               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Range-diff:
1:  2507ea71700 = 1:  2a17ed9f135 pack-objects: use BUG(...) not die("BUG: ...")
2:  5dedcee3fb0 = 2:  ab89fec50c3 strbuf.h: use BUG(...) not die("BUG: ...")

Comments

Junio C Hamano Dec. 6, 2021, 6:44 p.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> A trivial clean-up to change a couple of die() uses to BUG() where
> appropriate.

Makes sense.  I wonder contrib/coccinelle/ can help us maintain
them, though.

Will queue.

Thanks.
Ævar Arnfjörð Bjarmason Dec. 7, 2021, 11 a.m. UTC | #2
On Mon, Dec 06 2021, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> A trivial clean-up to change a couple of die() uses to BUG() where
>> appropriate.
>
> Makes sense.  I wonder contrib/coccinelle/ can help us maintain
> them, though.

I tried to come up with a rule for this after browsing around in linux's
sources & coccicheck's own test cases, but didn't find any example I
could adapt. It's rather thin on string munging like that, and I don't
know spatch well enough.