<commit_before>cvmfs_server_publish() {
  local names
  local user
  local exact=0
  local gw_key_file
  local spool_dir
  local stratum0
  local upstream
  local hash_algorithm
  local tweaks_option=
  local tag_name=
  local tag_channel=00
  local tag_description=
  local retcode=0
  local verbosity=""
  local manual_revision=""
  local gc_timespan=0
  local authz_file=""
  local force_external=0
  local force_native=0
  local force_compression_algorithm=""
  local external_option=""
  local open_fd_dialog=1

  # optional parameter handling
  OPTIND=1
  while getopts "F:NXZ:pa:c:m:vn:fe" option
  do
    case $option in
      p)
        tweaks_option="-d"
      ;;
      a)
        tag_name="$OPTARG"
      ;;
      c)
        tag_channel="$OPTARG"
      ;;
      m)
        tag_description="$OPTARG"
      ;;
      v)
        verbosity="-x"
      ;;
      n)
        manual_revision="$OPTARG"
      ;;
      X)
        force_external=1
      ;;
      N)
        force_native=1
      ;;
      Z)
        force_compression_algorithm="$OPTARG"
      ;;
      F)
        authz_file="-F $OPTARG"
      ;;
      f)
        open_fd_dialog=0
      ;;
      e)
        exact=1
      ;;
      ?)
        shift $(($OPTIND-2))
        usage "Command publish: Unrecognized option: $1"
      ;;
    esac
  done

  if [ $(($force_external + $force_native)) -eq 2 ]; then
    usage "Command publish: -N and -X are mutually exclusive"
  fi

  shift $(($OPTIND-1))
  check_parameter_count_for_multiple_repositories $#
  # get repository names
  if [ $exact -eq 0 ]; then
    names=$(get_or_guess_multiple_repository_names "$@")
    check_multiple_repository_existence "$names"
  else
    names=$@
  fi

  # sanity checks
  if [ ! -z "$tag_name" ]; then
    echo $tag_name | grep -q -v " "       || die "Spaces are not allowed in tag names"
    check_tag_existence $name "$tag_name" && die "Tag name '$tag_name' is already in use."
  fi

  for name in $names; do

    # Check if the repo name contains a subpath for locking, e.g. repo.cern.ch/sub/path/for/locking
    local subpath=$(echo $name | cut -d'/' -f2- -s)
    name=$(echo $name | cut -d'/' -f1)

    load_repo_config $name
    # We need the upstream type for configuring the health_check function
    upstream=$CVMFS_UPSTREAM_STORAGE
    upstream_type=$(get_upstream_type $upstream)

    # sanity checks
    is_stratum0 $name   || die "This is not a stratum 0 repository"
    is_publishing $name && die "Another publish process is active for $name"
    if [ x"$upstream_type" = xgw ]; then
        health_check -g -r $name
    else
        health_check -r $name
    fi

    # get repository information
    user=$CVMFS_USER
    gw_key_file=/etc/cvmfs/keys/${name}.gw
    spool_dir=$CVMFS_SPOOL_DIR
    scratch_dir="${spool_dir}/scratch/current"
    stratum0=$CVMFS_STRATUM0
    hash_algorithm="${CVMFS_HASH_ALGORITHM-sha1}"
    compression_alg="${CVMFS_COMPRESSION_ALGORITHM-default}"
    if [ x"$force_compression_algorithm" != "x" ]; then
      compression_alg="$force_compression_algorithm"<commit_msg>cvmfs_server publish - fix invalid position of tag name sanity check<commit_after>cvmfs_server_publish() {
  local names
  local user
  local exact=0
  local gw_key_file
  local spool_dir
  local stratum0
  local upstream
  local hash_algorithm
  local tweaks_option=
  local tag_name=
  local tag_channel=00
  local tag_description=
  local retcode=0
  local verbosity=""
  local manual_revision=""
  local gc_timespan=0
  local authz_file=""
  local force_external=0
  local force_native=0
  local force_compression_algorithm=""
  local external_option=""
  local open_fd_dialog=1

  # optional parameter handling
  OPTIND=1
  while getopts "F:NXZ:pa:c:m:vn:fe" option
  do
    case $option in
      p)
        tweaks_option="-d"
      ;;
      a)
        tag_name="$OPTARG"
      ;;
      c)
        tag_channel="$OPTARG"
      ;;
      m)
        tag_description="$OPTARG"
      ;;
      v)
        verbosity="-x"
      ;;
      n)
        manual_revision="$OPTARG"
      ;;
      X)
        force_external=1
      ;;
      N)
        force_native=1
      ;;
      Z)
        force_compression_algorithm="$OPTARG"
      ;;
      F)
        authz_file="-F $OPTARG"
      ;;
      f)
        open_fd_dialog=0
      ;;
      e)
        exact=1
      ;;
      ?)
        shift $(($OPTIND-2))
        usage "Command publish: Unrecognized option: $1"
      ;;
    esac
  done

  if [ $(($force_external + $force_native)) -eq 2 ]; then
    usage "Command publish: -N and -X are mutually exclusive"
  fi

  shift $(($OPTIND-1))
  check_parameter_count_for_multiple_repositories $#
  # get repository names
  if [ $exact -eq 0 ]; then
    names=$(get_or_guess_multiple_repository_names "$@")
    check_multiple_repository_existence "$names"
  else
    names=$@
  fi

  for name in $names; do
    # sanity checks
    if [ ! -z "$tag_name" ]; then
      echo $tag_name | grep -q -v " "       || die "Spaces are not allowed in tag names"
      check_tag_existence $name "$tag_name" && die "Tag name '$tag_name' is already in use."
    fi

    # Check if the repo name contains a subpath for locking, e.g. repo.cern.ch/sub/path/for/locking
    local subpath=$(echo $name | cut -d'/' -f2- -s)
    name=$(echo $name | cut -d'/' -f1)

    load_repo_config $name
    # We need the upstream type for configuring the health_check function
    upstream=$CVMFS_UPSTREAM_STORAGE
    upstream_type=$(get_upstream_type $upstream)

    # sanity checks
    is_stratum0 $name   || die "This is not a stratum 0 repository"
    is_publishing $name && die "Another publish process is active for $name"
    if [ x"$upstream_type" = xgw ]; then
        health_check -g -r $name
    else
        health_check -r $name
    fi

    # get repository information
    user=$CVMFS_USER
    gw_key_file=/<KEY>
    spool_dir=$CVMFS_SPOOL_DIR
    scratch_dir="${spool_dir}/scratch/current"
    stratum0=$CVMFS_STRATUM0
    hash_algorithm="${CVMFS_HASH_ALGORITHM-sha1}"
    compression_alg="${CVMFS_COMPRESSION_ALGORITHM-default}"
    if [ x"$force_compression_algorithm" != "x" ]; then
      compression_alg="$force_compression_algorithm"
{'fraction_non_alphanumeric': 0.10623781676413255, 'fraction_numerical': 0.008447043534762833, 'mean_word_length': 2.6196355085243974, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5546693', 'n_tokens_mistral': 2166, 'n_tokens_neox': 2084, 'n_words': 508}