<commit_before>#/bin/bash
# Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
# derived from https://gist.github.com/m14t/3056747
 
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL"  ]; then
  echo "-- ERROR:  Could not identify Repo url."
  echo "   It is possible this repo is already using SSH instead of HTTPS."
  exit
fi
       
USER=`echo $REPO_URL | sed -Ene's#https://github.com/([^/]*)/(.*).git#\1#p'`
if [ -z "$USER"  ]; then
  echo "-- ERROR:  Could not identify User."
  exit
fi
           
REPO=`echo $REPO_URL | sed -Ene's#https://github.com/([^/]*)/(.*).git#\2#p'`
if [ -z "$REPO"  ]; then
  echo "-- ERROR:  Could not identify Repo."
  exit
fi
               
NEW_URL="git@github.com:$USER/$REPO.git"
echo "Changing repo url from "
echo "  '$REPO_URL'"
echo "      to "<commit_msg>improved fix script to also work without .git<commit_after>#!/bin/bash -x
# Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
# derived from https://gist.github.com/m14t/3056747
 
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL"  ]; then
  echo "-- ERROR:  Could not identify Repo url."
  echo "   It is possible this repo is already using SSH instead of HTTPS."
  exit
fi
       
USER=`echo $REPO_URL | sed -Ene's#https://github.com/([^/]*)/(.*)(.git|)#\1#p'`
if [ -z "$USER"  ]; then
  echo "-- ERROR:  Could not identify User."
  exit
fi
           
REPO=`echo $REPO_URL | sed -Ene's#https://github.com/([^/]*)/(.*)(.git|)#\2#p'`
if [ -z "$REPO"  ]; then
  echo "-- ERROR:  Could not identify Repo."
  exit
fi
               
NEW_URL="git@github.com:$USER/$REPO.git"
echo "Changing repo url from "
echo "  '$REPO_URL'"
echo "      to "
{'fraction_non_alphanumeric': 0.204004329004329, 'fraction_numerical': 0.01406926406926407, 'mean_word_length': 2.860125260960334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3801266', 'n_tokens_mistral': 751, 'n_tokens_neox': 698, 'n_words': 176}