linux – git:gitk有“按日期排序”的命令行选项吗?

前端之家收集整理的这篇文章主要介绍了linux – git:gitk有“按日期排序”的命令行选项吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试为gitk找到一个命令行选项,该选项与“View / Edit view …”窗口中的“按日期严格排序”具有相同的效果.

与GUI中提供的选项相比,man gitk显示的选项数量非常有限.

解决方法

man gitk至少提到它确实采取与 git rev-list相同的选项,包括
--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.

有关更多信息,请参见“Guide to understanding gitk?”.

注意:如果-d或–date-order确实是你所追求的参数,最好不要使用太多,根据Linus本人(从lists-archives.com/gitwww.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 “07005” and “07006”,
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.

猜你在找的Linux相关文章