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

Re: Track git blame through two unrelated histories

From
Ilia Pozhilov <ilyapoz@gmail.com>
Date
Mar 13, 2023, 11:49 UTC
Message-ID
<CAAo-ADbUf1UqSE1EFf1yOY5Mhu0R5_NQuK8agBpOn60zgpWnVQ@mail.gmail.com>
In-Reply-To
<xmqqwn3pai2d.fsf@gitster.g>

Thank you very much for this! It worked, I found the corresponding commits and did exactly as you suggested. Now blames just work!

Now I will need to figure out if this is push'able to github, but even at this stage it's incredibly useful, I love blames!

On Thu, Mar 9, 2023 at 8:35 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 26 quoted lines
>
> Ilia Pozhilov <ilyapoz@gmail.com> writes:
>
> > So let's say I add two remotes and fetch all the commits, but they
> > look like this:
> >
> > A->B-> .... . . . -> Z    history1
> >
> > 1 -> 2 -> ..... -> 0 history2
> >
> > and file contents in commits Z and 1 are exactly the same, but the
> > commits themselves are completely unrelated for git.
>
> You mean you want to pretend that history "2 -> ... -> 0" was built
> on top of Z?  Here I am assuming that time flows from left to right
> in the picture.
>
> If so, you should be able to graft the histories together, perhaps?
>
> Totally untested but something like
>
>         $ git replace --graft 1 Z
>
> based on my reading of "git help replace" should allow you to
> pretend that Z happened immediately before 1.
>
Previous: Ilia Pozhilov
Message 4 of 4 in “Track git blame through two unrelated histories”
  1. Ilia PozhilovMar 9, 2023
  2. Junio C HamanoMar 9, 2023
  3. Ilia PozhilovMar 13, 2023
  4. Ilia PozhilovMar 13, 2023

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.