git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/6] Finish the conversion from die("BUG: ...") to BUG()

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 29, 2018, 22:17 UTC
Message-ID
<cover.1525040253.git.johannes.schindelin@gmx.de>

The BUG() macro was introduced in this patch series: https://public-inbox.org/git/20170513032414.mfrwabt4hovujde2@sigill.intra.peff.net

The second patch in that series converted one caller from die("BUG: ") to use the BUG() macro.

It seems that there was no concrete plan to address the same issue in the rest of the code base.

This patch series tries to do that.
Note: I separated out 4/6 ("refs/*: report bugs using the BUG() macro")
from 5/6 ("Replace all die("BUG: ...") to keep it cuddled with the patch
2/6 that prepares t1406 for this change of refs/' behavior.

Note also: I would be very surprised if the monster commit 5/6 ("Replace all die("BUG: ...") calls by BUG() ones") would apply cleanly on `pu` (I develop this on top of `master`).

For that reason, the commit message contains the precise Unix shell invocation (GNU sed semantics, not BSD sed ones, because I know that the Git maintainer as well as the author of the patch introducing BUG() both use Linux and not macOS or any other platform that would offer a BSD sed). It should be straight-forward to handle merge conflicts/non-applying patches by simply re-running that command.

Johannes Schindelin (6):
  test_must_fail: support ok=sigabrt
  t1406: prepare for the refs code to fail with BUG()
  refs/*: report bugs using the BUG() macro
  run-command: use BUG() to report bugs, not die()
  Replace all die("BUG: ...") calls by BUG() ones
  Convert remaining die*(BUG) messages
 apply.c                          |  4 ++--
 archive-tar.c                    |  2 +-
 attr.c                           | 10 +++++-----
 blame.c                          |  2 +-
 builtin/am.c                     | 20 +++++++++----------
 builtin/branch.c                 |  2 +-
 builtin/cat-file.c               |  4 ++--
 builtin/clone.c                  |  2 +-
 builtin/commit.c                 |  2 +-
 builtin/config.c                 |  2 +-
 builtin/fast-export.c            |  2 +-
 builtin/fsck.c                   |  2 +-
 builtin/index-pack.c             |  4 ++--
 builtin/init-db.c                |  2 +-
 builtin/ls-files.c               |  2 +-
 builtin/notes.c                  |  8 ++++----
 builtin/pack-objects.c           |  4 ++--
 builtin/pull.c                   |  2 +-
 builtin/receive-pack.c           |  2 +-
 builtin/replace.c                |  2 +-
 builtin/update-index.c           |  2 +-
 bulk-checkin.c                   |  2 +-
 color.c                          |  4 ++--
 column.c                         |  2 +-
 config.c                         | 12 +++++------
 date.c                           |  2 +-
 diff.c                           | 12 +++++------
 dir-iterator.c                   |  2 +-
 git-compat-util.h                |  2 +-
 grep.c                           | 16 +++++++--------
 http.c                           |  8 ++++----
 imap-send.c                      |  2 +-
 lockfile.c                       |  2 +-
 mailinfo.c                       |  2 +-
 merge-recursive.c                | 12 +++++------
 notes-merge.c                    |  4 ++--
 pack-bitmap-write.c              |  2 +-
 pack-bitmap.c                    |  6 +++---
 pack-objects.c                   |  2 +-
 packfile.c                       |  6 +++---
 pathspec.c                       | 12 +++++------
 pkt-line.c                       |  2 +-
 prio-queue.c                     |  2 +-
 ref-filter.c                     |  4 ++--
 refs.c                           | 34 ++++++++++++++++----------------
 refs/files-backend.c             | 20 +++++++++----------
 refs/iterator.c                  |  6 +++---
 refs/packed-backend.c            | 16 +++++++--------
 refs/ref-cache.c                 |  2 +-
 remote.c                         |  2 +-
 revision.c                       |  4 ++--
 run-command.c                    | 33 ++++++++++++++-----------------
 setup.c                          |  4 ++--
 sha1-lookup.c                    |  2 +-
 sha1-name.c                      |  4 ++--
 shallow.c                        |  6 +++---
 sigchain.c                       |  2 +-
 strbuf.c                         |  4 ++--
 submodule.c                      |  8 ++++----
 t/helper/test-example-decorate.c | 16 +++++++--------
 t/t1406-submodule-ref-store.sh   | 15 ++++++++------
 t/test-lib-functions.sh          |  5 ++++-
 tmp-objdir.c                     |  2 +-
 trailer.c                        |  6 +++---
 transport.c                      |  4 ++--
 unpack-trees.c                   |  2 +-
 vcs-svn/fast_export.c            |  6 ++++--
 worktree.c                       |  2 +-
 wrapper.c                        |  4 ++--
 wt-status.c                      | 20 +++++++++----------
 zlib.c                           |  4 ++--
 71 files changed, 220 insertions(+), 215 deletions(-)
base-commit: 1f1cddd558b54bb0ce19c8ace353fd07b758510d
Published-As: https://github.com/dscho/git/releases/tag/use-bug-macro-v1
Fetch-It-Via: git fetch https://github.com/dscho/git use-bug-macro-v1
-- 
2.17.0.windows.1.36.gdf4ca5fb72a
Next: Johannes Schindelin
Message 1 of 15 in “Finish the conversion from die("BUG: ...") to BUG()”
  1. 0/6 Finish the conversion from die("BUG: ...") to BUG()Johannes Schindelin, Apr 29, 2018
  2. 1/6 test_must_fail: support ok=sigabrtJohannes Schindelin, Apr 29, 2018
  3. 2/6 t1406: prepare for the refs code to fail with BUG()Johannes Schindelin, Apr 29, 2018
  4. Johannes SixtApr 30, 2018
  5. Johannes SchindelinMay 1, 2018
  6. Duy NguyenMay 1, 2018
  7. Duy NguyenMay 1, 2018
  8. Junio C HamanoMay 2, 2018
  9. Johannes SchindelinMay 2, 2018
  10. Junio C HamanoMay 2, 2018
  11. 3/6 refs/*: report bugs using the BUG() macroJohannes Schindelin, Apr 29, 2018
  12. 4/6 run-command: use BUG() to report bugs, not die()Johannes Schindelin, Apr 29, 2018
  13. 5/6 Replace all die("BUG: ...") calls by BUG() onesJohannes Schindelin, Apr 29, 2018
  14. 6/6 Convert remaining die*(BUG) messagesJohannes Schindelin, Apr 29, 2018
  15. Eric SunshineApr 30, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.