Skip to content

Commit

Permalink
converts the source files
Browse files Browse the repository at this point in the history
  • Loading branch information
markito3 committed Nov 2, 2021
1 parent 14c82da commit 6de2dd6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
21 changes: 10 additions & 11 deletions hdi_conversion/convert_halld_recon.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#!/bin/bash
hd_interface=/home/marki/git/hd_interface
rm -rf halld_recon cc_to_move.txt h_to_move.txt
hdi_conversion=/home/marki/git/hd_utilities/hdi_conversion
rm -rf halld_recon h_to_move.txt
#git clone [email protected]:jeffersonlab/halld_recon
cp -pr halld_recon.save halld_recon # instead of clone for testing to save time
cd halld_recon
echo git filter-repo \\ > ../command.sh
awk '{print " --path "$1" \\"}' < $hd_interface/conversion/filter.txt >> ../command.sh
awk '{print " --path "$1" \\"}' < $hdi_conversion/filter.txt >> ../command.sh
echo >> ../command.sh
. ../command.sh
git branch| awk '{print "git branch -D "$1}' | bash
mkdir old
git mv src old
find $hd_interface -type f -name \*.cc > ../cc_to_move.txt
git branch| awk '{print "git branch -D "$1}' | bash | grep -v "Deleted branch"
git mv src old_src
git commit -m "src moved to old_src" | grep -v "rename"
find $hd_interface -type f -name \*.cc | $hdi_conversion/move_cc.sh
find $hd_interface -type f -name \*.h > ../h_to_move.txt
git add .
git commit -m "move done"
git rm -r old
git add .
git commit -m "old deleted"
git commit -m "move done" | grep -v "rename"
git rm -r old_src | grep -v "rm "
git commit -m "old_src deleted" | grep -v "delete mode"
git status
10 changes: 10 additions & 0 deletions hdi_conversion/move_cc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
while read line
do
command=`echo $line | awk -F'/src/' '{print "full_path="$2}'`
eval $command
command=`echo $full_path | awk -F/ '{print "dir="$1}'`
eval $command
mkdir -p src/$dir
git mv old_src/libraries/$full_path src/$full_path
done

0 comments on commit 6de2dd6

Please sign in to comment.