Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
surf: fix scripts/update-git-platinum.sh
Browse files Browse the repository at this point in the history
The script stopped working when `data` was moved to `surf`. We also
provide more comprehensive documentation on how to use the script.

Signed-off-by: Thomas Scholtes <[email protected]>
  • Loading branch information
Thomas Scholtes committed May 11, 2021
1 parent 300c529 commit f1f1cb7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
17 changes: 9 additions & 8 deletions scripts/update-git-platinum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,32 @@ then
exit 1
fi

TARBALL_PATH=data/git-platinum.tgz
TARBALL_PATH=surf/data/git-platinum.tgz
WORKDIR=.workdir
PLATINUM_REPO="$WORKDIR/git-platinum"

# Create the workdir if needed.
mkdir -p $WORKDIR

# This is here in case the last script run failed and it never cleaned up.
rm -rf $WORKDIR/git-platinum
rm -rf "$PLATINUM_REPO"

# Clone an up-to-date version of git-platinum.
git clone https://github.com/radicle-dev/git-platinum.git $WORKDIR/git-platinum
git -C $WORKDIR/git-platinum/ checkout dev
git clone https://github.com/radicle-dev/git-platinum.git "$PLATINUM_REPO"
git -C "$PLATINUM_REPO" checkout dev

# Add the necessary refs.
input="./data/mock-branches.txt"
input="./surf/data/mock-branches.txt"
while IFS= read -r line
do
IFS=, read -a pair <<< $line
echo "Creating branch ${pair[0]}"
git -C $WORKDIR/git-platinum/ update-ref ${pair[0]} ${pair[1]}
git -C "$PLATINUM_REPO" update-ref ${pair[0]} ${pair[1]}
done < "$input"

# Update the archive.
tar -czf $WORKDIR/git-platinum.tgz $WORKDIR/git-platinum
tar -czf $WORKDIR/git-platinum.tgz -C $WORKDIR git-platinum
mv $WORKDIR/git-platinum.tgz $TARBALL_PATH

# Clean up.
rm -rf $WORKDIR/git-platinum
rm -rf "$PLATINUM_REPO"
25 changes: 17 additions & 8 deletions surf/data/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# Updating [git-platinum](https://github.com/radicle-dev/git-platinum) Just `cd`
into the repo root, then run `scripts/update-git-platinum.sh`. This will update
the tarball and it's necessary to commit the change. We provide a template below
so that we can easily identify changes to `git-platinum`. Please fill in the
details that follow a comment (`#`):
# Updating [git-platinum][]

1. Push your changes to [`radicle-dev/git-platinum`][git-platinum] and/or update
`surf/data/mock-branches.txt`.
2. Run `scripts/update-git-platinum.sh` from the repo root. This updates
`surf/data/git-platinum.tgz`.
3. Run the tests
4. Commit your changes. We provide a template below so that we can easily
identify changes to `git-platinum`. Please fill in the details that follow a
comment (`#`):
```
data/git-platinum: # short reason for updating
data/git-platinum: # short reason for updating
# provide a longer reason for making changes to git-platinum
# as well as what has changed.
```

# provide a longer reason for making changes to git-platinum
# as well as what has changed.


[git-platinum]: https://github.com/radicle-dev/git-platinum

0 comments on commit f1f1cb7

Please sign in to comment.