about summary refs log tree commit diff stats
path: root/003trace.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-07-05 00:53:12 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-07-05 00:53:12 -0700
commitf28f2636c6707e1a33bebacafd0486f4965978ea (patch)
treeeba4edbcbf6cd4ad1e14b9629613003bf224c3f1 /003trace.cc
parent7e85c3362ce7e34165d90695fb86d3e421837fe8 (diff)
downloadmu-f28f2636c6707e1a33bebacafd0486f4965978ea.tar.gz
3101 - purge .traces/ dir from repo history
I'd been toying with this idea for some time now given how large the
repo had been growing. The final straw was noticing that people cloning
the repo were having to wait *5 minutes*! That's not good, particularly
for a project with 'tiny' in its description. After purging .traces/
clone time drops to 7 seconds in my tests.

Major issue: some commits refer to .traces/ but don't really change
anything there. That could get confusing :/

Minor issues:

a) I've linked inside commits on GitHub like a half-dozen times online
or over email. Those links are now liable to eventually break. (I seem
to recall GitHub keeps them around as long as they get used at least
once every 60 days, or something like that.)

b) Numbering of commits is messed up because some commits only had
changes to the .traces/ sub-directory.
Diffstat (limited to '003trace.cc')
-rw-r--r--003trace.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/003trace.cc b/003trace.cc
index 2481c0be..23fd8781 100644
--- a/003trace.cc
+++ b/003trace.cc
@@ -181,22 +181,19 @@ ostream& operator<<(ostream& os, unused end) {
 
 #define DUMP(label)  if (Trace_stream) cerr << Trace_stream->readable_contents(label);
 
-// All scenarios save their traces in the repo, just like code. This gives
-// future readers more meat when they try to make sense of a new project.
-static string Trace_dir = ".traces/";
-string Trace_file;
+bool Save_trace = false;
 
 // Trace_stream is a resource, lease_tracer uses RAII to manage it.
 struct lease_tracer {
   lease_tracer() { Trace_stream = new trace_stream; }
   ~lease_tracer() {
     if (!Trace_stream) return;  // in case tests close Trace_stream
-    if (!Trace_file.empty()) {
-      ofstream fout((Trace_dir+Trace_file).c_str());
+    if (Save_trace) {
+      ofstream fout("last_trace");
       fout << Trace_stream->readable_contents("");
       fout.close();
     }
-    delete Trace_stream, Trace_stream = NULL, Trace_file = "";
+    delete Trace_stream, Trace_stream = NULL;
   }
 };