<commit_before>/*
 * This datum gets revision info from local svn 'entries' file
 * Path to the directory containing it should be in 'config/svndir.txt' file
 *
 */	
var/global/datum/getrev/revdata = new()

//Oh yeah, I'm an OOP fag, lalala
/datum/getrev
	var/project_href
	var/revision
	var/showinfo

	New()
		if(fexists("config/git_host.txt"))
			project_href = file2text("config/git_host.txt")
		else
			project_href = "https://www.github.com/tgstation/-tg-station"
		var/list/head_log = file2list(".git/logs/HEAD", "\n")
		for(var/line=head_log.len, line>=1, line--)
			if(head_log[line])
				var/list/last_entry = text2list(head_log[line], " ")
				if(last_entry.len < 2)	continue
				revision = last_entry[2]
				break
		
		showinfo = "<b>Server Revision:</b> "
		if(revision)
			showinfo += "<a href='[project_href]/commit/[revision]'>[revision]</a>"
		else
			showinfo += "*unknown*"
		showinfo += "<p>-<a href='[project_href]/issues/new'>Report Bugs Here-</a><br><i>Please provide as much info as possible<br>Copy/paste the revision hash into your issue report if possible, thanks</i> :)</p>"
		
		world.log << "Running TG Revision Number: [revision]."
		return

client/verb/showrevinfo()
	set category = "OOC"
	set name = "Show Server Revision"
	var/output = revdata.showinfo<commit_msg>Updates text (TG -> /tg/station), and removes some old comments.<commit_after>var/global/datum/getrev/revdata = new()

/datum/getrev
	var/project_href
	var/revision
	var/showinfo

	New()
		if(fexists("config/git_host.txt"))
			project_href = file2text("config/git_host.txt")
		else
			project_href = "https://www.github.com/tgstation/-tg-station"
		var/list/head_log = file2list(".git/logs/HEAD", "\n")
		for(var/line=head_log.len, line>=1, line--)
			if(head_log[line])
				var/list/last_entry = text2list(head_log[line], " ")
				if(last_entry.len < 2)	continue
				revision = last_entry[2]
				break

		showinfo = "<b>Server Revision:</b> "
		if(revision)
			showinfo += "<a href='[project_href]/commit/[revision]'>[revision]</a>"
		else
			showinfo += "*unknown*"
		showinfo += "<p>-<a href='[project_href]/issues/new'>Report Bugs Here-</a><br><i>Please provide as much info as possible<br>Copy/paste the revision hash into your issue report if possible, thanks</i> :)</p>"

		world.log << "Running /tg/ revision number: [revision]."
		return

client/verb/showrevinfo()
	set category = "OOC"
	set name = "Show Server Revision"
	var/output = revdata.showinfo
{'fraction_non_alphanumeric': 0.16192026037428803, 'fraction_numerical': 0.004882017900732303, 'mean_word_length': 4.080578512396694, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 30, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '3728074', 'n_tokens_mistral': 967, 'n_tokens_neox': 880, 'n_words': 192}