Git: Is there a command line option for "Sort by date" for gitk?

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

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

+8
git command-line linux gitk
source share
1 answer

man gitk at least mentions that it accepts the same options as git rev-list , including

 --date-order 

This option is similar to --topo-order in the sense that the parent does not appear in front of all its children, but is otherwise ordered in the order of the commit timestamp.

See the " Gitk Understanding Guide? " For details.


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

The fact is that --date-order builds and mixes commits on the same development chain, and thereby makes different chains of development much more difficult to see.
It also ends up in a more "parallel" way, which in turn makes browsing even more difficult to read.

Therefore, I suggest not using --date-order by default. It does not add anything for any normal flow, and it makes the big picture harder to see.

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

  • when the big picture is really very simple, and you really want to see in more detail, because the big picture is too trivial to even be interesting otherwise. (In other words: --date-order great for really simple development where there are only a few branches or where you have cut off so much history that the rest is simple)
  • when you want to debug the behavior of " git rev-list ", since date order really matters for how git crosses the commit chains.

The second case is that I suspect no one but me and some other people have ever done. I found this very useful with --show-all when I debugged the revision walker (see Commit " Add" --show-all "version walker flag for debugging " and " Make a version that limits more reliable protection against accidental failed dates) commit ", where the first implements --show-all , and the second is the end result of my debugging).

In other words: never start with " -d " or " --date-order " by default.
Only if you have reason to think that the view is too simple or you need to expand the commit relationship if you use it.

+10
source share

All Articles