93026392de53b8abf15a3605b88aa6d7fb0f962d
hiram
  Mon May 11 12:05:53 2026 -0700
do not need to run "make" in the trackDb since the "include" line is now a comment refs #31811

diff --git src/hg/utils/otto/userRequests/chainNetTrackDb.pl src/hg/utils/otto/userRequests/chainNetTrackDb.pl
index fd7c05f260f..89c74cfe32c 100755
--- src/hg/utils/otto/userRequests/chainNetTrackDb.pl
+++ src/hg/utils/otto/userRequests/chainNetTrackDb.pl
@@ -285,31 +285,31 @@
 }
 
 ##############################################################################
 # compose stanza, write to file
 ##############################################################################
 my $shortOrg = (length($qOrganism) > 0) ? $qOrganism : $qAcc;
 
 my $longTail;
 if ($qAsmName ne "") {
   $longTail = "${qAcc}_${qAsmName}";
 } else {
   $longTail = $qAcc;
 }
 my $longInner = (length($qDate) > 0) ? "$qDate $longTail" : $longTail;
 
-printf STDERR "### writing to $outFile\n";
+# printf STDERR "### writing to $outFile\n";
 
 open(my $fh, '>', $outFile)
   or die "ERROR: cannot write '$outFile': $!\n";
 
 printf $fh "##############################################################################\n";
 printf $fh "# %s - %s - %s - taxId: %s\n", $qAcc, $shortOrg, $qSciName, $qTaxId;
 printf $fh "##############################################################################\n";
 printf $fh "track chainNet%s\n", $Query;
 printf $fh "compositeTrack on\n";
 printf $fh "shortLabel %s Chain/Net\n", $shortOrg;
 printf $fh "longLabel %s (%s), Chain and Net Alignments\n", $shortOrg, $longInner;
 printf $fh "subGroup1 view Views chain=Chain net=Net\n";
 printf $fh "dragAndDrop subTracks\n";
 printf $fh "visibility hide\n";
 printf $fh "group compGeno\n";
@@ -432,90 +432,104 @@
     printf $fh "        parent mafNet%sViewnet\n", $Query;
     printf $fh "        subGroups view=net\n";
     printf $fh "        shortLabel %s rBestNet\n", $shortOrg;
     printf $fh "        longLabel %s (%s) Reciprocal Best Net Alignment\n", $shortOrg, $longInner;
     printf $fh "        type bigMaf\n";
     printf $fh "        bigDataUrl /gbdb/\$D/chainNet/\$D.%s.rbestNet.bb\n", $qAcc;
     printf $fh "        summary /gbdb/\$D/chainNet/\$D.%s.rbestNet.summary.bb\n", $qAcc;
     printf $fh "        speciesOrder %s\n", $qAcc;
     printf $fh "        speciesLabels %s=\"%s\"\n", $qAcc, $shortOrg;
     printf $fh "\n";
   }
 }
 
 close($fh);
 
-printf STDERR "wrote %s\n", $outFile;
+# printf STDERR "wrote %s\n", $outFile;
 
 ##############################################################################
 # ensure trackDb.ra in the same dir has an 'include <basename> alpha' line
 # for the newly written .ra file; append it if not already present
 ##############################################################################
 my $trackDbRa  = "$outDir/trackDb.ra";
 my $baseName   = "$targetDb.$qAcc.chainNet.ra";
-my $includeLn  = "include $baseName alpha";
+my $includeLn  = "# include $baseName alpha";
 
 my $alreadyIncluded = 0;
 if (-e $trackDbRa) {
   open(my $rh, '<', $trackDbRa)
     or die "ERROR: cannot read '$trackDbRa': $!\n";
   while (my $line = <$rh>) {
-    if ($line =~ /^\s*include\s+\Q$baseName\E(\s|$)/) {
+    if ($line =~ /^#\s*include\s+\Q$baseName\E(\s|$)/) {
       $alreadyIncluded = 1;
       last;
     }
   }
   close($rh);
 }
 
 if (!$alreadyIncluded) {
   open(my $ah, '>>', $trackDbRa)
     or die "ERROR: cannot append to '$trackDbRa': $!\n";
   printf $ah "%s\n", $includeLn;
   close($ah);
-  printf STDERR "appended '%s' to %s\n", $includeLn, $trackDbRa;
+# printf STDERR "appended '%s' to %s\n", $includeLn, $trackDbRa;
 }
 
 ##############################################################################
 # stage the new .ra (and trackDb.ra if it changed) and commit.
 # Requires user.name / user.email configured in the clone's git config.
 ##############################################################################
 my $newRel = $outFile;     $newRel =~ s,^\Q$kentTree/\E,,;
 my $tdbRel = $trackDbRa;   $tdbRel =~ s,^\Q$kentTree/\E,,;
 
+### update this source tree to catch up to the outside world
+if (system('git', '-C', $kentTree, 'pull') != 0) {
+  printf STDERR "ERROR: 'git pull' failed in %s\n", $kentTree;
+  exit 255;
+}
+
 if (system('git', '-C', $kentTree, 'add', '--', $newRel, $tdbRel) != 0) {
   printf STDERR "ERROR: 'git add' failed in %s\n", $kentTree;
   exit 255;
 }
 
 my $gitChanged = 1;
 # nothing to commit if neither file actually changed (idempotent re-runs)
 if (system('git', '-C', $kentTree, 'diff', '--cached', '--quiet') == 0) {
-  printf STDERR "no changes to source tree\n";
+# printf STDERR "no changes to source tree\n";
   $gitChanged = 0;
 }
 
 if ($gitChanged) {
   my $msg = sprintf("chainNet trackDb for %s %s, otto liftOver",
                   $targetDb, $qAcc);
   if (system('git', '-C', $kentTree, 'commit', '-m', $msg) != 0) {
     printf STDERR "ERROR: 'git commit' failed in %s\n", $kentTree;
     exit 255;
   }
-  printf STDERR "committed: %s\n", $msg;
+# printf STDERR "committed: %s\n", $msg;
+
+  # push so the tree doesn't accumulate local commits that block future
+  # 'git pull' / fast-forward updates from master.
+  if (system('git', '-C', $kentTree, 'push') != 0) {
+    printf STDERR "ERROR: 'git push' failed in %s\n", $kentTree;
+    exit 255;
+  }
+# printf STDERR "pushed to remote\n";
 }
 
 ##############################################################################
 # build/install trackDb for the target database (default release + alpha)
 # so the new tracks show up in the genome browser.
 ##############################################################################
-my $tdbDir = "$kentTree/src/hg/makeDb/trackDb";
-for my $args ( ["DBS=$targetDb"], ["DBS=$targetDb", "alpha"] ) {
-  printf STDERR "make -c %s %s\n", $tdbDir, $args->[0];
-  if (system('make', '-C', $tdbDir, @$args) != 0) {
-    printf STDERR "ERROR: 'make -C %s %s' failed\n",
-      $tdbDir, join(' ', @$args);
-    exit 255;
-  }
-}
+# my $tdbDir = "$kentTree/src/hg/makeDb/trackDb";
+# for my $args ( ["DBS=$targetDb"], ["DBS=$targetDb", "alpha"] ) {
+# # printf STDERR "make -c %s %s\n", $tdbDir, $args->[0];
+#   if (system('make', '-C', $tdbDir, @$args) != 0) {
+#     printf STDERR "ERROR: 'make -C %s %s' failed\n",
+#       $tdbDir, join(' ', @$args);
+#     exit 255;
+#   }
+# }
 
 exit 0;