gpt4 book ai didi

git - git log --graph 输出中的意外下划线

转载 作者:太空狗 更新时间:2023-10-29 12:47:41 25 4
gpt4 key购买 nike

在我的 Linux 内核副本上运行 git log --graph 时,我在图表中看到一条看起来不应该出现的下划线。

下划线是什么意思?

因此我使用的具体命令是:

git log --graph --decorate --pretty=oneline --abbrev-commit --all --date-order

输出看起来像这样:

git log --graph output

我试过在 gitk 的图表中查看这个区域,但那里似乎没有任何异常。

我不认为这只是显示一个分支点,因为我希望它呈现在右边,而不是左边(左边应该与上图匹配):

I see:        I'd expect for
normal branching:

\ \ \ \ \ \
/ / / / / /
| _ / | / /
| / |/ /
| | | |
| | | |

最佳答案

从 Git 源代码的 ack "'_'" 看来,下划线打印在 graph.c, line 1120 中。 ,在 graph_output_collapsing_line 函数内:

/*
* Output out a line based on the new mapping info
*/
for (i = 0; i < graph->mapping_size; i++) {
int target = graph->new_mapping[i];
if (target < 0)
strbuf_addch(sb, ' ');
else if (target * 2 == i)
strbuf_write_column(sb, &graph->new_columns[target], '|');
else if (target == horizontal_edge_target &&
i != horizontal_edge - 1) {
/*
* Set the mappings for all but the
* first segment to -1 so that they
* won't continue into the next line.
*/
if (i != (target * 2)+3)
graph->new_mapping[i] = -1;
used_horizontal = 1;
strbuf_write_column(sb, &graph->new_columns[target], '_');
} else {
if (used_horizontal && i < horizontal_edge)
graph->new_mapping[i] = -1;
strbuf_write_column(sb, &graph->new_columns[target], '/');

}
}

但是想了想反正也没什么意思。下划线是一个符号,用于从当前分支向左穿过一个不相关的分支,以到达更左边的某个分支点。这可以在您的屏幕截图的其他地方看到,但是这个特殊的下划线看起来真的丢失了。

关于git - git log --graph 输出中的意外下划线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15250012/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com