2

環境

$ git --version
git version 2.33.0

質問

git logコマンドは、デフォルトではコミット順で表示する--topo-orderオプションが有効になっています。

       --topo-order
           Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed.

           For example, in a commit history like this:

                   ---1----2----4----7
                       \              \
                        3----5----6----8---

           where the numbers denote the order of commit timestamps, git rev-list and friends with --date-order show the commits in the timestamp order: 8 7 6 5 4 3 2 1.

           With --topo-order, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5 3 1); some older commits are shown before newer ones in order to avoid showing the commits from two parallel development track
           mixed together.

https://git-scm.com/docs/git-log

--topo-orderオプションのtopoはどのような意味でしょうか?

2 件の回答 2

1

トポロジカルソートという言葉で使われる topological と同じ意味でしょう。つまり --topo-order とは、トポロジカルソートで並べたときの順番、という意味です。

(ここでいうトポロジーとはネットワーク・トポロジーという言葉で使われるような意味合いで、それぞれのコミットの親子関係のネットワーク構造のことを指しているといって差し支えないはずです。)

1

言葉の意味までは私も詳しくないので解説できませんが、恐らく topological の略かと思われます。

How can I sort a set of git commit IDs in topological order? - Stack Overflow

Topological order (Wikipedia)

この質問に回答するには、ログインする必要があります。

求めていた回答ではありませんか? のタグが付いた他の質問を参照する。