Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
john-cai committed Sep 26, 2024
1 parent e6f3b6b commit 3d4f440
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 23 deletions.
59 changes: 43 additions & 16 deletions builtin/bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,31 @@
#include "quote.h"
#include "revision.h"

static REPO_GIT_PATH_FUNC(bisect_terms, "BISECT_TERMS")
static REPO_GIT_PATH_FUNC(bisect_ancestors_ok, "BISECT_ANCESTORS_OK")
static REPO_GIT_PATH_FUNC(bisect_start, "BISECT_START")
static REPO_GIT_PATH_FUNC(bisect_log, "BISECT_LOG")
static REPO_GIT_PATH_FUNC(bisect_names, "BISECT_NAMES")
static REPO_GIT_PATH_FUNC(bisect_first_parent, "BISECT_FIRST_PARENT")
static REPO_GIT_PATH_FUNC(bisect_run, "BISECT_RUN")
struct bisect_paths {
char *bisect_terms;
char *bisect_ancestors_ok;
char *bisect_start;
char *bisect_log;
char *bisect_names;
char *bisect_first_parent;
char *bisect_run;
}

#define BISECT_GIT_PATH_FUNC(var, filename) \
const char *git_path_##var(struct bisect_paths *paths) \

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:30:15: expected ‘;’, identifier or ‘(’ before ‘char’

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:30:21: no previous prototype for ‘git_path_bisect_terms’ [-Werror=missing-prototypes]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:30:57: parameter ‘paths’ set but not used [-Werror=unused-but-set-parameter]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:30:15: expected ‘;’, identifier or ‘(’ before ‘char’

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:30:21: no previous prototype for ‘git_path_bisect_terms’ [-Werror=missing-prototypes]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:30:57: parameter ‘paths’ set but not used [-Werror=unused-but-set-parameter]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:30:8: expected ‘;’, identifier or ‘(’ before ‘char’

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:30:14: no previous prototype for ‘git_path_bisect_terms’ [-Werror=missing-prototypes]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:30:50: parameter ‘paths’ set but not used [-Werror=unused-but-set-parameter]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:30:15: expected ‘;’, identifier or ‘(’ before ‘char’

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:30:21: no previous prototype for ‘git_path_bisect_terms’ [-Werror=missing-prototypes]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:30:57: parameter ‘paths’ set but not used [-Werror=unused-but-set-parameter]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:30:8: expected ‘;’, identifier or ‘(’ before ‘char’

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:30:14: no previous prototype for ‘git_path_bisect_terms’ [-Werror=missing-prototypes]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:30:50: parameter ‘paths’ set but not used [-Werror=unused-but-set-parameter]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:30:15: expected ';', identifier or '(' before 'char'

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:30:21: no previous prototype for 'git_path_bisect_terms' [-Werror=missing-prototypes]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:30:57: parameter 'paths' set but not used [-Werror=unused-but-set-parameter]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:30:8: expected ';', identifier or '(' before 'char'

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:30:14: no previous prototype for 'git_path_bisect_terms' [-Werror=missing-prototypes]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:30:50: parameter 'paths' set but not used [-Werror=unused-but-set-parameter]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:30:15: expected ';', identifier or '(' before 'char'

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:30:21: no previous prototype for 'git_path_bisect_terms' [-Werror=missing-prototypes]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:30:57: parameter 'paths' set but not used [-Werror=unused-but-set-parameter]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:30:15: expected ';', identifier or '(' before 'char'

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:30:21: no previous prototype for 'git_path_bisect_terms' [-Werror=missing-prototypes]

Check failure on line 30 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:30:57: parameter 'paths' set but not used [-Werror=unused-but-set-parameter]
{ \
if (!paths.var) \

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:32:27: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:32:27: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:32:27: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:32:27: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:32:13: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:32:13: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:32:27: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:32:27: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:32:13: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:32:13: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:32:27: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:32:27: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:32:13: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:32:13: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:32:27: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:32:27: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:32:27: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 32 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:32:27: 'paths' is a pointer; did you mean to use '->'?
paths.var = repo_git_path(r, filename); \

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:33:30: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:33:51: ‘r’ undeclared (first use in this function)

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:33:30: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:33:30: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:33:51: ‘r’ undeclared (first use in this function)

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:33:30: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:33:9: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:33:30: ‘r’ undeclared (first use in this function)

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:33:9: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:33:30: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:33:51: ‘r’ undeclared (first use in this function)

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:33:30: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:33:9: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:33:30: ‘r’ undeclared (first use in this function)

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:33:9: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:33:30: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:33:51: 'r' undeclared (first use in this function)

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:33:30: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:33:9: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:33:30: 'r' undeclared (first use in this function)

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:33:9: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:33:30: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:33:51: 'r' undeclared (first use in this function)

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:33:30: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:33:30: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:33:51: 'r' undeclared (first use in this function)

Check failure on line 33 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:33:30: 'paths' is a pointer; did you mean to use '->'?
return paths.var; \

Check failure on line 34 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:34:29: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 34 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:34:29: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 34 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:34:15: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 34 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:34:29: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 34 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:34:15: ‘paths’ is a pointer; did you mean to use ‘->’?

Check failure on line 34 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:34:29: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 34 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:34:15: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 34 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:34:29: 'paths' is a pointer; did you mean to use '->'?

Check failure on line 34 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:34:29: 'paths' is a pointer; did you mean to use '->'?
}

static BISECT_GIT_PATH_FUNC(bisect_terms, "BISECT_TERMS")

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable-leaks (ubuntu-latest)

builtin/bisect.c:37:1: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-leaks (ubuntu-latest)

builtin/bisect.c:37:1: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc (ubuntu-20.04)

builtin/bisect.c:37:1: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-gcc-default (ubuntu-latest)

builtin/bisect.c:37:1: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:37:8: cannot combine with previous 'struct' declaration specifier

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:37:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:37:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:37:8: use of undeclared identifier 'r'

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:37:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:37:8: incompatible pointer types returning 'char *' from a function with result type 'const struct bisect_paths *' [-Werror,-Wincompatible-pointer-types]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:37:8: cannot combine with previous 'struct' declaration specifier

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:37:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:37:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:37:8: use of undeclared identifier 'r'

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:37:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:37:8: incompatible pointer types returning 'char *' from a function with result type 'const struct bisect_paths *' [-Werror,-Wincompatible-pointer-types]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-TEST-vars (ubuntu-20.04)

builtin/bisect.c:37:1: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-musl (alpine)

builtin/bisect.c:37:1: 'static' is not at beginning of declaration [-Werror=old-style-declaration]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:37:8: cannot combine with previous 'struct' declaration specifier

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:37:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:37:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:37:8: use of undeclared identifier 'r'

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:37:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:37:8: incompatible pointer types returning 'char *' from a function with result type 'const struct bisect_paths *' [-Werror,-Wincompatible-pointer-types]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux32 (i386/ubuntu:focal)

builtin/bisect.c:37:1: 'static' is not at beginning of declaration [-Werror=old-style-declaration]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / pedantic (fedora)

builtin/bisect.c:37:1: 'static' is not at beginning of declaration [-Werror=old-style-declaration]

Check failure on line 37 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / win build

builtin/bisect.c:37:1: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
static BISECT_GIT_PATH_FUNC(bisect_ancestors_ok, "BISECT_ANCESTORS_OK")

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:38:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:38:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:38:8: use of undeclared identifier 'r'

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-reftable (ubuntu-latest)

builtin/bisect.c:38:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:38:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:38:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:38:8: use of undeclared identifier 'r'

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-sha256 (ubuntu-latest)

builtin/bisect.c:38:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:38:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:38:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:38:8: use of undeclared identifier 'r'

Check failure on line 38 in builtin/bisect.c

View workflow job for this annotation

GitHub Actions / linux-asan-ubsan (ubuntu-latest)

builtin/bisect.c:38:8: member reference type 'struct bisect_paths *' is a pointer; did you mean to use '->'?
static BISECT_GIT_PATH_FUNC(bisect_start, "BISECT_START")
static BISECT_GIT_PATH_FUNC(bisect_log, "BISECT_LOG")
static BISECT_GIT_PATH_FUNC(bisect_names, "BISECT_NAMES")
static BISECT_GIT_PATH_FUNC(bisect_first_parent, "BISECT_FIRST_PARENT")
static BISECT_GIT_PATH_FUNC(bisect_run, "BISECT_RUN")

#define BUILTIN_GIT_BISECT_START_USAGE \
N_("git bisect start [--term-(new|bad)=<term> --term-(old|good)=<term>]" \
Expand Down Expand Up @@ -282,8 +300,12 @@ static void log_commit(struct repository *repo,
free(label);
}

static int bisect_write(struct repository *repo, const char *state, const char *rev,
const struct bisect_terms *terms, int nolog)
static int bisect_write(struct repository *repo,
const char *bisect_log_path,
const char *state,
const char *rev,
const struct bisect_terms *terms,
int nolog)
{
struct strbuf tag = STRBUF_INIT;
struct object_id oid;
Expand Down Expand Up @@ -311,7 +333,7 @@ static int bisect_write(struct repository *repo, const char *state, const char *
goto finish;
}

fp = fopen(git_path_bisect_log(repo), "a");
fp = fopen(bisect_log_path, "a");
if (!fp) {
res = error_errno(_("couldn't open the file '%s'"), git_path_bisect_log(repo));
goto finish;
Expand Down Expand Up @@ -481,13 +503,14 @@ static int bisect_next_check(struct repository *repo,
return decide_next(repo, terms, current_term, !state.nr_good, !state.nr_bad);
}

static int get_terms(struct repository *repo, struct bisect_terms *terms)
static int get_terms(const char *bisect_terms_path,
struct bisect_terms *terms)
{
struct strbuf str = STRBUF_INIT;
FILE *fp = NULL;
int res = 0;

fp = fopen(git_path_bisect_terms(repo), "r");
fp = fopen(bisect_terms_path, "r");
if (!fp) {
res = -1;
goto finish;
Expand All @@ -507,10 +530,11 @@ static int get_terms(struct repository *repo, struct bisect_terms *terms)
}

static int bisect_terms(struct repository *repo,
const char *bisect_terms_path,
struct bisect_terms *terms,
const char *option)
{
if (get_terms(repo, terms))
if (get_terms(bisect_terms_path, terms))
return error(_("no terms defined"));

if (!option) {
Expand Down Expand Up @@ -706,6 +730,7 @@ static enum bisect_error bisect_auto_next(struct repository *repo,
}

static enum bisect_error bisect_start(struct repository *repo,
const char *bisect_log_path,
struct bisect_terms *terms,
int argc,
const char **argv)
Expand Down Expand Up @@ -878,7 +903,7 @@ static enum bisect_error bisect_start(struct repository *repo,
write_file(git_path_bisect_names(repo), "%s\n", bisect_names.buf);

for (i = 0; i < states.nr; i++)
if (bisect_write(repo, states.items[i].string,
if (bisect_write(repo, bisect_log_path, states.items[i].string,
revs.items[i].string, terms, 1)) {
res = BISECT_FAILED;
goto finish;
Expand Down Expand Up @@ -1057,7 +1082,7 @@ static int process_replay_line(struct repository *repo,
rev = word_end + strspn(word_end, " \t");
*word_end = '\0'; /* NUL-terminate the word */

get_terms(repo, terms);
get_terms(bisect_terms_path, terms);
if (check_and_set_terms(repo, terms, p))
return -1;

Expand Down Expand Up @@ -1366,11 +1391,13 @@ static int cmd_bisect__terms(struct repository *repo,
{
int res;
struct bisect_terms terms = { 0 };
struct bisect_paths paths = { 0 };
const char *bisect_terms_path = repo_git_path(r, filename)

if (argc > 1)
return error(_("'%s' requires 0 or 1 argument"),
"git bisect terms");
res = bisect_terms(repo, &terms, argc == 1 ? argv[0] : NULL);
res = bisect_terms(repo, &terms, argc == 1 ? argv[0] : NULL, paths);
free_terms(&terms);
return res;
}
Expand Down
7 changes: 0 additions & 7 deletions repository.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ struct repo_path_cache {
char *merge_head;
char *fetch_head;
char *shallow;
char *bisect_terms;
char *bisect_ancestors_ok;
char *bisect_start;
char *bisect_log;
char *bisect_names;
char *bisect_first_parent;
char *bisect_run;
};

struct repository {
Expand Down

0 comments on commit 3d4f440

Please sign in to comment.