Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[git] Git subtree install option #1144

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/git/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "git",
"version": "1.3.2",
"version": "1.3.3",
"name": "Git (from source)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/git",
"description": "Install an up-to-date version of Git, built from source as needed. Useful for when you want the latest and greatest features. Auto-detects latest stable version and installs needed dependencies.",
Expand All @@ -19,6 +19,11 @@
"type": "boolean",
"default": true,
"description": "Install from PPA if available (only supported for Ubuntu distributions)"
},
"installSubtree": {
"type": "boolean",
"default": false,
"description": "Install git/contrib/subtree"
}
},
"installsAfter": [
Expand Down
6 changes: 6 additions & 0 deletions src/git/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

GIT_VERSION=${VERSION} # 'system' checks the base image first, else installs 'latest'
USE_PPA_IF_AVAILABLE=${PPA}
INSTALL_SUBTREE="${INSTALLSUBTREE:-"true"}"

GIT_CORE_PPA_ARCHIVE_GPG_KEY=E1DD270288B4E6030699E45FA1715D88E1DF1F24

Expand Down Expand Up @@ -309,6 +310,11 @@ if [ "${ADJUSTED_ID}" = "alpine" ]; then
git_options+=("NO_GETTEXT=YesPlease")
fi
make -s "${git_options[@]}" all && make -s "${git_options[@]}" install 2>&1
if [[ $INSTALL_SUBTREE = "true" ]]; then
cd contrib/subtree/
make && make install && make install-doc && cp git-subtree ../.. 2>&1
cd ../../
fi
rm -rf /tmp/git-${GIT_VERSION}
clean_up
echo "Done!"