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

0.4.9 #628

Merged
merged 2 commits into from
Jul 25, 2024
Merged

0.4.9 #628

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
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
version: 0.4.9
date: Mon 25 Jul 2024 11:23:34 AM CST
- Revert Fix bash-completion due to not being compatible with Windows
---
version: 0.4.8
date: Mon 22 Jul 2024 07:40:00 AM CST
- Remove all subrepo refs with clean --force
Expand Down
29 changes: 11 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SHELL := bash
INSTALL ?= install

# Make sure we have git:
ifeq ($(shell which git),)
Expand All @@ -18,11 +17,9 @@ SHARE = share

# Install variables:
PREFIX ?= /usr/local
INSTALL_BIN ?= $(PREFIX)/bin
INSTALL_LIB ?= $(PREFIX)/share/$(NAME)
INSTALL_LIB ?= $(DESTDIR)$(shell git --exec-path)
INSTALL_EXT ?= $(INSTALL_LIB)/$(NAME).d
INSTALL_MAN1 ?= $(PREFIX)/share/man/man1
LINK_REL_DIR := $(shell realpath --relative-to=$(INSTALL_BIN) $(INSTALL_LIB))
INSTALL_MAN1 ?= $(DESTDIR)$(PREFIX)/share/man/man1

# Docker variables:
DOCKER_TAG ?= 0.0.6
Expand Down Expand Up @@ -63,22 +60,18 @@ $(DOCKER_TESTS):

# Install support:
install:
$(INSTALL) -d -m 0755 $(DESTDIR)$(INSTALL_LIB)/
$(INSTALL) -C -m 0755 $(LIB) $(DESTDIR)$(INSTALL_LIB)/
sed -i 's!^SUBREPO_EXT_DIR=.*!SUBREPO_EXT_DIR=$(INSTALL_EXT)!' $(DESTDIR)$(INSTALL_LIB)/$(NAME)
$(INSTALL) -d -m 0755 $(DESTDIR)$(INSTALL_BIN)
ln -s $(LINK_REL_DIR)/$(NAME) $(DESTDIR)$(INSTALL_BIN)/$(NAME)
$(INSTALL) -d -m 0755 $(DESTDIR)$(INSTALL_EXT)/
$(INSTALL) -C -m 0644 $(EXTS) $(DESTDIR)$(INSTALL_EXT)/
$(INSTALL) -d -m 0755 $(DESTDIR)$(INSTALL_MAN1)/
$(INSTALL) -C -m 0644 $(MAN1)/$(NAME).1 $(DESTDIR)$(INSTALL_MAN1)/
install -d -m 0755 $(INSTALL_LIB)/
install -C -m 0755 $(LIB) $(INSTALL_LIB)/
install -d -m 0755 $(INSTALL_EXT)/
install -C -m 0644 $(EXTS) $(INSTALL_EXT)/
install -d -m 0755 $(INSTALL_MAN1)/
install -C -m 0644 $(MAN1)/$(NAME).1 $(INSTALL_MAN1)/

# Uninstall support:
uninstall:
rm -f $(DESTDIR)$(INSTALL_BIN)/$(NAME)
rm -fr $(DESTDIR)$(INSTALL_EXT)
rm -fr $(DESTDIR)$(INSTALL_LIB)
rm -f $(DESTDIR)$(INSTALL_MAN1)/$(NAME).1
rm -f $(INSTALL_LIB)/$(NAME)
rm -fr $(INSTALL_EXT)
rm -f $(INSTALL_MAN1)/$(NAME).1

env:
@echo "export PATH=\"$$PWD/lib:\$$PATH\""
Expand Down
2 changes: 1 addition & 1 deletion Meta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=meta: 0.0.2

name: git-subrepo
version: 0.4.8
version: 0.4.9
abstract: Git Submodule Alternative
homepage: https://github.com/ingydotnet/git-subrepo#readme
license: MIT
Expand Down
23 changes: 18 additions & 5 deletions lib/git-subrepo
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,25 @@ set -e
export FILTER_BRANCH_SQUELCH_WARNING=1

# Import Bash+ helper functions:
SUBREPO_EXT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")/git-subrepo.d" # replaced by `make install`
source "${SUBREPO_EXT_DIR}/bash+.bash"
SOURCE=${BASH_SOURCE[0]}
while [[ -h $SOURCE ]]; do
DIR=$( cd -P "$( dirname "$SOURCE" )" && pwd )
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
done
SOURCE_DIR=$(dirname "$SOURCE")

if [[ -z $GIT_SUBREPO_ROOT ]]; then
# If `make install` installation used:
source "${SOURCE_DIR}/git-subrepo.d/bash+.bash"
else
# If `source .rc` method used:
source "${SOURCE_DIR}/../ext/bashplus/lib/bash+.bash"
fi
bash+:import :std can version-check


VERSION=0.4.8
VERSION=0.4.9
REQUIRED_BASH_VERSION=4.0
REQUIRED_GIT_VERSION=2.7.0
GIT_TMP=$(git rev-parse --git-common-dir 2> /dev/null || echo .git)/tmp
Expand Down Expand Up @@ -384,7 +397,7 @@ command:config() {

# Launch the manpage viewer:
command:help() {
source "${SUBREPO_EXT_DIR}/help-functions.bash"
source "${SOURCE_DIR}/git-subrepo.d/help-functions.bash"
local cmd=${command_arguments[0]}
if [[ $cmd ]]; then
if can "help:$cmd"; then
Expand Down Expand Up @@ -1974,7 +1987,7 @@ OK() {
usage-error() {
local msg="git-subrepo: $1" usage=
if [[ $GIT_SUBREPO_TEST_ERRORS != true ]]; then
source "${SUBREPO_EXT_DIR}/help-functions.bash"
source "${SOURCE_DIR}/git-subrepo.d/help-functions.bash"
if can "help:$command"; then
msg=$'\n'"$msg"$'\n'"$("help:$command")"$'\n'
fi
Expand Down
Loading