git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Ordering list of commits by topo-order

From
ÍHÍñigo Huguet <ihuguet@redhat.com>
Date
Nov 15, 2021, 14:59 UTC
Message-ID
<CACT4oufbbtCUjd1DcBcmUYhh_dmgsXxXLGSCrOstNxrwYEA4Sg@mail.gmail.com>

Hello, I have a list of hashes of commits which I want to order by topological order. I'm trying this: `git rev-list --topo-order --no-walk <commit1> <commit2>`

However, no matter what I do, I always get the 2 commits in the order I provide them in the input.

As an example, I'm using commits from Linux kernel `e4073430ee1de` and `0d55b76fd815f4`:

$ git log --topo-order -2 --oneline 0d55b76fd815f4 0d55b76fd815 ath11k: setup REO for WCN6855 e4073430ee1d ath11k: add dp support for WCN6855

$ git rev-list --topo-order --no-walk 0d55b76fd815f4 e4073430ee1de 0d55b76fd815f4d685a62afe44e623501186ceb4 e4073430ee1dec5402a6158755ac8b84eade83c6

$ git rev-list --topo-order --no-walk e4073430ee1de 0d55b76fd815f4 e4073430ee1dec5402a6158755ac8b84eade83c6 0d55b76fd815f4d685a62afe44e623501186ceb4

$ git rev-list --topo-order --no-walk=sorted e4073430ee1de 0d55b76fd815f4 e4073430ee1dec5402a6158755ac8b84eade83c6 0d55b76fd815f4d685a62afe44e623501186ceb4

Is it possible to obtain a fixed list of commits sorted by topological order?
-- 
Íñigo Huguet
Message 1 of 1 in “Ordering list of commits by topo-order”
  1. Íñigo HuguetNov 15, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.