From 9cb5df42d2bab6a5bbce5073efd458de147233a7 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Jan 2017 18:47:16 -0600 Subject: [PATCH 1/2] properly detect version when building out of tree --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c0f3258da..9d4b2f40f 100644 --- a/configure.ac +++ b/configure.ac @@ -31,8 +31,8 @@ AX_EXTEND_SRCDIR AS_IF([test -d ${srcdir}/.git], [ - VERSION="$(git describe --tags --abbrev=0)" - I3_VERSION="$(git describe --tags --always) ($(git log --pretty=format:%cd --date=short -n1), branch \\\"$(git describe --tags --always --all | sed s:heads/::)\\\")" + VERSION="$(git -C ${srcdir} describe --tags --abbrev=0)" + I3_VERSION="$(git -C ${srcdir} describe --tags --always) ($(git -C ${srcdir} log --pretty=format:%cd --date=short -n1), branch \\\"$(git -C ${srcdir} describe --tags --always --all | sed s:heads/::)\\\")" # Mirrors what libi3/is_debug_build.c does: is_release=$(test $(echo "${I3_VERSION}" | cut -d '(' -f 1 | wc -m) -lt 10 && echo yes || echo no) ], From 934b23fa52dd404d29970cd083d411f5e7b52263 Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Mon, 9 Jan 2017 18:43:38 -0600 Subject: [PATCH 2/2] fix auto exclude in-work-tree build dirs updates: -- configure: add build directory to gitignore #2543 -- https://github.com/i3/i3/pull/2543 --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 9d4b2f40f..4f67d5ea8 100644 --- a/configure.ac +++ b/configure.ac @@ -154,8 +154,9 @@ else print_BUILD_MANS=no fi -git_dir=`git rev-parse --git-dir 2>/dev/null` -if test -n "$git_dir"; then +in_git_worktree=`git rev-parse --is-inside-work-tree 2>/dev/null` +if "$in_git_worktree" == "true"; then + git_dir=`git rev-parse --git-dir 2>/dev/null` srcdir=`dirname "$git_dir"` exclude_dir=`pwd | sed "s,^$srcdir,,g"` if ! grep -q "^$exclude_dir" "$git_dir/info/exclude"; then