Skip to content

Commit 8507bf8

Browse files
committed
trace: always enabled
There's no need to make tracing opt-in; it should always be included.
1 parent 780faa4 commit 8507bf8

File tree

5 files changed

+0
-38
lines changed

5 files changed

+0
-38
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ OPTION(THREADSAFE "Build libgit2 as threadsafe" ON)
4141
OPTION(BUILD_TESTS "Build Tests using the Clar suite" ON)
4242
OPTION(BUILD_EXAMPLES "Build library usage example apps" OFF)
4343
OPTION(BUILD_FUZZERS "Build the fuzz targets" OFF)
44-
OPTION(ENABLE_TRACE "Enables tracing support" ON)
4544
OPTION(LIBGIT2_FILENAME "Name of the produced binary" OFF)
4645
OPTION(USE_SSH "Link with libssh2 to enable SSH support" ON)
4746
OPTION(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON)

src/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ SET(LIBGIT2_LIBS "")
3737

3838
enable_warnings(missing-declarations)
3939

40-
# Enable tracing
41-
IF(ENABLE_TRACE)
42-
SET(GIT_TRACE 1)
43-
ENDIF()
44-
ADD_FEATURE_INFO(tracing GIT_TRACE "tracing support")
45-
4640
IF (HAVE_FUTIMENS)
4741
SET(GIT_USE_FUTIMENS 1)
4842
ENDIF ()

src/features.h.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#cmakedefine GIT_DEBUG_STRICT_ALLOC 1
66
#cmakedefine GIT_DEBUG_STRICT_OPEN 1
77

8-
#cmakedefine GIT_TRACE 1
98
#cmakedefine GIT_THREADS 1
109
#cmakedefine GIT_WIN32_LEAKCHECK 1
1110

src/trace.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,15 @@
1111
#include "runtime.h"
1212
#include "git2/trace.h"
1313

14-
#ifdef GIT_TRACE
15-
1614
struct git_trace_data git_trace__data = {0};
1715

18-
#endif
19-
2016
int git_trace_set(git_trace_level_t level, git_trace_cb callback)
2117
{
22-
#ifdef GIT_TRACE
2318
GIT_ASSERT_ARG(level == 0 || callback != NULL);
2419

2520
git_trace__data.level = level;
2621
git_trace__data.callback = callback;
2722
GIT_MEMORY_BARRIER;
2823

2924
return 0;
30-
#else
31-
GIT_UNUSED(level);
32-
GIT_UNUSED(callback);
33-
34-
git_error_set(GIT_ERROR_INVALID,
35-
"this version of libgit2 was not built with tracing.");
36-
return -1;
37-
#endif
3825
}

src/trace.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#include <git2/trace.h>
1313
#include "str.h"
1414

15-
#ifdef GIT_TRACE
16-
1715
struct git_trace_data {
1816
git_trace_level_t level;
1917
git_trace_cb callback;
@@ -50,19 +48,4 @@ GIT_INLINE(void) git_trace(git_trace_level_t level, const char *fmt, ...)
5048
}
5149
}
5250

53-
#else
54-
55-
GIT_INLINE(void) git_trace__null(
56-
git_trace_level_t level,
57-
const char *fmt, ...)
58-
{
59-
GIT_UNUSED(level);
60-
GIT_UNUSED(fmt);
61-
}
62-
63-
#define git_trace_level() ((git_trace_level_t)0)
64-
#define git_trace git_trace__null
65-
66-
#endif
67-
6851
#endif

0 commit comments

Comments
 (0)