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

Re: Git log print commits between a revision range (inclusive)

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 5, 2019, 23:52 UTC
Message-ID
<xmqqimwwswum.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CACUQV5_VCYdBoi=Vz97KVSWipzf+tbi2wrkY1U2h4i78FxVY-w@mail.gmail.com>
Rafael Ascensão <rafa.almas@gmail.com> writes:
Show 10 quoted lines
> As Junio mentioned, "A..B" means all commits reachable from B except those
> reachable from A. Understanding this is just a way to say "B --not A" is
> important to know you can take advantage of:
>
> `--boundary`
>     Output excluded boundary commits. Boundary commits are prefixed with -.
>
> In other words, git log --boundary <older hash>..<newer hash> should give you
> exactly what you asked with the small caveat it marks excluded commits
> differently.

You are correct, but only when dealing with a single strand of pearls. If the history leading to <newer> is bushy with merges, the above will give _far_ more than what was requested. The fork points of the side branches that got merged during <old>..<new> will also be shown, in addition to the <old>.

Previous: Rafael Ascensão
Message 5 of 5 in “Git log print commits between a revision range (inclusive)”
  1. wuzhouhuiMar 4, 2019
  2. wuzhouhuiMar 4, 2019
  3. Junio C HamanoMar 4, 2019
  4. Rafael AscensãoMar 5, 2019
  5. Junio C HamanoMar 5, 2019

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.