Diffstat (limited to 'helpers')
1 files changed, 36 insertions, 2 deletions
diff --git a/helpers/llvm-env b/helpers/llvm-env
index d90c767..c45fb2e 100755
@@ -20,14 +20,48 @@ if [ -z "$PS1" ]; then
+ # FIXME:
+ # Ideally we would just use git for this (I think git 2.7-ish should suffice),
+ # but I'm currently stuck with git 2.5 on my Ubuntu and it seems to me the
+ # rest of the team is on older gits too. Until we all move to a smarter git,
+ # we're going to use the simplest possible implementation that can give us
+ # what we want (the proper way to do this ofc would be to inspect
+ # $GITDIR/worktrees/). This implementation has the disadvantage that it may
+ # give false positives or false negatives if you do naughty things with your
+ # $LLVM_ROOT.
+ pushdq $LLVM_ROOT
+ for dir in *; do
+ if [ -d "$dir" -a "$dir" != "repos" -a -d "$dir/llvm" ]; then
+ pushdq $dir/llvm
+ if [ "$current_worktree" = $LLVM_ROOT/$dir/llvm ]; then
+ echo "[ Worktree: $dir ($branch) ]"
+ echo "Wortkree: $dir ($branch)"
if [ "$1" = "" ]; then
if [ -z "$LLVM_SRC" ]; then
- echo "You haven't set up a worktree"
+ echo "You haven't set up an env (LLVM_SRC is empty)"
worktree=`basename $(readlink -m $LLVM_SRC/../)`
- echo $worktree
+ list_worktrees $LLVM_SRC
elif [ "$1" = "-h" ]; then
echo "Usage: $0 <branch> [-cleanup] [-d]"