Detect empty or missing reflogs with `ref@{0}`
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | object-name: detect and report empty reflogsobject-name.c refs.c t/ +1 more | +41 | 3 replies | |
| 2/2 | builtin/show-branch: detect empty reflogsbuiltin/ t/ | +27 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] Detect empty or missing reflogs with `ref@{0}`
Hi,
this patch series addresses some shortcomings when parsing ref@{n} syntax via read_ref_at() when the reflog is missing or empty:
- First, as reported by Yasushi, git-show-branch(1) would segfault because the function does not report when the 0th entry wasn't found.
- Second, ref@{0} would fall back to return the object ID of ref itself in case the reflog is empty or missing. This behaviour is quite confusing and only works by chance.
The series addresses both of these issues by detecting and reporting the case where the reflog is empty or missing.
Patrick
Patrick Steinhardt (2):
object-name: detect and report empty reflogs
builtin/show-branch: detect empty reflogs
builtin/show-branch.c | 2 ++ object-name.c | 10 ++++++---- refs.c | 3 ++- t/t1506-rev-parse-diagnosis.sh | 8 ++++++++ t/t1508-at-combinations.sh | 29 +++++++++++++++++++++++++---- t/t3202-show-branch.sh | 25 +++++++++++++++++++++++++ 6 files changed, 68 insertions(+), 9 deletions(-)
Signature · 1 line
2.44.0-rc1