abc896118b1b7aaf66ff3ade939f34edf49ac97a
markd
  Thu Apr 23 13:56:57 2026 -0700
switch gencode all,joiner to use macros instead of growing every release  #37436

diff --git src/hg/lib/joiner.c src/hg/lib/joiner.c
index d1915d5fe1f..ec1a01c639d 100644
--- src/hg/lib/joiner.c
+++ src/hg/lib/joiner.c
@@ -778,51 +778,58 @@
 	    newJs->external = cloneString(js->external);
 	    newJs->description = cloneString(js->description);
 	    newJs->isFuzzy = js->isFuzzy;
 	    newJs->lineIx = js->lineIx;
 	    newJs->isDependency = js->isDependency;
 
 	    /* Fill in new joiner fieldList */
 	    for (jf = js->fieldList; jf != NULL; jf = jf->next)
 	        {
 		char *bs = NULL, *be = NULL;
 		/* Allocate vars and do basic fields. */
 		AllocVar(newJf);
 		newJf->dbList = slNameCloneList(jf->dbList);
 		newJf->field = cloneString(jf->field);
 		newJf->chopBefore = slNameCloneList(jf->chopBefore);
-		newJf->chopAfter = slNameCloneList(jf->chopBefore);
+		newJf->chopAfter = slNameCloneList(jf->chopAfter);
 		newJf->separator = cloneString(jf->separator);
 		newJf->indexOf = jf->indexOf;
 		newJf->isPrimary = jf->isPrimary;
 		newJf->unique = jf->unique;
 		newJf->full = jf->full;
 		newJf->minCheck = jf->minCheck;
 		newJf->splitPrefix = cloneString(jf->splitPrefix);
 		newJf->exclude = slNameCloneList(jf->exclude);
 
-		/* Do substituted table field. */
+		/* Do substituted table field.  If the field has no [] it is
+		 * version-less and is copied as-is to each expansion. */
 		if ((bs = strchr(jf->table, '[')) != NULL)
+		    {
 		    be = strchr(bs, ']');
-		if (bs == NULL || be == NULL)
-		    errAbort("Missing [] in field '%s' line %d of %s",
+		    if (be == NULL)
+			errAbort("[ without ] in field '%s' line %d of %s",
 			    jf->table, jf->lineIx, joiner->fileName);
 		    dyStringClear(dy);
 		    dyStringAppendN(dy, jf->table, bs - jf->table);
 		    dyStringAppend(dy, dbStart);
 		    dyStringAppend(dy, be+1);
 		    newJf->table = cloneString(dy->string);
+		    }
+		else
+		    {
+		    newJf->table = cloneString(jf->table);
+		    }
 
 		slAddHead(&newJs->fieldList, newJf);
 		}
 	    newJs->expanded = TRUE;
 	    slReverse(&newJs->fieldList);
 	    slAddHead(&newList, newJs);
 
 	    dbStart = dbEnd;
 	    }
 	dyStringFree(&dy);
 	freez(&dbCommaList);
 	joinerSetFree(&js);
 	}
     else
         {