All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ittay Dror <ittay.dror@gmail.com>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: switching upstream tips
Date: Wed, 13 May 2009 10:33:44 +0300	[thread overview]
Message-ID: <4A0A77D8.3030000@gmail.com> (raw)
In-Reply-To: <81b0412b0905130019x114d53d1v86833217bff613bc@mail.gmail.com>



Alex Riesen wrote:

> 2009/5/13 Ittay Dror <ittay.dror@gmail.com>:
>   
>> I'm working on a repository in github that is forked from another
>> repository. I've committed several times and pulled (merged) from the
>> upstream a few times (so the committs are interleaved). The upstream
>> repository is a clone of an SVN repository (in apache). The project has
>> switched svn repositories (moved from incubation to top level project) and
>> so created a new repository in github.
>>     
>
> That's evil.
>
>   
>> * Reorder my history so that my commits are on top of the tip of the old
>> upstream repository.
>>     
>
> Look at "git rebase -i" (interactive rebase)
>   
well, i was hoping for something more automatic. git rebase will list 
all commits without author, so i'll have to manually figure which of 
them is mine from the commend and reorder
>   
>> * Change the upstream repository reference so it points to the new
>> repository
>>     
>
> Just edit your .git/config and re-fetch.
>   
but then git suddenly sees a bunch of new objects (because of the svn 
changes) and i get a lot of conflicts. note that it is not the directory 
structure that changed, just the svn repository which is included in the 
commit comment (by git-svn) and so changes the commit sha1.
>   
>> * Apply my commits on top of the new upstream repository
>>     
>
> You can try to cherry-pick your commits (git cherry-pick).
> Maybe rename detection will be enough to apply your changes
> as is. But as far as I understand, the path names in the new
> upstream are now all different (moved a level up?).
> You can save your commits in a mbox:
>
>    git format-patch -o mbox old-upstream..your-last-commit
>
> Edit the paths in the mbox and try to apply the result:
>
>    git am -3 result.mbox
>
> Or, you can use git filter-branch to modify the old history as if it
> was always operating on the directory structure of the new
> upsteam (assuming it is possible, of course). See manpage
> of git filter-branch, there is an example (look for "move the whole
> tree into a subdirectory").
>   

  reply	other threads:[~2009-05-13  7:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13  6:42 switching upstream tips Ittay Dror
2009-05-13  7:19 ` Alex Riesen
2009-05-13  7:33   ` Ittay Dror [this message]
     [not found]   ` <4A0A777E.7080506@gmail.com>
2009-05-13  7:41     ` Alex Riesen
2009-05-13  7:49       ` Ittay Dror
2009-05-13  7:57         ` Johannes Sixt
2009-05-13  8:07           ` Ittay Dror
2009-05-13  8:16             ` Johannes Sixt
2009-05-13  8:16             ` Alex Riesen
2009-05-13  8:15         ` Alex Riesen
2009-05-13  8:32           ` Ittay Dror
2009-05-13  9:05             ` Alex Riesen

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=4A0A77D8.3030000@gmail.com \
    --to=ittay.dror@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=raa.lkml@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.