All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ilia Pozhilov <ilyapoz@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Track git blame through two unrelated histories
Date: Thu, 09 Mar 2023 10:35:54 -0800	[thread overview]
Message-ID: <xmqqwn3pai2d.fsf@gitster.g> (raw)
In-Reply-To: <CAAo-ADZBBRxSROeAwrA9o30Etf3QQhLCaWQJtVsChVwT-AbgTg@mail.gmail.com> (Ilia Pozhilov's message of "Thu, 9 Mar 2023 13:05:07 +0200")

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.


  reply	other threads:[~2023-03-09 18:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 11:05 Track git blame through two unrelated histories Ilia Pozhilov
2023-03-09 18:35 ` Junio C Hamano [this message]
2023-03-13 11:48   ` Ilia Pozhilov
2023-03-13 11:49   ` Ilia Pozhilov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqwn3pai2d.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ilyapoz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.