[brlcad-commits] SF.net SVN: brlcad:[78315] brlcad/trunk/misc/repowork

2021-02-23 Thread starseeker--- via brlcad-commits
Revision: 78315
  http://sourceforge.net/p/brlcad/code/78315
Author:   starseeker
Date: 2021-02-23 23:04:16 + (Tue, 23 Feb 2021)
Log Message:
---
Add the ability to remove commits from the history (take a SHA1 list of commits 
to remove.)

Modified Paths:
--
brlcad/trunk/misc/repowork/commit.cpp
brlcad/trunk/misc/repowork/repowork.cpp
brlcad/trunk/misc/repowork/repowork.h

Modified: brlcad/trunk/misc/repowork/commit.cpp
===
--- brlcad/trunk/misc/repowork/commit.cpp   2021-02-23 19:26:17 UTC (rev 
78314)
+++ brlcad/trunk/misc/repowork/commit.cpp   2021-02-23 23:04:16 UTC (rev 
78315)
@@ -639,6 +639,9 @@
 return -1;
 }
 
+if (c->skip_commit)
+   return 0;
+
 // If this is a reset commit, it's handled quite differently
 if (c->reset_commit) {
outfile << "reset " << c->branch << "\n";

Modified: brlcad/trunk/misc/repowork/repowork.cpp
===
--- brlcad/trunk/misc/repowork/repowork.cpp 2021-02-23 19:26:17 UTC (rev 
78314)
+++ brlcad/trunk/misc/repowork/repowork.cpp 2021-02-23 23:04:16 UTC (rev 
78315)
@@ -556,6 +556,75 @@
 }
 
 int
