From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: Taylor Blau <me@ttaylorr.com>,
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, Dmitry Goncharov <dgoncharov@users.sf.net>
Subject: Re: [PATCH 2/2] merge-ort: fix slightly overzealous assertion for rename-to-self
Date: Wed, 12 Mar 2025 16:18:39 -0700 [thread overview]
Message-ID: <xmqqr031x2gg.fsf@gitster.g> (raw)
In-Reply-To: <CABPp-BH+9JcP6FDP6RFQzZbwW=XOWnWAR8PmrCS6hG4iyd2pPQ@mail.gmail.com> (Elijah Newren's message of "Wed, 12 Mar 2025 15:36:07 -0700")
Elijah Newren <newren@gmail.com> writes:
> But it might be worth mentioning that having side-effects in
> assertions is a huge no-no, and I understand that when folks have to
> debug one of those (I had to in a separate project years ago which was
> kind of nasty), that they sometimes jump to the conclusion that
> assertions are bad.
Yes, assert() invites such mistakes. Why not avoid them when there
are better alternatives like "if (condition) BUG()"?
next prev parent reply other threads:[~2025-03-12 23:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 15:30 [PATCH 0/2] merge-ort: fix a crash in process_renames for a file transitively renamed to itself Elijah Newren via GitGitGadget
2025-03-06 15:30 ` [PATCH 1/2] t6423: add a testcase causing a failed assertion in process_renames Dmitry Goncharov via GitGitGadget
2025-03-06 15:30 ` [PATCH 2/2] merge-ort: fix slightly overzealous assertion for rename-to-self Elijah Newren via GitGitGadget
2025-03-12 22:00 ` Taylor Blau
2025-03-12 22:36 ` Elijah Newren
2025-03-12 23:18 ` Junio C Hamano [this message]
2025-03-13 6:22 ` Elijah Newren
2025-03-13 16:55 ` Junio C Hamano
2025-03-13 17:15 ` Elijah Newren
2025-03-13 18:34 ` Junio C Hamano
2025-03-14 0:24 ` Elijah Newren
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=xmqqr031x2gg.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=dgoncharov@users.sf.net \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=me@ttaylorr.com \
--cc=newren@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.
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 NNTP newsgroup(s).