File: aten_mirror.sh

package info (click to toggle)
pytorch 1.7.1-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 80,340 kB
  • sloc: cpp: 670,830; python: 343,991; ansic: 67,845; asm: 5,503; sh: 2,924; java: 2,888; xml: 266; makefile: 244; ruby: 148; yacc: 144; objc: 51; lex: 44
file content (33 lines) | stat: -rwxr-xr-x 1,393 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

# This script is run by a cronjob managed by @zdevito
# which mirrors the ATen-specific directories of PyTorch
# to zdevito/ATen, for ease of use of projects that wish
# to depend solely on ATen.
#
# See also .travis.aten.yml, which is the Travis configuration
# for the ATen project (and ensures ATen is separately
# buildable.)

if [[ -z "$EXTRACTED_REPO" ]]; then
  echo "Need to set envvar EXTRACTED_REPO"
  exit 1
fi
if [[ -z "$FULL_REPO" ]]; then
  echo "Need to set envvar FULL_REPO"
  exit 1
fi
rm -rf aten-export-repo
git clone $EXTRACTED_REPO aten-export-repo
cd aten-export-repo
git config user.name "Zach DeVito"
git config user.email "zdevito@fb.com"
git remote add fullrepo $FULL_REPO
git fetch fullrepo
git checkout -b temporary-split-branch fullrepo/master
# Cribbed from https://stackoverflow.com/questions/2982055/detach-many-subdirectories-into-a-new-separate-git-repository
# and https://stackoverflow.com/questions/42355621/git-filter-branch-moving-a-folder-with-index-filter-does-not-work
git filter-branch -f --index-filter 'git rm --cached -qr --ignore-unmatch -- . && git reset -q $GIT_COMMIT -- aten cmake third_party/tbb third_party/catch third_party/cpuinfo && (git ls-files -s | sed "s-.travis.aten.yml-.travis.yml-" | sed "s-.gitmodules.aten-.gitmodules-" | git update-index --index-info)'
git checkout master
git merge temporary-split-branch
git push