Thread (25 messages) 25 messages, 3 authors, 2021-09-20

Re: [PATCH 1/2] ref-filter: hacky "streaming" mode

From: ZheNing Hu <hidden>
Date: 2021-09-15 14:23:57

ZheNing Hu [off-list ref] 于2021年9月15日周三 下午8:27写道:
quoted
So yes, it's complicated. And it must be explained to the user that
"%(refname)" behaves slightly differently with "git tag --verify", but
that is unavoidable if we do not want to break scripts (it _already_
behaves slightly differently, and we just never told anyone).
$ git tag --verify --format='verify: %(refname) %(symref)' annotated symref
verify: annotated
verify: symref
$ git tag --verify --format='verify: %(refname) %(symref)'
refs/tags/annotated refs/tags/symref
error: tag 'refs/tags/annotated' not found.
error: tag 'refs/tags/symref' not found.

$ git verify-tag --format='verify: %(refname) %(symref)' annotated
symref
verify: annotated
verify: symref
$ git verify-tag --format='verify: %(refname) %(symref)'
refs/tags/annotated refs/tags/symref
verify: refs/tags/annotated
verify: refs/tags/symref

As we can see, there is a slight difference between git tag --verify and
git verify-tag: git tag --verify can not handle refs' fullname refs/tags/*
(because read_ref_full() | read_ref() can't handle them). So, as a standard,
which characteristics should we keep?
quoted
The other option is to declare the current behavior a bug and fix it. I
am quite tempted by that route, given the inconsistency with other
formatters, including even "git tag --list --format=%(refname)"!
I don't know, I think both fix methods are okay.
quoted
-Peff
Thanks.
--
ZheNing Hu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help