Thread (103 messages) 103 messages, 6 authors, 2021-04-22

[PATCH 0/7] improve reporting of unexpected objects

flat view
STALE2003d SUPERSEDED

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-03-08 20:05:46

Revision v1 of 2 in this series.

Revisions (2)
  1. v1 current
  2. v2 [diff vs current]
We have some errors that say "your OID %s is not a blob" or whatever,
now with 5/7 we'll say "object %s is a %s, not a %s" in most cases.

Then 7/7 fixes a regression which AFAICT is from 2005. So it's pretty
obscure. When you craft an invalid tag object saying an OID is a tag
instead of a commit, we'd buggily invert the two types when reporting
that error.

The solution to that in 7/7 may not be ideal, but is the best one I
could come up with, so feedback on that patch & this whole thing is
most welcome.

Ævar Arnfjörð Bjarmason (7):
  object.c: refactor type_from_string_gently()
  object.c: make type_from_string() return "enum object_type"
  oid_object_info(): return "enum object_type"
  tree.c: fix misindentation in parse_tree_gently()
  object.c: add a utility function for "expected type X, got Y"
  object tests: add test for unexpected objects in tags
  tag: don't misreport type of tagged objects in errors

 blob.c                                 |  16 +++-
 blob.h                                 |   3 +
 builtin/blame.c                        |   2 +-
 builtin/cat-file.c                     |   2 +-
 builtin/index-pack.c                   |  15 ++--
 builtin/mktree.c                       |   2 +-
 builtin/pack-objects.c                 |   4 +-
 builtin/replace.c                      |   2 +-
 builtin/tag.c                          |   2 +-
 builtin/unpack-objects.c               |   6 +-
 commit.c                               |  24 ++++--
 commit.h                               |   2 +
 fsck.c                                 |   4 +-
 object-file.c                          |  15 ++--
 object-name.c                          |  18 ++--
 object-store.h                         |   2 +-
 object.c                               |  62 +++++++++++---
 object.h                               |   9 +-
 packfile.c                             |   4 +-
 reachable.c                            |   5 +-
 t/t6102-rev-list-unexpected-objects.sh | 113 ++++++++++++++++++++++++-
 tag.c                                  |  14 ++-
 tag.h                                  |   2 +
 tree.c                                 |  27 ++++--
 tree.h                                 |   2 +
 25 files changed, 282 insertions(+), 75 deletions(-)

-- 
2.31.0.rc1.210.g0f8085a843c
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help