Nico Huber has posted comments on this change. ( https://review.coreboot.org/19206 )
Change subject: Convert flashrom to git ......................................................................
Patch Set 1: Code-Review-1
(8 comments)
I still object to the complex version generation. It's very far from being bullet-proof and just wastes time atm. Please split it out into another commit.
A simple `<tag>-<count>-<sha>` would suffice, IMO. If `<sha>` is on an upstream branch, a developer can look that up easily. If it's not, anything could have been changed, no matter if the changes are based on a tag or a branch. It seems to be just user (and contributor) patronizing for the sake of a little upstream dev convenience.
https://review.coreboot.org/#/c/19206/1/util/getrevision.sh File util/getrevision.sh:
PS1, Line 50: forced_update This is not about updating in general but updating the "upcache". The name should reflect that.
PS1, Line 58: update This is not about updating in general but updating the "upcache". The name should reflect that.
PS1, Line 224: -n "$up_remote" Just that there is a upstream remote registered doesn't imply that its branches are synchronized.
PS1, Line 229: update So we never synchronize in the upstream-repo-registered case but always in the upcache case. That's scratchy.
PS1, Line 224: if [ -n "$up_remote" ]; then : for b in $upstream_branches ; do : up_refs="$up_refs ${up_remote}/${b}" : done : else : update || { echo "offline" ; return ; } : up_refs=$upcache_refs : fi What we'd need here instead is
* setting `up_refs` based on `-n "$up_remote"` (like already done)
* check if all `$up_refs` exist
* if not, update `$up_refs` whatever they are
PS1, Line 257: for ref in $up_refs ; do : if git merge-base --is-ancestor ${merge_point} ${ref}; then : upstream_branch=${ref##*/} # remove everything till last / : cnt_tag2upstream_branch=$(git rev-list --count "${lasttag}..${merge_point}" 2>/dev/null) : break : fi : done Nit, looks like `staging` would override `stable` here even if they are equally close.
PS1, Line 268: _tag2upstream_branch probably uninitialized
PS1, Line 269: [ -n "$upstream_branch" ] always true on this path?