From 97c5949ffeb4ec84cec1290c118cf34aa0e503e4 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Mon, 28 Oct 2019 13:11:03 +0100 Subject: Revert "1492 add column headers to .ninja_log" This reverts commit cfd0bd3007b291df505f8c45083453310142d681. See #1662. --- src/build_log.cc | 4 +--- src/build_log_test.cc | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/build_log.cc b/src/build_log.cc index 774f72f..c4a08a0 100644 --- a/src/build_log.cc +++ b/src/build_log.cc @@ -49,7 +49,6 @@ namespace { const char kFileSignature[] = "# ninja log v%d\n"; -const char kFileColumnLabels[] = "# start_time end_time mtime command hash\n"; const int kOldestSupportedVersion = 4; const int kCurrentVersion = 5; @@ -145,8 +144,7 @@ bool BuildLog::OpenForWrite(const string& path, const BuildLogUser& user, fseek(log_file_, 0, SEEK_END); if (ftell(log_file_) == 0) { - if (fprintf(log_file_, kFileSignature, kCurrentVersion) < 0 || - fprintf(log_file_, kFileColumnLabels) < 0) { + if (fprintf(log_file_, kFileSignature, kCurrentVersion) < 0) { *err = strerror(errno); return false; } diff --git a/src/build_log_test.cc b/src/build_log_test.cc index eea818f..ad30380 100644 --- a/src/build_log_test.cc +++ b/src/build_log_test.cc @@ -70,9 +70,8 @@ TEST_F(BuildLogTest, WriteRead) { } TEST_F(BuildLogTest, FirstWriteAddsSignature) { - const char kExpectedContent[] = "# ninja log vX\n" - "# start_time end_time mtime command hash\n"; - const size_t kVersionPos = 13; // Points at 'X'. + const char kExpectedVersion[] = "# ninja log vX\n"; + const size_t kVersionPos = strlen(kExpectedVersion) - 2; // Points at 'X'. BuildLog log; string contents, err; @@ -85,7 +84,7 @@ TEST_F(BuildLogTest, FirstWriteAddsSignature) { ASSERT_EQ("", err); if (contents.size() >= kVersionPos) contents[kVersionPos] = 'X'; - EXPECT_EQ(kExpectedContent, contents); + EXPECT_EQ(kExpectedVersion, contents); // Opening the file anew shouldn't add a second version string. EXPECT_TRUE(log.OpenForWrite(kTestFilename, *this, &err)); @@ -97,7 +96,7 @@ TEST_F(BuildLogTest, FirstWriteAddsSignature) { ASSERT_EQ("", err); if (contents.size() >= kVersionPos) contents[kVersionPos] = 'X'; - EXPECT_EQ(kExpectedContent, contents); + EXPECT_EQ(kExpectedVersion, contents); } TEST_F(BuildLogTest, DoubleEntry) { -- cgit v0.12