This file contains hidden or 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
git init subm | |
touch subm/a | |
git -C subm add a | |
git -C subm commit -m initSubm | |
git init root | |
git -C root submodule add ../subm | |
git -C root commit -m addingSubm | |
echo forMaster >>root/subm/a |
This file contains hidden or 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
set -x | |
jgit --version | |
rm -fr gerrit.src.git gerrit.dst.git gerrit.client | |
git clone --bare --mirror https://gerrit.googlesource.com/gerrit gerrit.dst.git | |
cp -r gerrit.dst.git gerrit.dst.git.backup | |
git clone --bare --mirror gerrit.dst.git gerrit.src.git | |
git clone gerrit.src.git gerrit.client | |
( cd gerrit.client; date >>README.md; git add README.md; git commit -m "modify README.md"; git push origin; ) | |
( cd gerrit.src.git; time jgit push origin HEAD:refs/heads/master; ) | |
rm -fr gerrit.dst.git |
This file contains hidden or 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
import java.util.Objects; | |
public class TestHashPerformance { | |
private static final int N = 10000000; | |
public static void main(String args[]) { | |
int r[] = new int[N]; | |
long start = System.currentTimeMillis(); | |
long n1=0, n2=N; | |
for (int i = 0; i < N; i++) { |
This file contains hidden or 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
import java.io.File; | |
import java.io.IOException; | |
import java.nio.file.FileVisitResult; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.nio.file.SimpleFileVisitor; | |
import java.nio.file.attribute.BasicFileAttributes; | |
import org.eclipse.jgit.api.Git; |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Sets up a lot of repos to test git-checkout operations. Setup test repos for all (?) possible | |
# combinations of contents in merge commit, index, workingtree and also for all combinations | |
# of skip-worktree bit and .git/info/sparse-checkout content | |
# After the repos are setup try to checkout and print status regarding worktree content, HEAD | |
# | |
# Requires that there is an executable 'jgit' in $PATH which is the command-line version | |
# | |
# usage: testAllCheckoutSituations.sh [-jgit] |
This file contains hidden or 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
git init subRepo | |
cd subRepo/ | |
touch a | |
git add a | |
git commit -m addA | |
cd .. | |
git init rootRepo | |
cd rootRepo/ | |
touch b |
This file contains hidden or 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
rm -fr writingClient*/ readingClient*/ server/ | |
mkdir server | |
git init --bare server/repo.git | |
git daemon --base-path=server --export-all --enable=receive-pack & | |
git clone git://127.0.0.1/repo.git writingClient | |
cd writingClient | |
touch a | |
git add a | |
git commit -m add_a | |
git push origin HEAD:master |
This file contains hidden or 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
touch a b c | |
git add a b c | |
git commit -m init | |
git branch side | |
echo master >a | |
git commit -a -m m1 | |
git checkout side | |
echo side >b | |
git commit -a -m s1 | |
git merge --no-commit master |
This file contains hidden or 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
uname -a | |
git --version | |
[ -x ./gin ] || curl -O https://raw.githubusercontent.com/chalstrick/gin/master/gin && chmod +x gin | |
git init test | |
cd test | |
blobId=$(echo "test content" | git hash-object -w --stdin) | |
goodTree=$(echo -e "100644 blob $blobId\tf" | git mktree) | |
tree1Id=$(echo -e "100644 blob $blobId\tRAGGED~1.H" | git mktree) | |
tree2Id=$(echo -e "040000 tree $goodTree\ta\n040000 tree $tree1Id\tb\n040000 tree $goodTree\tc" | git mktree) | |
commitId=$(echo 'initial commit' | git commit-tree $tree2Id) |
This file contains hidden or 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
#!/bin/bash | |
set -x | |
# we are working against linux repo (50000 versioned files), measure time of native git status | |
cd ../linux | |
git checkout v4.2 | |
git ls-files | wc -l | |
git remote -v | |
echo "*.txt text" >.gitattributes | |
echo "*.sh text" >arch/.gitattributes |
NewerOlder