-
Notifications
You must be signed in to change notification settings - Fork 1
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
Joe Mou
committed
Apr 19, 2019
1 parent
52b1d99
commit 77e2597
Showing
12 changed files
with
28 additions
and
24 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
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/bin/bash -e | ||
|
||
if [[ $# -eq 0 ]]; then | ||
headref=$(./symbolic-ref HEAD | sed -e 's|^refs/heads/||') | ||
headref=$(symbolic-ref HEAD | sed -e 's|^refs/heads/||') | ||
echo "*$headref" | ||
cd .zit/refs/heads | ||
ls | grep -vxF $headref | ||
else | ||
branchname=$1 | ||
startpoint=${2-HEAD} | ||
rev=$(./rev-parse $startpoint) | ||
./update-ref refs/heads/$branchname $rev | ||
rev=$(rev-parse $startpoint) | ||
update-ref refs/heads/$branchname $rev | ||
fi |
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/bin/bash -e | ||
|
||
if [[ $1 == -b ]]; then | ||
./branch $2 | ||
branch $2 | ||
shift | ||
fi | ||
revision=$1 | ||
tree=$(./rev-parse $revision^{tree}) | ||
./read-tree $tree | ||
./checkout-index | ||
tree=$(rev-parse $revision^{tree}) | ||
read-tree $tree | ||
checkout-index | ||
if [[ -f .zit/refs/heads/$revision ]]; then | ||
./symbolic-ref HEAD refs/heads/$revision | ||
symbolic-ref HEAD refs/heads/$revision | ||
else | ||
echo "You are in 'detached HEAD' state." >&2 | ||
fi |
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
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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
echo tree $1 > .zit/commit.tmp | ||
shift | ||
while [[ $1 == -p ]]; do | ||
parent=$(./rev-parse $2) | ||
parent=$(rev-parse $2) | ||
echo parent $parent >> .zit/commit.tmp | ||
shift; shift | ||
done | ||
|
@@ -12,4 +12,4 @@ echo committer "Joe Mou <[email protected]> $(date +'%s %z')" >> .zit/commit.tmp | |
echo >> .zit/commit.tmp | ||
cat >> .zit/commit.tmp | ||
|
||
./hash-object commit .zit/commit.tmp | ||
hash-object commit .zit/commit.tmp |
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
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
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash -e | ||
|
||
path=.zit/$(./symbolic-ref $1) | ||
sha1=$(./rev-parse $2) | ||
path=.zit/$(symbolic-ref $1) | ||
sha1=$(rev-parse $2) | ||
# TODO initialize directory structure instead? | ||
mkdir -p $(dirname $path) | ||
echo $sha1 > $path |
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash -e | ||
|
||
export PATH="${BASH_SOURCE%/*}:$PATH" | ||
exec "$@" |