Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
perform git cleanup for all branches
  • Loading branch information
Jaideep Bajwa committed Nov 4, 2016
commit 7d8effd39a82091c85c85ddd01b8ee7cc182375a
12 changes: 5 additions & 7 deletions tools/make-v8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ function cleanup() {
rm .gclient || true
rm .gclient_entries || true
rm -rf _bad_scm/ || true
if [ "$BRANCH" == "master" ]; then
echo "git cleanup if branch is master"
git reset --hard HEAD
git clean -fdq
# Copy local files
rsync -a .v8old/ v8/
fi
echo "git cleanup"
git reset --hard HEAD
git clean -e .v8old -ffdq
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there subdirectories with .git directories in them?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the original code there are no directories with .git, but deps/v8 will have .git directory when this script is run more than once, because after the script is run, deps/v8 is the fetched copy from google which contains the .git directory.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, the directory which would contain ".git" I'm excluding explicitly, so the extra -f option could be removed. I would personally keep it for completeness, such that no directory is skipped in case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, we are syncing every time. So removing .git directories would be okay, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, every time the script is run, a new copy of v8 is fetched from google and old one with .git is removed ( which is only untracked directory with .git).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I am thinking is, why should we have the .git directory at all, during the cleanup we can remove that as well.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, git clean won't delete .git files since git won't track .git directory. I can manually delete deps/v8/.git before git clean and remove the extra -f option.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

# Copy local files
rsync -a .v8old/ v8/
rm -rf .v8old
exit 0
}
Expand Down