+git_remove_commits(git_fi_data *s, std::string _commits)
+{
+if (!s->have_sha1s) {
+   std::cerr << "Fatal - commit removal requested, but don't have original 
sha1 ids - redo fast-export with the --show-original-ids option.\n";
+   exit(1);
+}
+
+std::ifstream infile_remove_commits(remove_commits, std::ifstream::binary);
+if (remove_commits.length() && !infile_remove_commits.good()) {
+   std::cerr << "Could not open remove_commits file: " << remove_commits 
<< "\n";
+   exit(-1);
+}
+std::set remove_sha1s;
+if (infile_remove_commits.good()) {
+   std::string line;
+   while (std::getline(infile_remove_commits, line)) {
+   // Skip anything the wrong length
+   if (line.length() != 40) {
+   continue;
+   }
+   remove_sha1s.insert(line);
+   std::cout << "remove sha1: " << line << "\n";
+   bool valid = false;
+   for (size_t i = 0; i < s->commits.size(); i++) {
+   if (s->commits[i].id.sha1 == line) {
+   valid = true;
+   break;
+   }
+   }
+   if (!valid) {
+   std::cout << "INVALID sha1 supplied for removal!\n";
+   }
+   }
+
+   infile_remove_commits.close();
+}
+
+
+std::set::iterator r_it;
+for (r_it = remove_sha1s.begin(); r_it != remove_sha1s.end(); r_it++) {
+   git_commitish rfrom;
+   git_commitish rish;
+   for (size_t i = 0; i < s->commits.size(); i++) {
+   if (s->commits[i].id.sha1 == *r_it) {
+   rfrom = s->commits[i].from;
+   rish = s->commits[i].id;
+   s->commits[i].skip_commit = true;
+   break;
+   }
+   }
+   // Update any references
+   for (size_t i = 0; i < s->commits.size(); i++) {
+   if (s->commits[i].from == rish) {
+   std::cout << *r_it << " removal: updating from commit for " << 
s->commits[i].id.sha1 << "\n";
+   s->commits[i].from = rfrom;
+   }
+   for (size_t j = 0; j < s->commits[i].merges.size(); j++) {
+   if (s->commits[i].merges[j] == rish) {
+   std::cout << *r_it << " removal: updating merge commit for 
" << s->commits[i].id.sha1 << "\n";
+   s->commits[i].merges[j] = rfrom;
+   }
+   }
+   }
+}
+
+return 0;
+}
+
+int
 git_map_emails(git_fi_data *s, std::string _map)
 {
 // read map
@@ -995,6 +1064,7 @@
 bool collapse_notes = false;
 bool wrap_commit_lines = false;
 bool trim_whitespace = false;
+bool list_empty = false;
 std::string repo_path;
 std::string email_map;
 std::string svn_map;
@@ -1001,6 +1071,7 @@
 std::string svn_rev_map;
 std::string svn_branch_map;
 std::string svn_branches_to_tags;
+std::string remove_commits;
 std::string correct_branches;
 std::string cvs_auth_map;
 std::string cvs_branch_map;
@@ -1022,6 +1093,7 @@
("svn-branches", "Specify [git sha1|rev] -> svn branch (one mapping 
per line, format is key:[branch;branch])", 
cxxopts::value>(), "map file")
("svn-branches-to-tags", "Specify git sha1 list that was committed 
to tags, not branches", cxxopts::value>(), "sha1 list")
("correct-branches", "Specify rev -> branch sets 
(key;[branch;branch].  Will override svn-branches assignments.)", 
cxxopts::value>(), "map")
+   ("remove-commits", "Specify sha1 list of commits to remove from 
history", cxxopts::value>(), "list_file")
 
("cvs-auth-map", "msg -> cvs author map (needs sha1->key 
map)", cxxopts::value>(), "file")

[brlcad-commits] SF.net SVN: brlcad:[78314] brlcad/trunk/misc/repoconv/sha1_update.sh

2021-02-23 Thread starseeker--- via brlcad-commits
Revision: 78314
  http://sourceforge.net/p/brlcad/code/78314
Author:   starseeker
Date: 2021-02-23 19:26:17 + (Tue, 23 Feb 2021)
Log Message:
---
Support either ; or : as delimiters

Modified Paths:
--
brlcad/trunk/misc/repoconv/sha1_update.sh

Modified: brlcad/trunk/misc/repoconv/sha1_update.sh
===
--- brlcad/trunk/misc/repoconv/sha1_update.sh   2021-02-23 19:11:34 UTC (rev 
78313)
+++ brlcad/trunk/misc/repoconv/sha1_update.sh   2021-02-23 19:26:17 UTC (rev 
78314)
@@ -44,7 +44,7 @@
 
 rm -f sha1s_orig ukeys nkeys mapped_keys map.sed
 while read p; do
-  SHA1=$(echo "$p" | awk -F';' '{print $1}')
+  SHA1=$(echo "$p" | awk -F'[;:]' '{print $1}')
   if [ "$SHA1" != "" ]
   then
  echo $SHA1 >> $CWD/sha1s_orig

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[78313] brlcad/trunk/misc

2021-02-23 Thread starseeker--- via brlcad-commits
Revision: 78313
  http://sourceforge.net/p/brlcad/code/78313
Author:   starseeker
Date: 2021-02-23 19:11:34 + (Tue, 23 Feb 2021)
Log Message:
---
Rename - test updates using script succeeded.

To test the efficacy of this script, one of the updating
files to the conversion was altered to remove one of the
earliest correction lines, and that line was applied in
isolation to create a new repository with most of the
SHA1 ids altered.  The original repository and the
altered repository were then used to update the full input
files (minus the already applied line) by mapping the
original SHA1 keys to the corresponding new keys.  After
application of the altered files, the final git log --all
log from the resulting repository was compared to the
equivalent log generated from the repository created by
applying the original files to the original input. The logs
were identical, which means all the mapping were successfully
made and the equivalent changes successfully applied.

Modified Paths:
--
brlcad/trunk/misc/CMakeLists.txt

Added Paths:
---
brlcad/trunk/misc/repoconv/sha1_update.sh

Removed Paths:
-
brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh

Modified: brlcad/trunk/misc/CMakeLists.txt
===
--- brlcad/trunk/misc/CMakeLists.txt2021-02-23 18:15:34 UTC (rev 78312)
+++ brlcad/trunk/misc/CMakeLists.txt2021-02-23 19:11:34 UTC (rev 78313)
@@ -215,7 +215,7 @@
   repoconv/manual_merge_info.tar.gz
   repoconv/md5.hpp
   repoconv/sha1.hpp
-  repoconv/sha1_to_uniqkey.sh
+  repoconv/sha1_update.sh
   repoconv/svn2git/README
   repoconv/svn2git/archive_branches.sh
   repoconv/svn2git/rules

Deleted: brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh
===
--- brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   2021-02-23 18:15:34 UTC 
(rev 78312)
+++ brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   2021-02-23 19:11:34 UTC 
(rev 78313)
@@ -1,115 +0,0 @@
-#!/bin/bash
-
-set -e
-
-CWD=$(pwd)
-
-if [ "$#" -ne "4" ]
-then
-   echo "sha1_update old_repo new_repo input_file output_file"
-   exit 1
-fi
-old_repo=$1
-new_repo=$2
-input_file=$CWD/$3
-output_file=$4
-
-if [ ! -d $old_repo ]
-then
-   echo "$old_repo does not exist"
-   exit 1
-fi
-if [ ! -d $new_repo ]
-then
-   echo "$new_repo does not exist"
-   exit 1
-fi
-if [ ! -f $input_file ]
-then
-   input_file=$3
-   if [ ! -f $input_file ]
-   then
-   echo "$input_file does not exist"
-   exit 1
-   fi
-fi
-if [ -f $output_file ]
-then
-   echo "$output_file already exists"
-   exit 1
-fi
-
-
-cd $old_repo
-
-rm -f sha1s_orig ukeys nkeys mapped_keys map.sed
-while read p; do
-  SHA1=$(echo "$p" | awk -F';' '{print $1}')
-  if [ "$SHA1" != "" ]
-  then
- echo $SHA1 >> $CWD/sha1s_orig
-
- TSMP=$(git log -1 --pretty=format:"%ct%n" $SHA1)
-
- # https://stackoverflow.com/a/7132381
- git branch -a --contains $SHA1 | grep -v remote | sort | uniq |sed -e 
's/\*//'|sed -e 's/ //g' > $CWD/branchtmp
- BMD5=$(md5sum $CWD/branchtmp |awk '{print $1}')
- rm $CWD/branchtmp
-
- git diff --raw $SHA1^ $SHA1 > $CWD/keytmp
- DIFFKEY=$(md5sum $CWD/keytmp |awk '{print $1}')
- rm $CWD/keytmp
-
- echo "SHA1: $SHA1"
- echo "Timestamp: $TSMP"
- echo "Branches MD5: $BMD5"
- echo "Diff MD5: $DIFFKEY"
- echo "$SHA1;$TSMP;$BMD5;$DIFFKEY" >> $CWD/ukeys
-  fi
-done < $input_file
-echo "" >> $CWD/ukeys
-
-cd $new_repo
-
-echo ""
-echo "Mapping from $old_repo SHA1 keys to $new_repo SHA1 keys:"
-echo ""
-
-while read p; do
-  OSHA1=$(echo "$p" | awk -F';' '{print $1}')
-  TSMP=$(echo "$p" | awk -F';' '{print $2}')
-  BMD5=$(echo "$p" | awk -F';' '{print $3}')
-  DIFFKEY=$(echo "$p" | awk -F';' '{print $4}')
-  pwd
-  echo "Searching for: $TSMP   $BMD5   $DIFFKEY"
-  git log --all --since $TSMP --until $TSMP --pretty=format:"%H" > $CWD/nkeys
-  echo "" >> $CWD/nkeys
-  while read d; do
- CSHA1=$d
- echo "CSHA1: $CSHA1"
-
- git branch -a --contains $CSHA1 | grep -v remote | sort | uniq |sed 
-e 's/\*//'|sed -e 's/ //g' > $CWD/branchtmp
- NBMD5=$(md5sum $CWD/branchtmp |awk '{print $1}')
- echo "NBMD5: $NBMD5"
- rm $CWD/branchtmp
-
- if [ "$BMD5" == "$NBMD5" ]
- then
- git diff --raw $CSHA1^ $CSHA1 > $CWD/keytmp
- NDIFFKEY=$(md5sum $CWD/keytmp |awk '{print $1}')
- echo "NDIFFKEY: $NDIFFKEY"
- if [ "$NDIFFKEY" == "$DIFFKEY" ]
- then
- echo "MATCH"
- echo "s/$OSHA1/$d/g" >> $CWD/map.sed
- fi
- rm $CWD/keytmp
- fi
-  done < $CWD/nkeys
-  rm $CWD/nkeys
-done < $CWD/ukeys
-
-cd 

[brlcad-commits] SF.net SVN: brlcad:[78312] brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh

2021-02-23 Thread starseeker--- via brlcad-commits
Revision: 78312
  http://sourceforge.net/p/brlcad/code/78312
Author:   starseeker
Date: 2021-02-23 18:15:34 + (Tue, 23 Feb 2021)
Log Message:
---
Write out a sed script for the matches and apply it to the output file.

Modified Paths:
--
brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh

Modified: brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh
===
--- brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   2021-02-23 16:50:58 UTC 
(rev 78311)
+++ brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   2021-02-23 18:15:34 UTC 
(rev 78312)
@@ -42,7 +42,7 @@
 
 cd $old_repo
 
-rm -f sha1s_orig ukeys nkeys mapped_keys
+rm -f sha1s_orig ukeys nkeys mapped_keys map.sed
 while read p; do
   SHA1=$(echo "$p" | awk -F';' '{print $1}')
   if [ "$SHA1" != "" ]
@@ -64,10 +64,10 @@
  echo "Timestamp: $TSMP"
  echo "Branches MD5: $BMD5"
  echo "Diff MD5: $DIFFKEY"
- echo "$TSMP;$BMD5;$DIFFKEY" >> $CWD/ukeys
+ echo "$SHA1;$TSMP;$BMD5;$DIFFKEY" >> $CWD/ukeys
   fi
-  echo "" >> $CWD/ukeys
 done < $input_file
+echo "" >> $CWD/ukeys
 
 cd $new_repo
 
@@ -76,9 +76,10 @@
 echo ""
 
 while read p; do
-  TSMP=$(echo "$p" | awk -F';' '{print $1}')
-  BMD5=$(echo "$p" | awk -F';' '{print $2}')
-  DIFFKEY=$(echo "$p" | awk -F';' '{print $3}')
+  OSHA1=$(echo "$p" | awk -F';' '{print $1}')
+  TSMP=$(echo "$p" | awk -F';' '{print $2}')
+  BMD5=$(echo "$p" | awk -F';' '{print $3}')
+  DIFFKEY=$(echo "$p" | awk -F';' '{print $4}')
   pwd
   echo "Searching for: $TSMP   $BMD5   $DIFFKEY"
   git log --all --since $TSMP --until $TSMP --pretty=format:"%H" > $CWD/nkeys
@@ -100,7 +101,7 @@
  if [ "$NDIFFKEY" == "$DIFFKEY" ]
  then
  echo "MATCH"
- echo $d >> $CWD/mapped_keys
+ echo "s/$OSHA1/$d/g" >> $CWD/map.sed
  fi
  rm $CWD/keytmp
  fi
@@ -109,3 +110,6 @@
 done < $CWD/ukeys
 
 cd $CWD
+cp $input_file $output_file
+sed -i -f map.sed $output_file
+

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[78311] brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh

2021-02-23 Thread starseeker--- via brlcad-commits
Revision: 78311
  http://sourceforge.net/p/brlcad/code/78311
Author:   starseeker
Date: 2021-02-23 16:50:58 + (Tue, 23 Feb 2021)
Log Message:
---
Start forming script into something that can process a file...

Modified Paths:
--
brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh

Modified: brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh
===
--- brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   2021-02-23 16:07:16 UTC 
(rev 78310)
+++ brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   2021-02-23 16:50:58 UTC 
(rev 78311)
@@ -1,32 +1,78 @@
 #!/bin/bash
+
+set -e
+
+CWD=$(pwd)
+
+if [ "$#" -ne "4" ]
+then
+   echo "sha1_update old_repo new_repo input_file output_file"
+   exit 1
+fi
+old_repo=$1
+new_repo=$2
+input_file=$CWD/$3
+output_file=$4
+
+if [ ! -d $old_repo ]
+then
+   echo "$old_repo does not exist"
+   exit 1
+fi
+if [ ! -d $new_repo ]
+then
+   echo "$new_repo does not exist"
+   exit 1
+fi
+if [ ! -f $input_file ]
+then
+   input_file=$3
+   if [ ! -f $input_file ]
+   then
+   echo "$input_file does not exist"
+   exit 1
+   fi
+fi
+if [ -f $output_file ]
+then
+   echo "$output_file already exists"
+   exit 1
+fi
+
+
+cd $old_repo
+
 rm -f sha1s_orig ukeys nkeys mapped_keys
 while read p; do
   SHA1=$(echo "$p" | awk -F';' '{print $1}')
   if [ "$SHA1" != "" ]
   then
- echo $SHA1 >> sha1s_orig
+ echo $SHA1 >> $CWD/sha1s_orig
 
  TSMP=$(git log -1 --pretty=format:"%ct%n" $SHA1)
 
  # https://stackoverflow.com/a/7132381
- git branch -a --contains $SHA1 | grep -v remote | sort | uniq |sed -e 
's/\*//'|sed -e 's/ //g' > branchtmp
- BMD5=$(md5sum branchtmp |awk '{print $1}')
- rm branchtmp
+ git branch -a --contains $SHA1 | grep -v remote | sort | uniq |sed -e 
's/\*//'|sed -e 's/ //g' > $CWD/branchtmp
+ BMD5=$(md5sum $CWD/branchtmp |awk '{print $1}')
+ rm $CWD/branchtmp
 
- git diff --raw $SHA1^ $SHA1 > keytmp
- DIFFKEY=$(md5sum keytmp |awk '{print $1}')
- rm keytmp
+ git diff --raw $SHA1^ $SHA1 > $CWD/keytmp
+ DIFFKEY=$(md5sum $CWD/keytmp |awk '{print $1}')
+ rm $CWD/keytmp
 
  echo "SHA1: $SHA1"
  echo "Timestamp: $TSMP"
  echo "Branches MD5: $BMD5"
  echo "Diff MD5: $DIFFKEY"
- echo "$TSMP;$BMD5;$DIFFKEY" >> ukeys
+ echo "$TSMP;$BMD5;$DIFFKEY" >> $CWD/ukeys
   fi
-done < $1
+  echo "" >> $CWD/ukeys
+done < $input_file
 
+cd $new_repo
+
 echo ""
-echo "Remapping:"
+echo "Mapping from $old_repo SHA1 keys to $new_repo SHA1 keys:"
 echo ""
 
 while read p; do
@@ -33,33 +79,33 @@
   TSMP=$(echo "$p" | awk -F';' '{print $1}')
   BMD5=$(echo "$p" | awk -F';' '{print $2}')
   DIFFKEY=$(echo "$p" | awk -F';' '{print $3}')
+  pwd
   echo "Searching for: $TSMP   $BMD5   $DIFFKEY"
-  git log --all --since $TSMP --until $TSMP --pretty=format:"%H" > nkeys
-  echo "" >> nkeys
-  echo "nkeys:"
-  cat nkeys
-  echo ""
+  git log --all --since $TSMP --until $TSMP --pretty=format:"%H" > $CWD/nkeys
+  echo "" >> $CWD/nkeys
   while read d; do
  CSHA1=$d
  echo "CSHA1: $CSHA1"
 
- git branch -a --contains $CSHA1 | grep -v remote | sort | uniq |sed 
-e 's/\*//'|sed -e 's/ //g' > branchtmp
- NBMD5=$(md5sum branchtmp |awk '{print $1}')
+ git branch -a --contains $CSHA1 | grep -v remote | sort | uniq |sed 
-e 's/\*//'|sed -e 's/ //g' > $CWD/branchtmp
+ NBMD5=$(md5sum $CWD/branchtmp |awk '{print $1}')
  echo "NBMD5: $NBMD5"
- rm branchtmp
+ rm $CWD/branchtmp
 
  if [ "$BMD5" == "$NBMD5" ]
  then
- git diff --raw $CSHA1^ $CSHA1 > keytmp
- NDIFFKEY=$(md5sum keytmp |awk '{print $1}')
+ git diff --raw $CSHA1^ $CSHA1 > $CWD/keytmp
+ NDIFFKEY=$(md5sum $CWD/keytmp |awk '{print $1}')
  echo "NDIFFKEY: $NDIFFKEY"
  if [ "$NDIFFKEY" == "$DIFFKEY" ]
  then
  echo "MATCH"
- echo $d >> mapped_keys
+ echo $d >> $CWD/mapped_keys
  fi
- rm keytmp
+ rm $CWD/keytmp
  fi
-  done < nkeys
-  rm nkeys
-done < ukeys
+  done < $CWD/nkeys
+  rm $CWD/nkeys
+done < $CWD/ukeys
+
+cd $CWD

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[78310] brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh

2021-02-23 Thread starseeker--- via brlcad-commits
Revision: 78310
  http://sourceforge.net/p/brlcad/code/78310
Author:   starseeker
Date: 2021-02-23 16:07:16 + (Tue, 23 Feb 2021)
Log Message:
---
Use the branch structure as well in this comparison - it's conceivable 
timestamp and diff contents match but the branch inclusions don't.

Modified Paths:
--
brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh

Modified: brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh
===
--- brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   2021-02-23 15:13:59 UTC 
(rev 78309)
+++ brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   2021-02-23 16:07:16 UTC 
(rev 78310)
@@ -4,15 +4,24 @@
   SHA1=$(echo "$p" | awk -F';' '{print $1}')
   if [ "$SHA1" != "" ]
   then
- echo "SHA1: $SHA1"
  echo $SHA1 >> sha1s_orig
+
  TSMP=$(git log -1 --pretty=format:"%ct%n" $SHA1)
- echo "Timestamp: $TSMP"
+
+ # https://stackoverflow.com/a/7132381
+ git branch -a --contains $SHA1 | grep -v remote | sort | uniq |sed -e 
's/\*//'|sed -e 's/ //g' > branchtmp
+ BMD5=$(md5sum branchtmp |awk '{print $1}')
+ rm branchtmp
+
  git diff --raw $SHA1^ $SHA1 > keytmp
  DIFFKEY=$(md5sum keytmp |awk '{print $1}')
  rm keytmp
- echo "Diffkey: $DIFFKEY"
- echo "$TSMP;$DIFFKEY" >> ukeys
+
+ echo "SHA1: $SHA1"
+ echo "Timestamp: $TSMP"
+ echo "Branches MD5: $BMD5"
+ echo "Diff MD5: $DIFFKEY"
+ echo "$TSMP;$BMD5;$DIFFKEY" >> ukeys
   fi
 done < $1
 
@@ -22,8 +31,9 @@
 
 while read p; do
   TSMP=$(echo "$p" | awk -F';' '{print $1}')
-  DIFFKEY=$(echo "$p" | awk -F';' '{print $2}')
-  echo "$p -> $TSMP   $DIFFKEY"
+  BMD5=$(echo "$p" | awk -F';' '{print $2}')
+  DIFFKEY=$(echo "$p" | awk -F';' '{print $3}')
+  echo "Searching for: $TSMP   $BMD5   $DIFFKEY"
   git log --all --since $TSMP --until $TSMP --pretty=format:"%H" > nkeys
   echo "" >> nkeys
   echo "nkeys:"
@@ -32,15 +42,24 @@
   while read d; do
  CSHA1=$d
  echo "CSHA1: $CSHA1"
- git diff --raw $CSHA1^ $CSHA1 > keytmp
- NDIFFKEY=$(md5sum keytmp |awk '{print $1}')
- echo "NDIFFKEY: $NDIFFKEY"
- if [ "$NDIFFKEY" == "$DIFFKEY" ]
+
+ git branch -a --contains $CSHA1 | grep -v remote | sort | uniq |sed 
-e 's/\*//'|sed -e 's/ //g' > branchtmp
+ NBMD5=$(md5sum branchtmp |awk '{print $1}')
+ echo "NBMD5: $NBMD5"
+ rm branchtmp
+
+ if [ "$BMD5" == "$NBMD5" ]
  then
- echo "MATCH"
- echo $d >> mapped_keys
+ git diff --raw $CSHA1^ $CSHA1 > keytmp
+ NDIFFKEY=$(md5sum keytmp |awk '{print $1}')
+ echo "NDIFFKEY: $NDIFFKEY"
+ if [ "$NDIFFKEY" == "$DIFFKEY" ]
+ then
+ echo "MATCH"
+ echo $d >> mapped_keys
+ fi
+ rm keytmp
  fi
- rm keytmp
   done < nkeys
   rm nkeys
 done < ukeys

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[78309] brlcad/trunk/misc

2021-02-23 Thread starseeker--- via brlcad-commits
Revision: 78309
  http://sourceforge.net/p/brlcad/code/78309
Author:   starseeker
Date: 2021-02-23 15:13:59 + (Tue, 23 Feb 2021)
Log Message:
---
Hopefully it won't be necessary, but if it is - start figuring out how to remap 
the SHA1 keys in the various custom files from an old repo to a new.

Modified Paths:
--
brlcad/trunk/misc/CMakeLists.txt

Added Paths:
---
brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh

Modified: brlcad/trunk/misc/CMakeLists.txt
===
--- brlcad/trunk/misc/CMakeLists.txt2021-02-23 13:46:34 UTC (rev 78308)
+++ brlcad/trunk/misc/CMakeLists.txt2021-02-23 15:13:59 UTC (rev 78309)
@@ -215,6 +215,7 @@
   repoconv/manual_merge_info.tar.gz
   repoconv/md5.hpp
   repoconv/sha1.hpp
+  repoconv/sha1_to_uniqkey.sh
   repoconv/svn2git/README
   repoconv/svn2git/archive_branches.sh
   repoconv/svn2git/rules

Added: brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh
===
--- brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   
(rev 0)
+++ brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh   2021-02-23 15:13:59 UTC 
(rev 78309)
@@ -0,0 +1,46 @@
+#!/bin/bash
+rm -f sha1s_orig ukeys nkeys mapped_keys
+while read p; do
+  SHA1=$(echo "$p" | awk -F';' '{print $1}')
+  if [ "$SHA1" != "" ]
+  then
+ echo "SHA1: $SHA1"
+ echo $SHA1 >> sha1s_orig
+ TSMP=$(git log -1 --pretty=format:"%ct%n" $SHA1)
+ echo "Timestamp: $TSMP"
+ git diff --raw $SHA1^ $SHA1 > keytmp
+ DIFFKEY=$(md5sum keytmp |awk '{print $1}')
+ rm keytmp
+ echo "Diffkey: $DIFFKEY"
+ echo "$TSMP;$DIFFKEY" >> ukeys
+  fi
+done < $1
+
+echo ""
+echo "Remapping:"
+echo ""
+
+while read p; do
+  TSMP=$(echo "$p" | awk -F';' '{print $1}')
+  DIFFKEY=$(echo "$p" | awk -F';' '{print $2}')
+  echo "$p -> $TSMP   $DIFFKEY"
+  git log --all --since $TSMP --until $TSMP --pretty=format:"%H" > nkeys
+  echo "" >> nkeys
+  echo "nkeys:"
+  cat nkeys
+  echo ""
+  while read d; do
+ CSHA1=$d
+ echo "CSHA1: $CSHA1"
+ git diff --raw $CSHA1^ $CSHA1 > keytmp
+ NDIFFKEY=$(md5sum keytmp |awk '{print $1}')
+ echo "NDIFFKEY: $NDIFFKEY"
+ if [ "$NDIFFKEY" == "$DIFFKEY" ]
+ then
+ echo "MATCH"
+ echo $d >> mapped_keys
+ fi
+ rm keytmp
+  done < nkeys
+  rm nkeys
+done < ukeys


Property changes on: brlcad/trunk/misc/repoconv/sha1_to_uniqkey.sh
___
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/x-sh
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[78308] brlcad/trunk/misc/repoconv/NOTES

2021-02-23 Thread starseeker--- via brlcad-commits
Revision: 78308
  http://sourceforge.net/p/brlcad/code/78308
Author:   starseeker
Date: 2021-02-23 13:46:34 + (Tue, 23 Feb 2021)
Log Message:
---
Note trivial but typing saving scripts to use for querying local SVN copy of 
repo.

Modified Paths:
--
brlcad/trunk/misc/repoconv/NOTES

Modified: brlcad/trunk/misc/repoconv/NOTES
===
--- brlcad/trunk/misc/repoconv/NOTES2021-02-23 13:30:17 UTC (rev 78307)
+++ brlcad/trunk/misc/repoconv/NOTES2021-02-23 13:46:34 UTC (rev 78308)
@@ -350,4 +350,20 @@
 but it would mean re-keying all of the information in those files to a new set 
of
 SHA1 keys manually...
 
+###
+Handy scripts for getting local svn info quickly:
 
+List files associated with a commit, either from a specific branch or the
+whole of the repo:
+#!/bin/bash
+if [ "$#" -eq 2 ]; then
+svn diff -c$1 file:///home/user/brlcad_repo/brlcad/branches/$2|grep ^Index
+fi
+if [ "$#" -eq 1 ]; then
+svn diff -c$1 file:///home/user/brlcad_repo/brlcad|grep ^Index
+fi
+
+Get log message associated with a commit:
+#!/bin/bash
+svn log -c$1 file:///home/user/brlcad_repo
+

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits


[brlcad-commits] SF.net SVN: brlcad:[78307] brlcad/trunk/misc/repoconv/NOTES

2021-02-23 Thread starseeker--- via brlcad-commits
Revision: 78307
  http://sourceforge.net/p/brlcad/code/78307
Author:   starseeker
Date: 2021-02-23 13:30:17 + (Tue, 23 Feb 2021)
Log Message:
---
Explain why some of the files are keyed the way they are...

Modified Paths:
--
brlcad/trunk/misc/repoconv/NOTES

Modified: brlcad/trunk/misc/repoconv/NOTES
===
--- brlcad/trunk/misc/repoconv/NOTES2021-02-22 20:07:17 UTC (rev 78306)
+++ brlcad/trunk/misc/repoconv/NOTES2021-02-23 13:30:17 UTC (rev 78307)
@@ -331,3 +331,23 @@
 http://esr.ibiblio.org/?p=8607
 https://gitlab.com/ideasman42/blender-git-migration/
 
+
+
+Note: The files svn_rev_updates.txt, tag_commits.txt, and 
branch_corrections.txt
+assume a repository produced by the version of repowork at SVN r76568  (i.e.
+their sha1 keys assume the output produced by the following options at that
+version - newer versions have a processing difference that's not been fixed yet
+that doesn't keep the line between the message and the footer):
+
+./repowork -t -e email_fixups.txt \
+-n -r cvs_git \
+-s rev_map \
+--keymap msgtime_sha1_map --cvs-auth-map key_authormap 
--cvs-branch-map key_branchmap \
+brlcad_raw.fi brlcad_final.fi
+
+This setup isn't ideal:  between needing the older revision and the cvs branch
+map assignments setting their incorrect info...  Ideally we would just skip 
them,
+but it would mean re-keying all of the information in those files to a new set 
of
+SHA1 keys manually...
+
+

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



___
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits