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

[pull] master from ingydotnet:master #4

Open
wants to merge 115 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
b6fa936
Travis CI not checking out a branch.
mupdt May 21, 2018
b1b93d7
Fixed typo
matteodg May 24, 2019
99e46df
Fix typos
chetan51 Feb 7, 2017
d34e6ea
Simplify finding subrepos
jamezpolley Apr 8, 2019
9fdd710
Make subrepo work when run in a worktree
erijo May 24, 2019
a1804b6
Fix #410 Push empty repositories with recent git versions
admorgan Jul 19, 2019
a0c967d
Make “git subrepo clean -f ...” delete refs correctly
jrosdahl Dec 4, 2019
c9895df
Use topo-order in subrepo branch
admorgan Dec 27, 2019
211f61e
Correct error message in branch
admorgan Dec 11, 2019
d834b73
Update version requirement documentation
admorgan Dec 16, 2019
3c29c54
Doc: fix sentence repetition
jersou Feb 13, 2019
61efde0
Ask git to find the .gitrepo files
jamezpolley Sep 29, 2017
cafe658
Remove conflicting -C from install -d commands.
MarkCallow Jul 1, 2019
47eebd7
Add testing on MacOS
admorgan Dec 16, 2019
59c1cc9
Don't use XXX in perl stuff
ingydotnet Jan 9, 2020
b749f52
Force `make update` to always update docs
ingydotnet Jan 9, 2020
89baa75
Update the docs
ingydotnet Jan 9, 2020
0f76a89
Wrap a long line
ingydotnet Jan 9, 2020
8346a8a
Nicer YAML formatting in .travis.yml
ingydotnet Jan 9, 2020
27f51ea
Fix Bash version error messages and add to .rc
ingydotnet Jan 9, 2020
cb590c0
Update copyright year and repo url
ingydotnet Jan 9, 2020
a04d8c2
Release 0.4.1
admorgan Jan 9, 2020
68d1810
Avoid git filter-branch delay
mvz Jan 15, 2020
7766c8e
Fix error when sourcing .rc with old zsh version
jrosdahl Mar 9, 2020
e0871b2
Add a fish shell startup script
nuxeh Mar 18, 2020
6ae32d0
Add manpage path to MANPATH for fish shell
nuxeh Mar 18, 2020
a00bacd
Fix fish.rc file to work on mac os
olfway Apr 4, 2020
ae643a6
Don't suppress stderr when git merge fails
Mar 20, 2020
7daca37
Fix unreliable branch existence check
Apr 16, 2020
b0f50f0
Use correct environment variable to stop filter-branch delay
mvz Mar 27, 2020
a0dc930
Use --date=default in all git log commands (Fixes #383)
May 20, 2020
7cfc4d0
Allow test to run without a git checkout
Jul 23, 2020
7635496
zsh completion: Remove check for GIT_SUBREPO_ROOT
perlpunk Jun 3, 2020
f887ac8
Fix documentation regarding merge/rebase
perlpunk Jun 24, 2020
b4ae4ae
Fix get-upstream-head-branch
perlpunk Aug 26, 2020
b6001a1
git subrepo pull ext/bashplus
admorgan Aug 27, 2020
2f5f0d3
git subrepo pull ext/test-more-bash
admorgan Sep 8, 2020
ac6d333
Support spaces in subrepo path
admorgan Aug 27, 2020
983c864
Make test directory modifcation easier
admorgan Sep 8, 2020
94e3016
Add support for --force in pull
admorgan Sep 11, 2020
849ecca
Add a .gitignore file and ignore /test/tmp/
ingydotnet Oct 30, 2020
ea91765
Add a shellcheck.t test to lint all shell files
ingydotnet Oct 30, 2020
ecd0562
Remove useless double quotes for assignments
ingydotnet Oct 30, 2020
547b737
Remove -n from conditional tests
ingydotnet Oct 30, 2020
de905c3
Remove most " from inside [[ ... ]]
ingydotnet Oct 30, 2020
b2df637
Change '! ... ==' to '!='
ingydotnet Oct 30, 2020
895d2dd
Skip broken test for now
ingydotnet Oct 30, 2020
9ae82ca
Replace backtick expressions with $(...)
ingydotnet Oct 30, 2020
b1cf000
Double-quote variables used in command arguments
ingydotnet Oct 30, 2020
e5250fe
More shellcheck fixes regarding quoting
ingydotnet Oct 30, 2020
684cec8
Remove fake shebangs used as hints to shellcheck
ingydotnet Oct 30, 2020
582bc42
Various minor adjustments suggested by shellcheck
ingydotnet Oct 30, 2020
9334199
Deal with "unused" variables reported by shellcheck
ingydotnet Oct 30, 2020
30a66cc
Refactor printf according to shellcheck
ingydotnet Oct 30, 2020
90c1b32
Fix minor bugs flagged by shellcheck
ingydotnet Oct 30, 2020
92ec194
Return from subprocess if cd fails (per shellcheck)
ingydotnet Oct 30, 2020
fb39023
Don't use local for assigning process output
ingydotnet Oct 30, 2020
4aef65e
Require shellcheck 0.7.1 for test/shellcheck.t
ingydotnet Oct 30, 2020
95149a1
Fix tests on Mac
ingydotnet Oct 30, 2020
9d65cdd
Fix a travis Mac problem
ingydotnet Oct 31, 2020
e3be73c
Add a Docker testing system for all bash versions
ingydotnet Nov 2, 2020
20e8843
Use `set -u` and `set -o pipefail`
ingydotnet Nov 1, 2020
cf134da
Allow Bash 4.0
ingydotnet Nov 11, 2020
f8d67ea
git subrepo pull ext/bashplus
ingydotnet Nov 11, 2020
70328a8
git subrepo pull ext/test-more-bash
ingydotnet Nov 11, 2020
6f871f0
Pull didn't fail on history disconnect
admorgan Nov 12, 2020
5230dda
git subrepo pull ext/bashplus
ingydotnet Nov 15, 2020
0f9ddd8
Make `make docker-test` work with various git versions
ingydotnet Nov 15, 2020
f4aac8c
Support GitHub actions testing...
ingydotnet Nov 16, 2020
fc061b2
Release 0.4.2
admorgan Nov 17, 2020
65fde50
Add Austin Morgan to authors list
ingydotnet Nov 17, 2020
9913b95
The `fpath` variable is an array; expand correctly
ne-sachirou Nov 18, 2020
b562f93
Release 0.4.3
ingydotnet Nov 21, 2020
2f68596
Better format for options
ingydotnet Nov 25, 2020
94ac575
Fix .rc and enable-completion.sh for zsh before 5.1
ingydotnet Feb 7, 2021
87ee373
pass --force to git add so a user's global .gitignore does not affect…
falken42 Feb 21, 2021
4d3dbea
fix tests to support use of a default branch git config that is not "…
falken42 Feb 20, 2021
df97516
Fix documentation links
admorgan Jun 29, 2021
be9f02a
Don't allow -b and --all
admorgan Jun 30, 2021
b4ae8f1
Fix git subrepo status command for subrepos that share a common prefi…
cciocov Jun 15, 2021
1b06cbf
Add --file option
admorgan Aug 8, 2022
aa416e4
Release 0.4.5
admorgan Sep 23, 2022
84854b2
Do not depend on main repo for status tests
mvz Apr 14, 2020
dbb99be
Remove branch creation from GitHub Action
mvz Oct 21, 2022
c14bf41
Remove worktree in push
DanielBauten Aug 27, 2020
89f5660
Remove unneeded worktree on push
DanielBauten Aug 27, 2020
3994d70
Add test for empty push
bindreams Apr 14, 2023
110b9eb
Release 0.4.6
admorgan Apr 21, 2023
73a0129
docs: Replace 404'ed hyperlink with archive.org equivalent
hyperupcall Dec 13, 2023
b7bcec5
Update status in the ReadMe
admorgan May 31, 2024
88393fe
Fix quoting
admorgan Dec 21, 2023
58ecf02
Fix error tests on git 2.30 and higher
admorgan Jul 2, 2024
09944c2
Address git 2.33 and later pull strategy
admorgan Jul 7, 2024
a857b16
Update git versions
admorgan Jul 7, 2024
1041053
Use docker tests instead of running on base image
admorgan Dec 21, 2023
feac147
Release 0.4.7
admorgan Jul 7, 2024
5a6c3c2
Bugfix: Missing refs not removed properly when using clean with --force
Totalus Jan 26, 2024
70b31ab
Update error function to allow multiple arguments
jrandall Jul 1, 2021
c9ec2a6
Fix quoting in the error function
admorgan Jul 9, 2024
b03bf53
Make reclone with implicit branch update branch in .gitrepo correctly
jrosdahl Dec 4, 2019
cc0e29f
Show clearer error message when subrepo_parent is not an ancestor of …
OskiKervinen-MF Jul 19, 2019
e7411ba
Add context for missing parent error message
admorgan Jul 10, 2024
555ade4
Use configured default branch for subrepo init
admorgan Jul 11, 2024
6a00f6a
Add test for missing parent error
admorgan Jul 11, 2024
477915a
Add --force to the fetch command
admorgan Jul 16, 2024
eb9f874
Removed hashbangs from sourced-only files
spog Jun 23, 2024
5453dff
Removed executable permission on sourced-only files
spog Jun 23, 2024
7816a57
Fixed bash-completion integration with git
spog Jun 23, 2024
3a53c20
Release 0.4.8
admorgan Jul 22, 2024
8eacfe4
Revert "Fixed bash-completion integration with git"
admorgan Jul 25, 2024
ea10886
Release 0.4.9
admorgan Jul 25, 2024
55a050a
Fix subrepo init failing if defaultbranch not set
admorgan Sep 9, 2024
57de7d6
Support older versions of git for subrep init
admorgan Sep 9, 2024
b00d41b
Include message file in error resolution
admorgan Oct 7, 2024
cce3d93
Update copyright year
dkt01 Sep 23, 2024
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
20 changes: 20 additions & 0 deletions .fish.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!fish

#------------------------------------------------------------------------------
#
# This is the `git-subrepo` initialization script.
#
# This script turns on the `git-subrepo` Git subcommand and its manpages, for
# the *Fish* shell.
#
# Just add a line like this to your `~/.config/fish/config.fish`:
#
# source /path/to/git-subrepo/.fish.rc
#
#------------------------------------------------------------------------------

set GIT_SUBREPO_ROOT (dirname (realpath (status --current-filename)))
set PATH $GIT_SUBREPO_ROOT/lib $PATH

set -q MANPATH || set MANPATH ''
set MANPATH $MANPATH $GIT_SUBREPO_ROOT/man
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v2
- if: startsWith(matrix.os, 'macos')
run: brew install bash
- run:
git config --global user.email "[email protected]";
git config --global user.name "Your Name";
git config --global init.defaultBranch "master";
git config --global --add safe.directory "$PWD";
git config --global --add safe.directory "$PWD.git";
- if: startsWith(matrix.os, 'macos')
run: make test
- if: startsWith(matrix.os, 'ubuntu')
run: make docker-tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/test/tmp/
11 changes: 9 additions & 2 deletions .rc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!bash
# shellcheck shell=bash disable=2128

#------------------------------------------------------------------------------
#
Expand All @@ -16,10 +16,17 @@
[[ -n ${ZSH_VERSION-} ]] &&
GIT_SUBREPO_ROOT=$0 ||
GIT_SUBREPO_ROOT=$BASH_SOURCE

[[ $GIT_SUBREPO_ROOT =~ ^/ ]] ||
GIT_SUBREPO_ROOT=$PWD/$GIT_SUBREPO_ROOT
export GIT_SUBREPO_ROOT=$(cd "$(dirname "$GIT_SUBREPO_ROOT")"; pwd)

GIT_SUBREPO_ROOT=$(
cd "$(dirname "$GIT_SUBREPO_ROOT")" || return
pwd
) || return
export GIT_SUBREPO_ROOT

export PATH=$GIT_SUBREPO_ROOT/lib:$PATH
export MANPATH=$GIT_SUBREPO_ROOT/man:$MANPATH

source "$GIT_SUBREPO_ROOT/share/enable-completion.sh"
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

89 changes: 89 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,92 @@
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
- Allow the error() function to accept multiple arguments
- Bug fixed where clone --force could change the tracked branch
- Give a detailed error message if the parent SHA could not be found
- Use the git configuration to determine the default branch name for the init command
- Add --force to fetch command
- Fix executable settings on installed files
- Remove shebangs from library only files
- Fix bash-completion for instances that used make install
---
version: 0.4.7
date: Sun 7 Jul 2024 11:04:00 AM EST
- Convert testing to use docker with updated git versions
- Fix numerous places where quoting was incorrect causing path name collisions
- Fix pull-force test to deal with git not defaulting to merges on pulls after 2.33
- Fix issue where docker tests didn't work with git 2.30 or higher because of
increased permission scrutiny.
- Update readme to say this tools is in production environments
- Update readme to use internet archive for old articles about subrepo no longer
available on their original source
---
version: 0.4.6
date: Fri 21 Apr 2023 10:18:34 AM EST
- Remove stale worktrees in the push command
---
version: 0.4.5
date: Thu 22 Sep 2022 23:03:24 PM EST
- Add --file option
- Fix git subrepo status command for subrepos that share a common prefix. Closes #534.
- Don't allow -b and --all
- Fix documentation links
- fix tests to support use of a default branch git config that is not "master"
- pass --force to git add so a user's global .gitignore does not affect tests
- Fix .rc and enable-completion.sh for zsh before 5.1
- Better format for options
- The `fpath` variable is an array; expand correctly
---
version: 0.4.3
date: Sat 21 Nov 2020 03:28:43 PM EST
- Apply PR#511 to fix a 0.4.2 regression in zsh
---
version: 0.4.2
date: Tue Nov 17 14:10:10 CST 2020
- Covert to GitHub Actions for testing
- Add docker support to test multiple git/bash versions together
- Require Bash 4.0+
- Use shellcheck as linter and address issues discovered
- Discovered bug in git where @ is not a valid workspace name
- Add --force command to subrepo pull
- Now works with paths that contain spaces
- Numerous documentation fixes
- When two branches pointed to the same commit, we would
sometimes pick the wrong branch.
- ZSH completion fixes
- Allow tests to run outside a git repo
- Would not work if a different date format was set in git config
- Address delay in filter-branch on newer versions of git
- Display the git merge message on merge failure
- Allow FISH integration on MacOS.
- Add manpage support for FISH shell
---
version: 0.4.1
date: Thu Jan 9 17:11:21 CST 2020
- Fix Bash version error messages and add to .rc
- Nicer YAML formatting in .travis.yml
- Wrap a long line
- Update the docs
- Force `make update` to always update docs
- Don't use XXX in perl stuff
- Add testing on MacOS
- Remove conflicting -C from install -d commands.
- Update version requirement documentation
- Correct error message in branch
- Use topo-order in subrepo branch
- Make “git subrepo clean -f ...” delete refs correctly
- Fix #410 Push empty repositories with recent git versions
- Make subrepo work when run in a worktree
- Simplify finding subrepos
- Ask git to find the .gitrepo files
- Doc: fix sentence repetition
- Fix typos
- Fixed typo
- Travis CI not checking out a branch.
---
version: 0.4.0
date: Thu Nov 8 12:26:38 CET 2018
Expand Down
16 changes: 7 additions & 9 deletions Intro.pod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=pod

=for comment
DO NOT EDIT. This Pod was generated by Swim v0.1.41.
DO NOT EDIT. This Pod was generated by Swim v0.1.48.
See http://github.com/ingydotnet/swim-pm#readme

=encoding utf8
Expand Down Expand Up @@ -78,7 +78,7 @@ Submodules tend to receive a lot of bad press. Here's some of it:

=item * L<http://ayende.com/blog/4746/the-problem-with-git-submodules>

=item * L<http://somethingsinistral.net/blog/git-submodules-are-probably-not-the-answer/>
=item * L<https://web.archive.org/web/20171101202911/http://somethingsinistral.net/blog/git-submodules-are-probably-not-the-answer/>

=item * L<http://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/>

Expand Down Expand Up @@ -307,12 +307,10 @@ Good:

=item * Bash code is very simple and easy to follow.

=item * Comprehensive test suite. Currently passing on travis:
=item * Comprehensive test suite.

=back

<badge travis ingydotnet/git-subrepo>

Bad:

=over
Expand Down Expand Up @@ -426,10 +424,10 @@ The resulting history is:

Compare that to B<subtree>. This:

$ git subrepo add abc [email protected]:user/abc master
$ git subrepo add xyz [email protected]:user/def master
$ git subrepo pull abc [email protected]:user/abc master
$ git subrepo pull xyz [email protected]:user/def master
$ git subtree add abc [email protected]:user/abc master
$ git subtree add xyz [email protected]:user/def master
$ git subtree pull abc [email protected]:user/abc master
$ git subtree pull xyz [email protected]:user/def master

Produces this:

Expand Down
2 changes: 1 addition & 1 deletion License
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2017 Ingy döt Net
Copyright (c) 2013-2020 Ingy döt Net

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
66 changes: 54 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Make sure we have 'git' and it works OK:
SHELL := bash

# Make sure we have git:
ifeq ($(shell which git),)
$(error 'git' is not installed on this system)
endif
Expand All @@ -19,6 +21,18 @@ INSTALL_LIB ?= $(DESTDIR)$(shell git --exec-path)
INSTALL_EXT ?= $(INSTALL_LIB)/$(NAME).d
INSTALL_MAN1 ?= $(DESTDIR)$(PREFIX)/share/man/man1

# Docker variables:
DOCKER_TAG ?= 0.0.6
DOCKER_IMAGE := ingy/bash-testing:$(DOCKER_TAG)
BASH_VERSIONS ?= 5.1 5.0 4.4 4.3 4.2 4.1 4.0
DOCKER_TESTS := $(BASH_VERSIONS:%=docker-test-%)
GIT_VERSIONS := 2.45 2.40 2.30 2.29 2.25 2.17 2.7

prove ?=
test ?= test/
bash ?= 5.1
git ?= 2.45

# Basic targets:
default: help

Expand All @@ -32,15 +46,25 @@ help:

.PHONY: test
test:
prove $(PROVEOPT:%=% )test/
prove $(prove) $(test)

test-all: test docker-tests

docker-test:
$(call docker-make-test,$(bash),$(git))

docker-tests: $(DOCKER_TESTS)

$(DOCKER_TESTS):
$(call docker-make-test,$(@:docker-test-%=%),$(git))

# Install support:
install:
install -C -d -m 0755 $(INSTALL_LIB)/
install -d -m 0755 $(INSTALL_LIB)/
install -C -m 0755 $(LIB) $(INSTALL_LIB)/
install -C -d -m 0755 $(INSTALL_EXT)/
install -C -m 0755 $(EXTS) $(INSTALL_EXT)/
install -C -d -m 0755 $(INSTALL_MAN1)/
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:
Expand All @@ -57,24 +81,42 @@ env:
.PHONY: doc
update: doc compgen

force:

doc: ReadMe.pod Intro.pod $(MAN1)/$(NAME).1
perl pkg/bin/generate-help-functions.pl $(DOC) > \
$(EXT)/help-functions.bash

ReadMe.pod: $(DOC)
ReadMe.pod: $(DOC) force
swim --to=pod --wrap --complete $< > $@

Intro.pod: doc/intro-to-subrepo.swim
Intro.pod: doc/intro-to-subrepo.swim force
swim --to=pod --wrap --complete $< > $@

$(MAN1)/%.1: doc/%.swim Makefile
$(MAN1)/%.1: doc/%.swim Makefile force
swim --to=man --wrap $< > $@

compgen:
compgen: force
perl pkg/bin/generate-completion.pl bash $(DOC) $(LIB) > \
$(SHARE)/completion.bash
perl pkg/bin/generate-completion.pl zsh $(DOC) $(LIB) > \
$(SHARE)/zsh-completion/_git-subrepo

clean purge:
rm -fr tmp
clean:
rm -fr tmp test/tmp

define docker-make-test
docker run --rm \
-v $(PWD):/git-subrepo \
-w /git-subrepo \
$(DOCKER_IMAGE) \
/bin/bash -c ' \
set -x && \
[[ -d /bash-$(1) ]] && \
[[ -d /git-$(2) ]] && \
export PATH=/bash-$(1)/bin:/git-$(2)/bin:$$PATH && \
bash --version && \
git --version && \
make test prove=$(prove) test=$(test) \
'
endef
8 changes: 4 additions & 4 deletions Meta
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
=meta: 0.0.2

name: git-subrepo
version: 0.4.0
version: 0.4.9
abstract: Git Submodule Alternative
homepage: https://github.com/ingydotnet/git-subrepo#readme
license: MIT
copyright: 2013-2018
copyright: 2013-2024

author:
name: Ingy döt Net
Expand All @@ -16,8 +16,8 @@ author:
homepage: http://ingy.net

requires:
bash: 3.2.0
git: 1.7.0
bash: 4.0.0
git: 2.7.0
test:
cmd: make test
install: make install
Expand Down
Loading