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

Re: merge smart enough to adapt to renames?

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Feb 20, 2009, 00:36 UTC
Message-ID
<slrngprunn.hbo.sitaramc@sitaramc.homelinux.net>
In-Reply-To
<81bfc67a0902191158x5f0f92d1p7e4af2f9cda50a12@mail.gmail.com>
On 2009-02-19, Caleb Cushing <xenoterracide@gmail.com> wrote:
Show 8 quoted lines
>> Yes.  I maintain two copies of something (in different
>> repos) like this...
>
> nice... now the real kicker if I merge from another branch
> sunrise/reviewed and redirect it's package.mask to
> package.mask/sunrise will git be smart enough to differentiate from
> the gentoo.org one and the sunrise one? I think even more important is
> how would I even tell it to do that once I've moved the first one.

Not sure I understood this completely, but I've found it helps to make the rename/move as a separate commit, then start changing stuff. In other words, do too many things in the same commit, and you could lose this coolness.

There's some logic somewhere that says "if we can't find a match to merge this file, let's see if we ever had the same blob as the parent of the file in the MERGE_HEAD and we'll use that as a base to do the merge".

Previous: Caleb CushingNext: Caleb Cushing
Message 4 of 10 in “merge smart enough to adapt to renames?”
  1. Caleb CushingFeb 19, 2009
  2. Sitaram ChamartyFeb 19, 2009
  3. Caleb CushingFeb 19, 2009
  4. Sitaram ChamartyFeb 20, 2009
  5. Caleb CushingFeb 20, 2009
  6. Rogan DawesFeb 20, 2009
  7. Kris ShannonFeb 21, 2009
  8. Rogan DawesFeb 21, 2009
  9. Caleb CushingFeb 22, 2009
  10. Rogan DawesFeb 22, 2009

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.