File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111#
1212# Usage: check-overlay-min-version.sh [--apply] <network-protocol>
1313#
14- # Finds the commit in HEAD's history that raised the ledger protocol version
14+ # Finds the commit in HEAD's first-parent history that raised the ledger protocol version
1515# (MAX_SUPPORTED_PROTOCOL_VERSION in src/util/ProtocolVersion.h, or
1616# Config::CURRENT_LEDGER_PROTOCOL_VERSION in src/main/Config.cpp in older
1717# revisions) to <network-protocol>, and compares OVERLAY_PROTOCOL_MIN_VERSION in the
@@ -105,12 +105,14 @@ LEDGER_LOG_REGEX='(CURRENT_LEDGER|MAX_SUPPORTED)_PROTOCOL_VERSION[[:space:]]*=[[
105105OVERLAY_EXPR=' s/^[[:space:]]*OVERLAY_PROTOCOL_VERSION[[:space:]]*=[[:space:]]*\([0-9][0-9]*\).*/\1/p'
106106MIN_EXPR=' s/^[[:space:]]*OVERLAY_PROTOCOL_MIN_VERSION[[:space:]]*=[[:space:]]*\([0-9][0-9]*\).*/\1/p'
107107
108- # Print the oldest commit in HEAD's history from which the ledger protocol
109- # version has been at least $NETWORK_LEDGER.
108+ # Print the oldest commit in HEAD's first-parent history from which the ledger
109+ # protocol version has been at least $NETWORK_LEDGER. Following first parents
110+ # finds the commit (usually a PR merge) where HEAD's branch got the protocol,
111+ # not one on a PR branch whose date may be out of order with the branch's.
110112ledger_bump_commit ()
111113{
112114 FOUND=
113- for C in $( git log --format=%H -G " $LEDGER_LOG_REGEX " HEAD -- " $CONFIG_CPP " " $PROTOCOL_H " )
115+ for C in $( git log --first-parent -- format=%H -G " $LEDGER_LOG_REGEX " HEAD -- " $CONFIG_CPP " " $PROTOCOL_H " )
114116 do
115117 LEDGER=$( ledger_at " $C " )
116118 if [ " $LEDGER " -lt " $NETWORK_LEDGER " ]
You can’t perform that action at this time.
0 commit comments