github.com/tendermint/tmlibs@v0.9.0/merge.sh (about)

     1  #! /bin/bash
     2  set -e
     3  
     4  # NOTE: go-alert depends on go-common
     5  
     6  REPOS=("autofile" "clist" "db" "events" "flowrate" "logger" "process")
     7  
     8  mkdir common
     9  git mv *.go common
    10  git mv LICENSE common
    11  
    12  git commit -m "move all files to common/ to begin repo merge"
    13  
    14  for repo in "${REPOS[@]}"; do 
    15  	# add and fetch the repo
    16  	git remote add -f "$repo" "https://github.com/tendermint/go-${repo}"
    17  
    18  	# merge master and move into subdir
    19  	git merge "$repo/master" --no-edit
    20  
    21  	if [[ "$repo" != "flowrate" ]]; then
    22  		mkdir "$repo"
    23  		git mv *.go "$repo/"
    24  	fi
    25  
    26  	set +e # these might not exist
    27          git mv *.md "$repo/"
    28  	git mv README "$repo/README.md"
    29  	git mv Makefile "$repo/Makefile"
    30          git rm LICENSE
    31  	set -e
    32          
    33  	# commit
    34  	git commit -m "merge go-${repo}"
    35  
    36  	git remote rm "$repo"
    37  done
    38  
    39  go get github.com/ebuchman/got
    40  got replace "tendermint/go-common" "tendermint/go-common/common"
    41  for repo in "${REPOS[@]}"; do 
    42  
    43  	if [[ "$repo" != "flowrate" ]]; then
    44  		got replace "tendermint/go-${repo}" "tendermint/go-common/${repo}"
    45  	else
    46  		got replace "tendermint/go-${repo}/flowrate" "tendermint/go-common/flowrate"
    47  	fi
    48  done
    49  
    50  git add -u 
    51  git commit -m "update import paths"
    52  
    53  # TODO: change any paths in non-Go files
    54  # TODO: add license