Remove obsolette code
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
@@ -5,20 +5,3 @@
|
||||
#
|
||||
# Usage:
|
||||
# mirror-main-repo <url>
|
||||
|
||||
|
||||
# Unofficial strict mode
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
source $(dirname $(realpath $0))/gen-mirror-path
|
||||
|
||||
function updateOrCreate(){
|
||||
# implemented in RepoTool
|
||||
}
|
||||
|
||||
function getLastCommit(){
|
||||
# replaced by git_tool repo hash
|
||||
}
|
||||
|
||||
updateOrCreate $1
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Describe submodules in repository, optionally per commit
|
||||
#
|
||||
# Usage:
|
||||
# submodule-describe <path-to-repo> [<commit>]
|
||||
#
|
||||
# Output:
|
||||
# <hash> <path> <url>
|
||||
# <hash> <path> <url>
|
||||
#
|
||||
# everything separated with tabs
|
||||
|
||||
# Safe mode
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# get config file for specific commit
|
||||
function getConfigFile() {
|
||||
git --no-pager show $commit:.gitmodules
|
||||
}
|
||||
|
||||
# parse submodule file from file
|
||||
function parseSectionNames(){
|
||||
git config -f $1 --list --name-only | grep '^submodule.' | cut -d. -f2 | sort | uniq
|
||||
}
|
||||
|
||||
# generate line for single submodule
|
||||
function generateDescription(){
|
||||
cfgFile=$1
|
||||
section=$2
|
||||
|
||||
path=$(git config -f $cfgFile --get submodule.$section.path)
|
||||
url=$(git config -f $cfgFile --get submodule.$section.url)
|
||||
hash=$(git ls-tree -l $commit -- $path | cut -d' ' -f3)
|
||||
|
||||
printf "%s\t%s\t%s\n" $hash $path $url
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# Grab varriables
|
||||
repodir=$1
|
||||
commit=${2:-HEAD}
|
||||
|
||||
# Go to repo directory
|
||||
oldPwd=$(pwd)
|
||||
cd $repodir
|
||||
|
||||
# Are there any submodules registered?
|
||||
test 0 -eq `git ls-tree $commit -- .gitmodules | wc -l` && exit 0
|
||||
|
||||
tmpfile=$(mktemp)
|
||||
|
||||
getConfigFile $repodir $commit > $tmpfile
|
||||
for section in $(parseSectionNames $tmpfile)
|
||||
do
|
||||
generateDescription $tmpfile $section
|
||||
done
|
||||
|
||||
|
||||
# Cleanup
|
||||
rm $tmpfile
|
||||
# Go back home
|
||||
cd $oldPwd
|
||||
Reference in New Issue
Block a user