Skip to content

Commit

Permalink
tag_main.sh and pr_commit.sh tweaks (zephyrproject-rtos#16)
Browse files Browse the repository at this point in the history
- Pipe the tag-related repo refresh to /dev/null. It's just scary noise
that makes it look like the tags are being deleted. Nobody needs to see
that.

- Add some comments to the repo refresh in the clone_repo function to
help see what's happening there.

Signed-off-by: Connor Graydon <[email protected]>
  • Loading branch information
cjgraydon authored Jun 13, 2022
1 parent 09a98db commit c00fbbf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/scripts/pr_comment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ if [ "$PR_REPO" == "" ] || [ "$PR" == "" ] || [ "$TAG" == "" ]; then
exit
fi


function clone_repo()
{
# If repo exists hard reset everything and reuse it
if [ -d $WORKDIR/$REPO_DIR ]; then
echo "Found an existing $REPO_DIR repo. Reuse it? This will annihilate any unpushed changes."
echo "Found an existing repo. Reuse it? This will annihilate any unpushed changes."
while true
do
read -r -p "REUSE IT? Y/N: " choice
Expand All @@ -60,15 +61,19 @@ if [ -d $WORKDIR/$REPO_DIR ]; then
;;
y|Y) echo "You said DO IT. Resetting repo."
cd $REPO_DIR
#git fetch origin --tags
echo "Refreshing branch"
git checkout $BRANCH
echo "Hard reset branch"
git reset --hard origin/$BRANCH
echo "Force clean"
git clean -d --force
# We only care about the tags if we are reusing zephyr repo.
# We never look at tags on zephyr-intel.
if [ "$REPO_DIR" == "zephyr" ]; then
git tag -l | xargs git tag -d && git fetch --tags
echo "Refreshing tags"
git tag -l | xargs git tag -d > /dev/null 2>&1 && git fetch --tags > /dev/null 2>&1
fi
echo "Refresh Done."
break
;;
*) echo "Wut? Choose Y/n";;
Expand Down
7 changes: 6 additions & 1 deletion src/scripts/tag_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ if [ -d $WORKDIR/$REPO_DIR ]; then
;;
y|Y) echo "You said DO IT. Resetting repo."
cd $REPO_DIR
echo "Refreshing branch"
git checkout $BRANCH
echo "Hard reset branch"
git reset --hard origin/$BRANCH
echo "Force clean"
git clean -d --force
git tag -l | xargs git tag -d && git fetch --tags
echo "Refreshing tags"
git tag -l | xargs git tag -d > /dev/null 2>&1 && git fetch --tags > /dev/null 2>&1
echo "Refresh Done"
break
;;
*) echo "Wut? Choose Y/n";;
Expand Down

0 comments on commit c00fbbf

Please sign in to comment.