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

Re: Rewriting git history during git-svn conversion

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Mar 6, 2014, 19:09 UTC
Message-ID
<CAHd499D-o37K_XXOj=gWyC4hXYxqBJ4JtAhy-naNP_eU4oWnyA@mail.gmail.com>
In-Reply-To
<CAEcj5uVOWzcCjrUO9NBuRvbPUaqigJyaOmG_8wCumznB+yTH4Q@mail.gmail.com>

On Tue, Mar 4, 2014 at 4:56 AM, Thomas Ferris Nicolaisen <tfnico@gmail.com> wrote:

Show 20 quoted lines
> On Mon, Mar 3, 2014 at 7:38 PM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
>>
>> Is it safe to do this while still using git svn fetch? Will it
>> properly continue to convert SVN commits on top of my rewritten
>> history? If not, what changes can I make after I run the commands
>> linked by the URL above so that git svn continues to work normally?
>>
>
> I think it's OK. git-svn doesn't continuously verify the integrity of
> history already converted, I believe.
>
> Just try it out, it worked fine in a little demo setup I made
> (although I used rebase -i instead of filter-branch):
>
> git svn clone .. #maybe clone a little test repository to speed up the testing
> git filter-branch ... #remove unwanted files
> git svn fetch #this should work
>
> On a related note, maybe you'll enjoy my git-svn demos & ideas here:
> http://www.tfnico.com/presentations/git-and-subversion

So I did try this out. I did a 'fitler-branch', and afterwards I am unable to do a `git svn fetch`:

$ git svn fetch fatal: Invalid revision range cf641cf687fc41b769f296af6e4345dd6a8a6d7d rev-list --pretty=raw --reverse cf641cf687fc41b769f296af6e4345dd6a8a6d7d..refs/remotes/svn/trunk --: command returned error: 128

I have a TON of branches, so I need some small command or script that is able to go through each branch and update the metadata to tell it what the new (rewritten) HEAD commit on each branch is. I'm assuming that's the problem (git svn data is referring to old SHA of each remote tracking branch).

If there is more to it than this please let me know. Thanks so far for everyone's help.

Previous: Thomas Ferris Nicolaisen
Message 3 of 3 in “Rewriting git history during git-svn conversion”
  1. Robert DaileyMar 3, 2014
  2. Thomas Ferris NicolaisenMar 4, 2014
  3. Robert DaileyMar 6, 2014

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.