-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
072a5fb
commit 15335d3
Showing
1 changed file
with
129 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,41 @@ mkdir tmp | |
cd tmp | ||
rm -rf * | ||
|
||
export GIT_AUTHOR_NAME="Ciro Santilli" | ||
export GIT_AUTHOR_EMAIL="[email protected]" | ||
export GIT_AUTHOR_DATE='2000-01-01T00:00:00+0000' | ||
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" | ||
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" | ||
export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" | ||
|
||
mkdir mod | ||
cd mod/ | ||
cd mod | ||
git init | ||
touch a | ||
git add a | ||
git commit -m 1 | ||
touch b | ||
git add b | ||
git commit -m 2 | ||
touch base | ||
git add base | ||
git commit -m base | ||
touch master-1 | ||
git add master-1 | ||
git commit -m master-1 | ||
touch master-2 | ||
git add master-2 | ||
git commit -m master-2 | ||
git tag tag-master | ||
touch master-3 | ||
git add master-3 | ||
git commit -m master-3 | ||
git checkout -b mybranch HEAD~3 | ||
touch mybranch-1 | ||
git add mybranch-1 | ||
git commit -m mybranch-1 | ||
touch mybranch-2 | ||
git add mybranch-2 | ||
git commit -m mybranch-2 | ||
git tag tag-mybranch | ||
touch mybranch-3 | ||
git add mybranch-3 | ||
git commit -m mybranch-3 | ||
git checkout master | ||
cd .. | ||
|
||
mkdir top | ||
|
@@ -46,63 +72,125 @@ git add .gitmodules | |
git commit -m 'shallow' | ||
cd .. | ||
|
||
mkdir mod-branch | ||
cd mod-branch/ | ||
mkdir top-branch | ||
cd top-branch | ||
git init | ||
touch a | ||
git add a | ||
git commit -m 1 | ||
touch b | ||
git add b | ||
git commit -m 2 | ||
git checkout -b mybranch HEAD~ | ||
touch c | ||
git add c | ||
git commit -m 3 | ||
git submodule add -b mybranch ../mod/ mod | ||
git add .gitmodules | ||
git commit -m '.gitmodules' | ||
cd .. | ||
|
||
mkdir top-branch | ||
cd top-branch | ||
cp -rv top-branch top-branch-shallow | ||
cd top-branch-shallow | ||
printf '\tshallow = true\n' >> .gitmodules | ||
git add .gitmodules | ||
git commit -m 'shallow' | ||
cd .. | ||
|
||
mkdir top-tag | ||
cd top-tag | ||
git init | ||
touch a | ||
git add a | ||
git commit -m 1 | ||
touch b | ||
git add b | ||
git commit -m 2 | ||
git submodule add -b mybranch ../mod-branch/ mod | ||
git add .gitmodules | ||
git submodule add ../mod/ mod | ||
cd mod | ||
git checkout tag-mybranch | ||
cd .. | ||
git add . | ||
git commit -m '.gitmodules' | ||
cd .. | ||
|
||
cp -rv top-branch top-branch-shallow | ||
cd top-branch-shallow | ||
printf '\tshallow = true\n' >> .gitmodules | ||
git add .gitmodules | ||
git commit -m 'shallow' | ||
mkdir top-sha | ||
cd top-sha | ||
git init | ||
touch a | ||
git add a | ||
git commit -m 1 | ||
touch b | ||
git add b | ||
git commit -m 2 | ||
git submodule add ../mod/ mod | ||
cd mod | ||
git checkout tag-mybranch~ | ||
cd .. | ||
git add . | ||
git commit -m '.gitmodules' | ||
cd .. | ||
|
||
git clone --recursive "file://$(pwd)/top" top-clone | ||
git --git-dir top-clone/.git/modules/mod log | ||
# two commits | ||
rm -f results | ||
|
||
git clone --recursive "file://$(pwd)/top-shallow" top-shallow-clone | ||
git --git-dir top-shallow-clone/.git/modules/mod log | ||
# one commit | ||
git clone --depth 1 "file://$(pwd)/mod" mod-clone | ||
git --git-dir mod-clone/.git log --oneline | wc -l >>results | ||
# 1 | ||
|
||
git clone --recursive "file://$(pwd)/top-branch" top-branch-clone | ||
git --git-dir top-branch-clone/.git/modules/mod log | ||
# two commits | ||
git clone --depth 1 "file://$(pwd)/mod" mod-branch-clone | ||
git --git-dir mod-branch-clone/.git log --oneline | wc -l >>results | ||
# 1 | ||
|
||
git clone --recursive "file://$(pwd)/top-branch-shallow" top-branch-shallow-clone | ||
git --git-dir top-branch-shallow-clone/.git/modules/mod log | ||
# locally: one commit | ||
# github 2017-11, git 2.14.1: two commits | ||
## gitmodule | ||
|
||
git clone --depth 1 "file://$(pwd)/mod" mod-clone | ||
git --git-dir mod-clone/.git log | ||
# one commit | ||
echo 'gitmodule' >>results | ||
|
||
git clone --recurse-submodules "file://$(pwd)/top" top-clone | ||
git --git-dir top-clone/.git/modules/mod log --oneline | wc -l >>results | ||
# many | ||
|
||
git clone --recurse-submodules "file://$(pwd)/top-shallow" top-shallow-clone | ||
git --git-dir top-shallow-clone/.git/modules/mod log --oneline | wc -l >>results | ||
# 1 | ||
|
||
git clone --recurse-submodules "file://$(pwd)/top-branch" top-branch-clone | ||
git --git-dir top-branch-clone/.git/modules/mod log --oneline | wc -l >>results | ||
# many | ||
|
||
git clone --recurse-submodules "file://$(pwd)/top-branch-shallow" top-branch-shallow-clone | ||
git --git-dir top-branch-shallow-clone/.git/modules/mod log --oneline | wc -l >>results | ||
# many | ||
|
||
git clone --recurse-submodules "file://$(pwd)/top-tag" top-tag-clone | ||
git --git-dir top-tag-clone/.git/modules/mod log --oneline | wc -l >>results | ||
# many | ||
|
||
git clone --recurse-submodules "file://$(pwd)/top-sha" top-sha-clone | ||
git --git-dir top-sha-clone/.git/modules/mod log --oneline | wc -l >>results | ||
# many | ||
|
||
## SS | ||
|
||
echo 'ss' >>results | ||
|
||
git clone --recurse-submodules --shallow-submodules "file://$(pwd)/top" top-clone-ss | ||
git --git-dir top-clone-ss/.git/modules/mod log --oneline | wc -l >>results | ||
# 1 | ||
|
||
git clone --recurse-submodules --shallow-submodules "file://$(pwd)/top-shallow" top-shallow-clone-ss | ||
git --git-dir top-shallow-clone-ss/.git/modules/mod log --oneline | wc -l >>results | ||
# 1 | ||
|
||
git clone --recurse-submodules --shallow-submodules "file://$(pwd)/top-branch" top-branch-clone-ss | ||
git --git-dir top-branch-clone-ss/.git/modules/mod log --oneline | wc -l >>results | ||
# 1 | ||
|
||
git clone --recurse-submodules --shallow-submodules "file://$(pwd)/top-branch-shallow" top-branch-shallow-clone-ss | ||
git --git-dir top-branch-shallow-clone-ss/.git/modules/mod log --oneline | wc -l >>results | ||
# 1 | ||
|
||
git clone --recurse-submodules --shallow-submodules "file://$(pwd)/top-tag" top-tag-clone-ss | ||
git --git-dir top-tag-clone-ss/.git/modules/mod log --oneline | wc -l >>results | ||
# 1 | ||
|
||
#git clone --recurse-submodules --shallow-submodules "file://$(pwd)/top-sha" top-sha-clone-ss | ||
# error: Server does not allow request for unadvertised object | ||
#git --git-dir top-sha-clone-ss/.git/modules/mod log --oneline | wc -l >>results | ||
|
||
git clone --depth 1 "file://$(pwd)/mod-branch" mod-branch-clone | ||
git --git-dir mod-branch-clone/.git log | ||
# one commit | ||
cat results |