From: Junio C Hamano Date: Tue, 28 Apr 2026 01:22:01 +0000 (+0900) Subject: Merge branch 'ps/shift-root-in-graph' into seen X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=0c5f831e3948908ca9d26bf4faba8fecc00c0b32;p=thirdparty%2Fgit.git Merge branch 'ps/shift-root-in-graph' into seen In a history with more than one root commit, "git log --graph --oneline" stuffed an unrelated commit immediately below a root commit, which has been corrected by making the spot below a root unavailable. * ps/shift-root-in-graph: graph: add indentation for commits preceded by a parentless commit --- 0c5f831e3948908ca9d26bf4faba8fecc00c0b32 diff --cc graph.c index 842282685f,97292df998..357dde0240 --- a/graph.c +++ b/graph.c @@@ -868,11 -908,10 +930,14 @@@ static void graph_output_padding_line(s * Output a padding row, that leaves all branch lines unchanged */ for (i = 0; i < graph->num_new_columns; i++) { + if (graph_needs_truncation(graph, i)) { + graph_line_addstr(line, "~ "); + break; + } - graph_line_write_column(line, &graph->new_columns[i], '|'); + if (graph->new_columns[i].is_placeholder) + graph_line_write_column(line, &graph->new_columns[i], ' '); + else + graph_line_write_column(line, &graph->new_columns[i], '|'); graph_line_addch(line, ' '); } } @@@ -1243,14 -1225,20 +1335,25 @@@ static void graph_output_post_merge_lin graph_line_write_column(line, col, '\\'); else graph_line_write_column(line, col, '|'); - graph_line_addch(line, ' '); + /* + * If it's between two lanes and next would be truncated, + * don't add space padding. + */ + if (!graph_needs_truncation(graph, i + 1)) + graph_line_addch(line, ' '); } else { - graph_line_write_column(line, col, '|'); + if (col->is_placeholder) { + /* + * Same placeholder handling as in + * graph_output_commit_line(). + */ + if (seen_this) + continue; + graph_line_write_column(line, col, ' '); + } else { + graph_line_write_column(line, col, '|'); + } + if (graph->merge_layout != 0 || i != graph->commit_index - 1) { if (parent_col) graph_line_write_column(