git:是否有“按日期排序”的命令行选项?对于 gitk?

发布于 2024-12-17 00:50:27 字数 107 浏览 3 评论 0 原文

我试图为 gitk 找到一个命令行选项,它与“查看/编辑视图...”窗口中的“严格按日期排序”具有相同的效果。

与 GUI 中可用的选项相比,man gitk 显示的选项数量非常有限。

I'm trying to find a command line option for gitk that has the same effect of "Strictly sort by date" in the "View / Edit view..." window.

man gitk shows a very limited number of options compared to those available in the GUI.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹤舞 2024-12-24 00:50:28

man gitk 至少提到它确实采用与 <强>git rev-list , 包括

--date-order 

此选项类似于 --topo-order ,因为没有父级出现在其所有子级之前,但除此之外,事物仍按提交时间戳顺序排序。

有关更多信息,请参阅“理解 gitk 指南?”。


注意:根据 Linus 本人的说法,如果 -d--date-order 确实是您所追求的参数,最好不要使用太多(来自 lists-archives.com/gitwww.spinics.net/lists/git/):

问题是,--date-order 字符串输出并混合了
相同的开发链,这样就可以形成不同的开发链
发展更难看到。
它还最终显示了发展
一种更“并行”的方式,这反过来又使视图更难阅读。

所以我建议默认情况下不要使用 --date-order 。它不添加
任何正常流程的任何事情,这使得大局变得更难看到。

您真正想要--date-order(或“-d”,这是简写)的唯一时间
因为它只是 gitk)真的

  • 当大局真的非常简单,而你确实想要
    查看更多细节,因为大局太微不足道了
    否则很有趣。
    (换句话说: --date-order 对于非常简单的开发来说很好
    那里只有几个分支或者你有
    删除了太多的历史,剩下的部分就很简单了)
  • 当您想要调试“git rev-list”行为本身时,自该日期起
    顺序实际上对于 git 如何遍历提交链很重要。

第二个案例是我怀疑除了我和其他一些人之外没有人怀疑的事情
人们曾经做过。
当我调试修订版本步行器时,我发现它与 --show-all 一起非常有用(请参阅提交“添加“--show-all”版本步行器标志以进行调试”和"针对偶尔出现的错误提交日期使修订限制更加强大",
其中第一个实现了 --show-all,第二个是结束
我调试的结果)。

换句话说:默认情况下永远不要以“-d”或“--date-order”开头。
仅当您有某种理由认为该视图太简单或
如果您使用它,您需要深入了解提交关系。

The man gitk at least mentions it does take the same options than git rev-list, including

--date-order 

This option is similar to --topo-order in the sense that no parent comes before all of its children, but otherwise things are still ordered in the commit timestamp order.

See "Guide to understanding gitk?" for more.


Note: if -d or --date-order is really the argument you are after, better not using too much, according to Linus himself (from lists-archives.com/git or www.spinics.net/lists/git/):

The thing is, --date-order strings out and mixes up the commits on the
same development chain, and by doing so it makes the different chains of
development much harder to see.
It also ends up showing the development in
a more "parallel" way, which in turn makes the view even harder to read.

So I would suggest not using --date-order by default. It doesn't add
anything to any normal flow, and it makes the big picture harder to see.

The only time you really want --date-order (or "-d", which is shorthand
for it for just gitk) is really

  • when the big picture is really really simple, and you actually want to
    see more detail because the big picture is too trivial to even be
    interesting otherwise.
    (In other words: --date-order is fine for really simple development
    where there is only ever just a couple of branches or where you have
    pruned away so much of the history that the remaining part is simple)
  • when you want to debug "git rev-list" behaviour itself, since the date
    order actually matters for how git traverses the commit chains.

The second case is something that I suspect nobody but me and a few other
people have ever done.
I found it very useful together with --show-all when I was debugging the revision walker (see commits "Add "--show-all" revision walker flag for debugging" and "Make revision limiting more robust against occasional bad commit dates ",
where the first implements --show-all, and the second one is the end
result of my debugging).

In other words: never start out with "-d" or "--date-order" by default.
Only if you have some reason to then think that the view is too simple or
you need to drill down into the commit relationships should you use it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文