public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix misuse of `refs_for_each_ref_in()`
@ 2026-01-28  8:49 Patrick Steinhardt
  2026-01-28  8:49 ` [PATCH 1/3] pack-bitmap: deduplicate logic to iterate over preferred bitmap tips Patrick Steinhardt
                   ` (6 more replies)
  0 siblings, 7 replies; 42+ messages in thread
From: Patrick Steinhardt @ 2026-01-28  8:49 UTC (permalink / raw)
  To: git; +Cc: Taylor Blau

Hi,

this small patch series fixes a bug I have discovered where configuring
"pack.preferBitmapTips" to an exact branch will cause Git to `BUG()`.

The root cause of this bug is misuse of `refs_for_each_ref_in()`: this
function accepts a prefix to yield refs for, and then strips the prefix
for each ref. Consequently, if passed an exact refname, then stripping
the prefix would make us end up with an empty refname, and that is not
supposed to happen.

There was one other caller that got it wrong, too, and which is also
fixed in this patch series.

Thanks!

Patrick

---
Patrick Steinhardt (3):
      pack-bitmap: deduplicate logic to iterate over preferred bitmap tips
      pack-bitmap: fix bug with exact ref match in "pack.preferBitmapTips"
      bisect: fix misuse of `refs_for_each_ref_in()`

 bisect.c                    |  8 ++++----
 builtin/pack-objects.c      | 19 ++-----------------
 pack-bitmap.c               | 18 +++++++++++++++++-
 pack-bitmap.h               |  9 ++++++++-
 repack-midx.c               | 14 +++-----------
 t/t5310-pack-bitmaps.sh     | 35 +++++++++++++++++++++++++++++++++++
 t/t5319-multi-pack-index.sh | 36 ++++++++++++++++++++++++++++++++++++
 7 files changed, 105 insertions(+), 34 deletions(-)


---
base-commit: ea717645d199f6f1b66058886475db3e8c9330e9
change-id: 20260128-b4-pks-fix-for-each-ref-in-misuse-96ae62e313a5


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2026-02-26 17:39 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28  8:49 [PATCH 0/3] Fix misuse of `refs_for_each_ref_in()` Patrick Steinhardt
2026-01-28  8:49 ` [PATCH 1/3] pack-bitmap: deduplicate logic to iterate over preferred bitmap tips Patrick Steinhardt
2026-01-28 10:37   ` Karthik Nayak
2026-01-29  2:16   ` Taylor Blau
2026-01-29 16:35     ` Junio C Hamano
2026-01-30 12:58     ` Patrick Steinhardt
2026-01-28  8:49 ` [PATCH 2/3] pack-bitmap: fix bug with exact ref match in "pack.preferBitmapTips" Patrick Steinhardt
2026-01-28 11:04   ` Karthik Nayak
2026-01-29  2:31   ` Taylor Blau
2026-01-29 16:52     ` Junio C Hamano
2026-01-29 19:34       ` Taylor Blau
2026-01-29 23:17         ` Junio C Hamano
2026-01-30 12:58     ` Patrick Steinhardt
2026-01-28  8:49 ` [PATCH 3/3] bisect: fix misuse of `refs_for_each_ref_in()` Patrick Steinhardt
2026-01-29  8:14   ` Jeff King
2026-01-29 17:28     ` Junio C Hamano
2026-01-30 12:58       ` Patrick Steinhardt
2026-01-28 11:05 ` [PATCH 0/3] Fix " Karthik Nayak
2026-01-30 13:27 ` [PATCH v2 0/4] " Patrick Steinhardt
2026-01-30 13:27   ` [PATCH v2 1/4] pack-bitmap: deduplicate logic to iterate over preferred bitmap tips Patrick Steinhardt
2026-01-30 13:27   ` [PATCH v2 2/4] pack-bitmap: fix bug with exact ref match in "pack.preferBitmapTips" Patrick Steinhardt
2026-02-02  2:13     ` Taylor Blau
2026-02-06  7:13       ` Patrick Steinhardt
2026-01-30 13:27   ` [PATCH v2 3/4] bisect: fix misuse of `refs_for_each_ref_in()` Patrick Steinhardt
2026-01-30 13:27   ` [PATCH v2 4/4] bisect: simplify string_list memory handling Patrick Steinhardt
2026-01-30 16:56     ` Junio C Hamano
2026-02-02  2:14       ` Taylor Blau
2026-02-06  7:49 ` [PATCH v3 0/4] Fix misuse of `refs_for_each_ref_in()` Patrick Steinhardt
2026-02-06  7:49   ` [PATCH v3 1/4] pack-bitmap: deduplicate logic to iterate over preferred bitmap tips Patrick Steinhardt
2026-02-06  7:49   ` [PATCH v3 2/4] pack-bitmap: fix bug with exact ref match in "pack.preferBitmapTips" Patrick Steinhardt
2026-02-06 17:18     ` Junio C Hamano
2026-02-06  7:49   ` [PATCH v3 3/4] bisect: fix misuse of `refs_for_each_ref_in()` Patrick Steinhardt
2026-02-06  7:49   ` [PATCH v3 4/4] bisect: simplify string_list memory handling Patrick Steinhardt
2026-02-18 18:36   ` [PATCH v3 0/4] Fix misuse of `refs_for_each_ref_in()` Taylor Blau
2026-02-19 15:22     ` Junio C Hamano
2026-02-19  7:57 ` [PATCH v4 " Patrick Steinhardt
2026-02-19  7:57   ` [PATCH v4 1/4] pack-bitmap: deduplicate logic to iterate over preferred bitmap tips Patrick Steinhardt
2026-02-19  7:57   ` [PATCH v4 2/4] pack-bitmap: fix bug with exact ref match in "pack.preferBitmapTips" Patrick Steinhardt
2026-02-19  7:57   ` [PATCH v4 3/4] bisect: fix misuse of `refs_for_each_ref_in()` Patrick Steinhardt
2026-02-19  7:57   ` [PATCH v4 4/4] bisect: simplify string_list memory handling Patrick Steinhardt
2026-02-26 17:39   ` [PATCH v4 0/4] Fix misuse of `refs_for_each_ref_in()` Junio C Hamano
2026-02-26 17:39   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox