Skip to content

Commit 2ec1b42

Browse files
committed
show started, not finished, edges in progress
In verbose mode (where we don't overprint) it's confusing to show [0/XX] for the first N commands we start. In smart terminal mode, I can't really tell the difference.
1 parent 2f4244e commit 2ec1b42

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/build.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct BuildStatus {
6262
/// Time we last printed an update.
6363
int64_t last_update_millis_;
6464

65-
int finished_edges_, total_edges_;
65+
int started_edges_, finished_edges_, total_edges_;
6666

6767
/// Map of running edge to time the edge started running.
6868
typedef map<Edge*, int> RunningEdgeMap;
@@ -76,7 +76,7 @@ BuildStatus::BuildStatus(const BuildConfig& config)
7676
: config_(config),
7777
start_time_millis_(GetTimeMillis()),
7878
last_update_millis_(start_time_millis_),
79-
finished_edges_(0), total_edges_(0) {
79+
started_edges_(0), finished_edges_(0), total_edges_(0) {
8080
#ifndef WIN32
8181
const char* term = getenv("TERM");
8282
smart_terminal_ = isatty(1) && term && string(term) != "dumb";
@@ -96,6 +96,7 @@ void BuildStatus::PlanHasTotalEdges(int total) {
9696
void BuildStatus::BuildEdgeStarted(Edge* edge) {
9797
int start_time = (int)(GetTimeMillis() - start_time_millis_);
9898
running_edges_.insert(make_pair(edge, start_time));
99+
++started_edges_;
99100

100101
PrintStatus(edge);
101102
}
@@ -157,7 +158,7 @@ void BuildStatus::PrintStatus(Edge* edge) {
157158
if (smart_terminal_)
158159
printf("\r"); // Print over previous line, if any.
159160

160-
int progress_chars = printf("[%d/%d] ", finished_edges_, total_edges_);
161+
int progress_chars = printf("[%d/%d] ", started_edges_, total_edges_);
161162

162163
#ifndef WIN32
163164
if (smart_terminal_ && !force_full_command) {

0 commit comments

Comments
 (0)