You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by cm...@apache.org on 2025/12/02 22:32:16 UTC
(trafficserver) branch 10.1.x updated (f509421eb1 -> fb5894f437)
This is an automated email from the ASF dual-hosted git repository.
cmcfarlen pushed a change to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
from f509421eb1 cleanup ProxyProtocol and prevent memory leak (#12680)
new 9e7830c415 Fix proxy-verifier storage for git worktrees (#12686)
new 16b4a974fe Fix proxy-verifier path for non-worktree repositories (#12699)
new fb5894f437 various worktree fixes (#12705)
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CMakeLists.txt | 31 +++++++++++++++++++++++++------
cmake/proxy-verifier.cmake | 18 +++++++++++++-----
doc/ext/plantuml_fetch.sh | 2 +-
doc/ext/traffic-server.cmake.in.py | 6 +++---
doc/ext/traffic-server.py | 10 +++++++---
5 files changed, 49 insertions(+), 18 deletions(-)
(trafficserver) 03/03: various worktree fixes (#12705)
Posted by cm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
cmcfarlen pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit fb5894f4372d3c66adb35ff2dcb0617b087144cc
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Mon Dec 1 10:59:34 2025 -0600
various worktree fixes (#12705)
Fix pre-commit hook installation in a worktree. This also fixes a
handful of doc generation references to the .git directory to work in
worktrees as well.
(cherry picked from commit 21d895f5a195e1bfeb54f951a78874a5f7678c65)
---
CMakeLists.txt | 31 +++++++++++++++++++++++++------
cmake/proxy-verifier.cmake | 13 +++----------
doc/ext/plantuml_fetch.sh | 2 +-
doc/ext/traffic-server.cmake.in.py | 6 +++---
doc/ext/traffic-server.py | 10 +++++++---
5 files changed, 39 insertions(+), 23 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed454b9324..06dc9333e7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -89,6 +89,25 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
+# Detect git common directory (works for both regular repos and worktrees).
+if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
+ execute_process(
+ COMMAND git rev-parse --git-common-dir
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE GIT_COMMON_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE GIT_RESULT
+ ERROR_QUIET
+ )
+ if(GIT_RESULT EQUAL 0 AND GIT_COMMON_DIR)
+ # Convert to absolute path if relative.
+ if(NOT IS_ABSOLUTE ${GIT_COMMON_DIR})
+ get_filename_component(GIT_COMMON_DIR "${CMAKE_SOURCE_DIR}/${GIT_COMMON_DIR}" ABSOLUTE)
+ endif()
+ message(STATUS "Git common directory: ${GIT_COMMON_DIR}")
+ endif()
+endif()
+
# Options
include(AutoOptionHelpers)
find_package(PkgConfig)
@@ -745,8 +764,6 @@ if(ENABLE_BENCHMARKS)
add_subdirectory(tools/benchmark)
endif()
-set(GIT_COMMON_DIR git rev-parse --git-common-dir)
-
add_custom_target(
clang-format-install
COMMAND ${CMAKE_SOURCE_DIR}/tools/clang-format.sh --install
@@ -821,10 +838,12 @@ add_custom_target(
COMMENT "formatting all files"
)
-if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
- file(TIMESTAMP ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit PRE_COMMIT_BEFORE)
- configure_file(${CMAKE_SOURCE_DIR}/tools/git/pre-commit ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit COPYONLY)
- file(TIMESTAMP ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit PRE_COMMIT_AFTER)
+# Install pre-commit hook if this is a git repository (including worktrees).
+if(GIT_COMMON_DIR)
+ set(PRE_COMMIT_HOOK "${GIT_COMMON_DIR}/hooks/pre-commit")
+ file(TIMESTAMP ${PRE_COMMIT_HOOK} PRE_COMMIT_BEFORE)
+ configure_file(${CMAKE_SOURCE_DIR}/tools/git/pre-commit ${PRE_COMMIT_HOOK} COPYONLY)
+ file(TIMESTAMP ${PRE_COMMIT_HOOK} PRE_COMMIT_AFTER)
if(NOT PRE_COMMIT_BEFORE STREQUAL PRE_COMMIT_AFTER)
message(STATUS "Installing github hook")
endif()
diff --git a/cmake/proxy-verifier.cmake b/cmake/proxy-verifier.cmake
index 4febf2d98a..bb44998b12 100644
--- a/cmake/proxy-verifier.cmake
+++ b/cmake/proxy-verifier.cmake
@@ -35,16 +35,9 @@ if(NOT PROXY_VERIFIER_HASH)
message(FATAL_ERROR "PROXY_VERIFIER_HASH Required")
endif()
-# Detect the git common directory (works for both regular repos and worktrees).
-execute_process(
- COMMAND git rev-parse --git-common-dir
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_COMMON_DIR
- OUTPUT_STRIP_TRAILING_WHITESPACE
- RESULT_VARIABLE GIT_RESULT
-)
-if(NOT GIT_RESULT EQUAL 0)
- message(FATAL_ERROR "Failed to determine git common directory")
+# GIT_COMMON_DIR is set by the top-level CMakeLists.txt.
+if(NOT GIT_COMMON_DIR)
+ message(FATAL_ERROR "GIT_COMMON_DIR not set. This should be set by the top-level CMakeLists.txt")
endif()
# Convert to absolute path (handles relative .git from regular non-worktree clones).
diff --git a/doc/ext/plantuml_fetch.sh b/doc/ext/plantuml_fetch.sh
index 0990f2a2cd..501559f724 100755
--- a/doc/ext/plantuml_fetch.sh
+++ b/doc/ext/plantuml_fetch.sh
@@ -27,7 +27,7 @@ function main() {
set -e # exit on error
PACKAGE="plantuml-${PKGDATE}"
JAR="plantuml.jar"
- ROOT=${ROOT:-$(cd $(dirname $0) && git rev-parse --show-toplevel)/.git/doc-tools}
+ ROOT=${ROOT:-$(git rev-parse --git-common-dir)/doc-tools}
URL=${URL:-https://ci.trafficserver.apache.org/bintray/${PACKAGE}.${PKG_EXT}}
TAR=${TAR:-tar}
diff --git a/doc/ext/traffic-server.cmake.in.py b/doc/ext/traffic-server.cmake.in.py
index 85424cfa6b..43d4ce157f 100644
--- a/doc/ext/traffic-server.cmake.in.py
+++ b/doc/ext/traffic-server.cmake.in.py
@@ -468,9 +468,9 @@ class TrafficServerDomain(Domain):
REPO_ROOT = '@PROJECT_SOURCE_DIR@'
ts_version = '@TS_VERSION_STRING@'
-# get the current branch the local repository is on
-REPO_GIT_DIR = os.path.join(REPO_ROOT, ".git")
-git_branch = subprocess.check_output(['git', '--git-dir', REPO_GIT_DIR, 'rev-parse', '--abbrev-ref', 'HEAD'])
+# Get the current branch the local repository is on.
+# Run git from the repository root to work with both normal repos and worktrees.
+git_branch = subprocess.check_output(['git', '-C', REPO_ROOT, 'rev-parse', '--abbrev-ref', 'HEAD'])
def make_github_link(name, rawtext, text, lineno, inliner, options=None, content=None):
diff --git a/doc/ext/traffic-server.py b/doc/ext/traffic-server.py
index fb10804cf9..fa8942eec5 100644
--- a/doc/ext/traffic-server.py
+++ b/doc/ext/traffic-server.py
@@ -472,9 +472,13 @@ with open(CONFIGURE_AC, 'r') as f:
match = re.compile(r'm4_define\(\[TS_VERSION_S],\[(.*?)]\)').search(contents)
autoconf_version = '.'.join(match.group(1).split('.', 2)[:2] + ['x'])
-# get the current branch the local repository is on
-REPO_GIT_DIR = os.path.join(REPO_ROOT, ".git")
-git_branch = subprocess.check_output(['git', '--git-dir', REPO_GIT_DIR, 'rev-parse', '--abbrev-ref', 'HEAD'])
+# Get the current branch the local repository is on.
+# Run git from the repository root to work with both normal repos and worktrees.
+try:
+ git_branch = subprocess.check_output(
+ ['git', '-C', REPO_ROOT, 'rev-parse', '--abbrev-ref', 'HEAD'], stderr=subprocess.DEVNULL, text=True).strip()
+except (subprocess.CalledProcessError, FileNotFoundError):
+ git_branch = 'master'
def make_github_link(name, rawtext, text, lineno, inliner, options=None, content=None):
(trafficserver) 01/03: Fix proxy-verifier storage for git worktrees (#12686)
Posted by cm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
cmcfarlen pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 9e7830c41545f63ba46c90f2ce56e66b8716e2fd
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Fri Nov 21 14:02:26 2025 -0600
Fix proxy-verifier storage for git worktrees (#12686)
PR #12664 changed proxy-verifier storage to be in
${CMAKE_SOURCE_DIR}/.git. Sadly, this fails in git worktrees where .git
is a file pointing to the actual git directory. Use git rev-parse
--git-common-dir to dynamically detect the correct git directory, which
works for both regular repositories and worktrees. This ensures
proxy-verifier binaries are stored in a shared location accessible to
all worktrees.
(cherry picked from commit 1fc5b47ae8bbe7ebca90afb95b86b9702dd6436a)
---
cmake/proxy-verifier.cmake | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/cmake/proxy-verifier.cmake b/cmake/proxy-verifier.cmake
index 51e07beb4c..7e91d636d8 100644
--- a/cmake/proxy-verifier.cmake
+++ b/cmake/proxy-verifier.cmake
@@ -15,7 +15,7 @@
#
#######################
-# This will download and extract proxy-verifier to .git directory and setup variables to point to it.
+# This will download and extract proxy-verifier to git common directory and setup variables to point to it.
#
# Required variables:
# PROXY_VERIFIER_VERSION
@@ -35,14 +35,26 @@ if(NOT PROXY_VERIFIER_HASH)
message(FATAL_ERROR "PROXY_VERIFIER_HASH Required")
endif()
-# Download proxy-verifier to .git directory.
-set(PV_ARCHIVE ${CMAKE_SOURCE_DIR}/.git/proxy-verifier/proxy-verifier.tar.gz)
+# Detect the git common directory (works for both regular repos and worktrees).
+execute_process(
+ COMMAND git rev-parse --git-common-dir
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE GIT_COMMON_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE GIT_RESULT
+)
+if(NOT GIT_RESULT EQUAL 0)
+ message(FATAL_ERROR "Failed to determine git common directory")
+endif()
+
+# Download proxy-verifier to git common directory.
+set(PV_ARCHIVE ${GIT_COMMON_DIR}/proxy-verifier/proxy-verifier.tar.gz)
file(
DOWNLOAD https://ci.trafficserver.apache.org/bintray/proxy-verifier-${PROXY_VERIFIER_VERSION}.tar.gz ${PV_ARCHIVE}
EXPECTED_HASH ${PROXY_VERIFIER_HASH}
SHOW_PROGRESS
)
-file(ARCHIVE_EXTRACT INPUT ${PV_ARCHIVE} DESTINATION ${CMAKE_SOURCE_DIR}/.git)
+file(ARCHIVE_EXTRACT INPUT ${PV_ARCHIVE} DESTINATION ${GIT_COMMON_DIR})
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64"
@@ -70,7 +82,7 @@ else()
message(FATAL_ERROR "Host ${CMAKE_HOST_SYSTEM_NAME} doesnt support running proxy verifier")
endif()
-set(PROXY_VERIFIER_PATH ${CMAKE_SOURCE_DIR}/.git/proxy-verifier-${PROXY_VERIFIER_VERSION}/${PV_SUBDIR})
+set(PROXY_VERIFIER_PATH ${GIT_COMMON_DIR}/proxy-verifier-${PROXY_VERIFIER_VERSION}/${PV_SUBDIR})
set(PROXY_VERIFIER_CLIENT ${PROXY_VERIFIER_PATH}/verifier-client)
set(PROXY_VERIFIER_SERVER ${PROXY_VERIFIER_PATH}/verifier-server)
(trafficserver) 02/03: Fix proxy-verifier path for non-worktree repositories (#12699)
Posted by cm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
cmcfarlen pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 16b4a974fe47ea016789e31d9f9958895a3428e0
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Mon Nov 24 12:51:11 2025 -0600
Fix proxy-verifier path for non-worktree repositories (#12699)
The git rev-parse --git-common-dir command added in #12686 returns an
absolute path to the relevant .git direcotry for worktrees.
Unfortunately, it does a relative path for "regular" non-worktree
clones. Without converting to an absolute path, PROXY_VERIFIER_PATH
becomes relative and fails to resolve correctly when passed to autest.
This adds get_filename_component to ensure GIT_COMMON_DIR is always
absolute, fixing the issue for both repository types.
(cherry picked from commit e699cbe702279e7693f1c6bb2b10ddf6b84df744)
---
cmake/proxy-verifier.cmake | 3 +++
1 file changed, 3 insertions(+)
diff --git a/cmake/proxy-verifier.cmake b/cmake/proxy-verifier.cmake
index 7e91d636d8..4febf2d98a 100644
--- a/cmake/proxy-verifier.cmake
+++ b/cmake/proxy-verifier.cmake
@@ -47,6 +47,9 @@ if(NOT GIT_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to determine git common directory")
endif()
+# Convert to absolute path (handles relative .git from regular non-worktree clones).
+get_filename_component(GIT_COMMON_DIR "${GIT_COMMON_DIR}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}")
+
# Download proxy-verifier to git common directory.
set(PV_ARCHIVE ${GIT_COMMON_DIR}/proxy-verifier/proxy-verifier.tar.gz)
file(