-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmake-go1
More file actions
executable file
·40 lines (30 loc) · 860 Bytes
/
make-go1
File metadata and controls
executable file
·40 lines (30 loc) · 860 Bytes
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
34
35
36
37
38
39
40
#!/bin/sh -e
CMDS="goxdr"
# This script creates a branch called go1 that has one commit beyond
# HEAD and includes the working tree plus all autogenerated files.
# This makes the project work for go get, which doesn't run go
# generate.
make man
GIT_DIR=$(git rev-parse --git-dir)
export GIT_INDEX_FILE="$GIT_DIR/index.go1"
rm -f "$GIT_INDEX_FILE"
git read-tree HEAD
make built_sources
git add -u
git add -f go.mod
test ! -r go.sum || git add -f go.sum
git add -f $(cat built_sources)
rm -f built_sources
#git rm --cache tools.go
tree=$(git write-tree)
rm -f "$GIT_INDEX_FILE"
commit=$(echo 'include generated files for go1 branch' | \
git commit-tree -p HEAD $tree)
git branch -f go1 $commit
if github=$(git remote -v | sed -ne '/git@github.com/{s/[ ].*//p;q;}')
then
cat <<EOF
Now you may want to run:
git push -f $github go1
EOF
fi