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

Re: [feature request] find git commit log before rebase

From
Sebastian Staudt <koraktor@gmail.com>
Date
May 26, 2016, 20:37 UTC
Message-ID
<CA+xP2SZgYYcQOVcWQsEY2YccW3cwONOhXOvViCfH2ONvm5-G8g@mail.gmail.com>
In-Reply-To
<CAKkAvax5Yf2=qLhVkn8EgkNEgHL97Doxr3JWR10aqxksYVsYXA@mail.gmail.com>
Hi.
I think what you want is `git reflog` (http://git-scm.com/man/reflog).
git reflog b
Will tell you the commits b pointed to in the past.
Best regards,
    Sebastian
2016-05-26 18:55 GMT+02:00 ryenus <ryenus@gmail.com>:
Show 38 quoted lines
> Assuming I have branches master (m), and a side branch (b), with a
> history tree like below:
>
> m0 --- m1 -- m2 -- m3 -- m4 --- master (m)
>         \          /      \
>         b1 ------ b2       b3 -- b4 -- branch (b) (HEAD)
>                   |
>       (tag:POINT_BEFORE_REBASE)
>
> The history of branch b is can be described as:
>
> 1. branch b is forked at point of m1
> 2. branch b is merged to master into m3,
> 3. branch b then is rebased (fast-forward) from b2 to m4
> 4. then branch b started its new life as b3 b4 after rebase
>
> With the following command: I can find b3 and b4 since last fork-point
>
>     git log --oneline $(git merge-base --fork-point master)..b
>
> But how to find out commits b1 b2, given the fact that b2 is the point
> before rebase?
>
> I understand it can be achieved via:
>
>     git log --oneline m2..b2
>
> That's because I know b2 is the point before rebase,
> and m2 is another child of the subsequent merge commit m3
>
> I wonder how to do this with an simple (enough) command without me
> looking through the history and find b2 and m2 manually?
>
> Thanks!
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: ryenusNext: ryenus
Message 2 of 3 in “[feature request] find git commit log before rebase”
  1. ryenusMay 26, 2016
  2. Sebastian StaudtMay 26, 2016
  3. ryenusMay 27, 2016

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.