File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,11 @@ mkdir -p "${BUILD_DIR}"
1212mkdir -p " ${INCLUDE_DIR} "
1313
1414# #######################################################################
15+ # These variables specify the minimum version necessary for
16+ # dependencies between versions.
17+ source " ${CUR_DIR} " /versions.sh
1518
19+ # #######################################################################
1620# Clone the tree-sitter repos
1721repos=( tree-sitter tree-sitter-python tree-sitter-c tree-sitter-cpp tree-sitter-java)
1822
2125 dir=" ${INCLUDE_DIR} /${repo} "
2226
2327 echo " clone or update ${repo} ... "
24-
28+ LOCKED_BRANCH=" ${repo// -/ _} " _hash
29+ cd " ${CUR_DIR} "
2530 if [ -d " ${dir} " ]; then
2631 echo " pulling changes ..."
2732 # IF THE REPO ALREADY EXISTS...
2833 pushd " ${dir} "
2934
30- CURRENT_BRANCH=$( git branch --show-current)
31-
3235 # PULL CHANGES
3336 git fetch
34- git reset --hard HEAD
35- git merge " origin/${CURRENT_BRANCH} "
37+ git reset --hard " ${! LOCKED_BRANCH} "
3638
3739 popd
3840 else
3941 # THE REPO DID NOT EXIST
4042 echo " the repository did not previously exist cloning... "
41- git clone --depth 1 " https://github.com/tree-sitter/${repo} " " ${INCLUDE_DIR} /${repo} "
43+ git clone " https://github.com/tree-sitter/${repo} " " ${INCLUDE_DIR} /${repo} "
44+ pushd " ${dir} "
45+ git reset --hard " ${! LOCKED_BRANCH} "
46+ popd
4247 fi
4348done
4449
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # #######################################################################
3+
4+ # These variables specify the version of these dependencies that we
5+ # want. This affects both checking out the repo as well as installation
6+ # of built artificats.
7+
8+ # If tree sitter in the future has more consistant releases, or better ways
9+ # of locking the version, adjust this to be versions instead of commits
10+
11+ # TREE-SITTER REPOS
12+ # Python -- Merge pull request #193 from tree-sitter/tausbn/... -- Feb 28, 23
13+ export tree_sitter_python_hash=62827156d01c74dc1538266344e788da74536b8a
14+ # Tree-Sitter - Avoid unused value warning from array_pop -- Jun 14, 23
15+ export tree_sitter_hash=d0029a15273e526925a764033e9b7f18f96a7ce5
16+ # cpp -- Merge pull request #209 from amaanq/rewrite-it-in-c -- Jun 18, 23
17+ export tree_sitter_cpp_hash=2e29f23abcb5f92ddffb22de8b292f09ed78db01
18+ # C -- Merge pull request #141 from JasonBrownDeveloper/offsetof -- Jun 13, 23
19+ export tree_sitter_c_hash=f1b2a0b2102ff001a4ed9a26cd9a9405d09c590c
20+ # Java -- Merge pull request #144 from stelf/patch-1 -- April 19, 23
21+ export tree_sitter_java_hash=c194ee5e6ede5f26cf4799feead4a8f165dcf14d
You can’t perform that action at this time.
0 commit comments