Skip to contentSkip to conversation

git-svn init from Avogadro SVN repo - deleted files showing

PATCH In review Marcus D. Hanwell 4 participants 9 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

I am quite new to git and git-svn but have been using both for my development work recently. I imported the Avogadro subversion repository (hosted on Sourceforge) using the following commands,

git svn init -t tags -b branches -T trunk https://avogadro.svn.sourceforge.net/svnroot/avogadro

git svn fetch

The files avogadro.pro and README in the trunk/ directory appear in my imported git repository but not in Avogadro subversion trunk. We also had trunk/src/ and all its files/subdirectories appearing in the git checkout but not in subversion trunk. We deleted this using git and git svn which removed it from the git checkouts too after r858.

I have been talking to Peter who confirmed this and pointed out that the repo was reorganised several times in the past. Please CC me on replies as I am not on the list. There is a copy of my git repo at http://platinum.cryos.net/avogadro.git/ if you would rather skip the import. Other than that everything has been working great. It would be good to get rid of this bug if possible. Let me know if there is anything else I can do to help.

Thanks,

Marcus

#1 lore raw
Quoted 18 lines · Marcus D. Hanwell

Hi,

I am quite new to git and git-svn but have been using both for my development work recently. I imported the Avogadro subversion repository (hosted on Sourceforge) using the following commands,

git svn init -t tags -b branches -T trunk
https://avogadro.svn.sourceforge.net/svnroot/avogadro

git svn fetch

The files avogadro.pro and README in the trunk/ directory appear in my imported git repository but not in Avogadro subversion trunk. We also had trunk/src/ and all its files/subdirectories appearing in the git checkout but not in subversion trunk. We deleted this using git and git svn which removed it from the git checkouts too after r858.

Quoted 8 lines

I have been talking to Peter who confirmed this and pointed out that the repo was reorganised several times in the past. Please CC me on replies as I am not on the list. There is a copy of my git repo at
http://platinum.cryos.net/avogadro.git/ if you would rather skip the import. Other than that everything has been working great. It would be good to get rid of this bug if possible. Let me know if there is anything else I can do to help.

[ Eric Cc'ed, as the author of git-svn ]

I can confirm that this looks like an import problem.
(e.g see svn log -v -r33:78 https://avogadro.svn.sourceforge.net/svnroot/avogadro)

I did my analysis on the file /trunk/avogadro.pro, because the error happens really early in the history so could just import up to revision 76 to see what goes wrong. (The file gets never deleted in the import, as it should be!)

trunk/avogadro.pro is added here:

    ------------------------------------------------------------------------
    r33 | dcurtis3 | 2006-08-21 07:34:10 +0200 (Mon, 21 Aug 2006) | 3 lines
    Changed paths:
       A /trunk/avogadro.pro

    Does a recursive build.

Here the refactoring starts (a new directory not tracked by git is added):

    ------------------------------------------------------------------------
    r66 | dcurtis3 | 2007-01-03 06:42:45 +0100 (Wed, 03 Jan 2007) | 3 lines
    Changed paths:
       A /avogadro

    Making room for libavogadro.

/branches is moved to /avogadro/branches
------------------------------------------------------------------------
r67 | dcurtis3 | 2007-01-03 06:47:11 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/branches (from /branches:66)
D /branches

Making room for libavogadro

ERROR HAPPENS HERE:
====================

/trunk and /tags are moved, too.
(/trunk/avogadro.pro becomes /avogadro/trunk/avogadro.pro):
------------------------------------------------------------------------
r68 | dcurtis3 | 2007-01-03 06:47:34 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/tags (from /tags:66)
A /avogadro/trunk (from /trunk:66)
D /tags
D /trunk

Making room for libavogadro.

The above delete/move of trunk isn't recorded anywhere in the git svn import. 'git-svn find-rev r66' doesn't produce any output!
And later git-svn thinks that /trunk and all its files are still there, so e.g. /trunk/avogadro.pro stays in the repo forever.

-Peter

This is just for consistency here and for anyone interested in further analyses.

Here is the rest of the import analyses I've done. Look how "interesting" the repo is and how many times the files are moved.

/libavogadro is added

    ------------------------------------------------------------------------
    r69 | dcurtis3 | 2007-01-03 06:50:58 +0100 (Wed, 03 Jan 2007) | 3 lines
    Changed paths:
       A /libavogadro
       A /libavogadro/CMakeLists.txt
       A /libavogadro/FindOpenBabel.cmake
       A /libavogadro/src
       A /libavogadro/src/CMakeLists.txt
       A /libavogadro/src/color.cpp
       A /libavogadro/src/color.h
       A /libavogadro/src/engine.h
       A /libavogadro/src/engines
       A /libavogadro/src/engines/CMakeLists.txt
       A /libavogadro/src/engines/ResidueSphereEngine.cpp
       A /libavogadro/src/engines/ResidueSphereEngine.h
       A /libavogadro/src/engines/SphereEngine.cpp
       A /libavogadro/src/engines/SphereEngine.h
       A /libavogadro/src/engines/StickEngine.cpp
       A /libavogadro/src/engines/StickEngine.h
       A /libavogadro/src/engines/WireframeEngine.cpp
       A /libavogadro/src/engines/WireframeEngine.h
       A /libavogadro/src/engines/bsengine.cpp
       A /libavogadro/src/engines/bsengine.h
       A /libavogadro/src/engines/vertexarray.cpp
       A /libavogadro/src/engines/vertexarray.h
       A /libavogadro/src/glwidget.cpp
       A /libavogadro/src/glwidget.h
       A /libavogadro/src/primitives.cpp
       A /libavogadro/src/primitives.h

    Added libavogadro.

Create /libavogadro/{trunk,branches,tags} and move anything below the former /libavogadro into /libavogadro/trunk
------------------------------------------------------------------------
r70 | dcurtis3 | 2007-01-03 06:53:13 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
D /libavogadro/CMakeLists.txt
D /libavogadro/FindOpenBabel.cmake
A /libavogadro/branches
D /libavogadro/src
A /libavogadro/tags
A /libavogadro/trunk
A /libavogadro/trunk/CMakeLists.txt (from /libavogadro/CMakeLists.txt:69) A /libavogadro/trunk/FindOpenBabel.cmake (from /libavogadro/FindOpenBabel.cmake:69) A /libavogadro/trunk/src (from /libavogadro/src:69)

Putting in trunk / branches / tags.

------------------------------------------------------------------------
r72 | dcurtis3 | 2007-01-03 08:55:32 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/trunk/CMakeLists.txt
A /avogadro/trunk/FindAvogadro.cmake
A /avogadro/trunk/FindOpenBabel.cmake
D /avogadro/trunk/src/Engine.h
D /avogadro/trunk/src/GLWidget.cpp
D /avogadro/trunk/src/GLWidget.h
D /avogadro/trunk/src/MainWindow.cpp
D /avogadro/trunk/src/MainWindow.h
D /avogadro/trunk/src/Primitives.cpp
D /avogadro/trunk/src/Primitives.h
D /avogadro/trunk/src/Renderer.h
D /avogadro/trunk/src/Tool.cpp
D /avogadro/trunk/src/Tool.h
D /avogadro/trunk/src/Views.cpp
D /avogadro/trunk/src/Views.h
D /avogadro/trunk/src/color.cpp
D /avogadro/trunk/src/color.h
D /avogadro/trunk/src/engines
M /avogadro/trunk/src/main.cpp
A /avogadro/trunk/src/mainwindow.cpp (from /avogadro/trunk/src/MainWindow.cpp:70) A /avogadro/trunk/src/mainwindow.h (from /avogadro/trunk/src/MainWindow.h:70) A /avogadro/trunk/src/tool.cpp (from /avogadro/trunk/src/Tool.cpp:70) A /avogadro/trunk/src/tool.h (from /avogadro/trunk/src/Tool.h:70)
A /avogadro/trunk/untitled01.gpr

Now uses libavogadro. Starting to think we should package this a little different.

Renamed /libavogadro to /avogadro-lib

    ------------------------------------------------------------------------
    r73 | dcurtis3 | 2007-01-03 16:48:02 +0100 (Wed, 03 Jan 2007) | 3 lines
    Changed paths:
       A /avogadro-lib (from /libavogadro:72)
       D /libavogadro

    Refactor

mv /avogadro/trunk/avogadro.pro /trunk/avogadro/avogadro.pro
------------------------------------------------------------------------
r75 | dcurtis3 | 2007-01-03 20:49:35 +0100 (Wed, 03 Jan 2007) | 2 lines Changed paths:
D /avogadro
D /avogadro-lib
A /branches
A /tags
A /trunk
A /trunk/avogadro (from /avogadro/trunk:74)
A /trunk/libavogadro (from /avogadro-lib/trunk:74)

Moving things around. Conforming to a more KDE-like layout in SVN. I'm going nuts. SOrry

#2 lore raw
Quoted 84 lines · Peter Baumann
Quoted 18 lines · Marcus D. Hanwell

Hi,

I am quite new to git and git-svn but have been using both for my development work recently. I imported the Avogadro subversion repository (hosted on Sourceforge) using the following commands,

git svn init -t tags -b branches -T trunk
https://avogadro.svn.sourceforge.net/svnroot/avogadro

git svn fetch

The files avogadro.pro and README in the trunk/ directory appear in my imported git repository but not in Avogadro subversion trunk. We also had trunk/src/ and all its files/subdirectories appearing in the git checkout but not in subversion trunk. We deleted this using git and git svn which removed it from the git checkouts too after r858.

Quoted 8 lines

I have been talking to Peter who confirmed this and pointed out that the repo was reorganised several times in the past. Please CC me on replies as I am not on the list. There is a copy of my git repo at
http://platinum.cryos.net/avogadro.git/ if you would rather skip the import. Other than that everything has been working great. It would be good to get rid of this bug if possible. Let me know if there is anything else I can do to help.

[ Eric Cc'ed, as the author of git-svn ]

I can confirm that this looks like an import problem.
(e.g see svn log -v -r33:78 https://avogadro.svn.sourceforge.net/svnroot/avogadro)

I did my analysis on the file /trunk/avogadro.pro, because the error happens really early in the history so could just import up to revision 76 to see what goes wrong. (The file gets never deleted in the import, as it should be!)

trunk/avogadro.pro is added here:

    ------------------------------------------------------------------------
    r33 | dcurtis3 | 2006-08-21 07:34:10 +0200 (Mon, 21 Aug 2006) | 3 lines
    Changed paths:
       A /trunk/avogadro.pro

    Does a recursive build.

Here the refactoring starts (a new directory not tracked by git is added):

    ------------------------------------------------------------------------
    r66 | dcurtis3 | 2007-01-03 06:42:45 +0100 (Wed, 03 Jan 2007) | 3 lines
    Changed paths:
       A /avogadro

    Making room for libavogadro.

/branches is moved to /avogadro/branches
------------------------------------------------------------------------
r67 | dcurtis3 | 2007-01-03 06:47:11 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/branches (from /branches:66)
D /branches

Making room for libavogadro

ERROR HAPPENS HERE:
====================

/trunk and /tags are moved, too.
(/trunk/avogadro.pro becomes /avogadro/trunk/avogadro.pro):
------------------------------------------------------------------------
r68 | dcurtis3 | 2007-01-03 06:47:34 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/tags (from /tags:66)
A /avogadro/trunk (from /trunk:66)
D /tags
D /trunk

Quoted 4 lines

Making room for libavogadro.

The above delete/move of trunk isn't recorded anywhere in the git svn import. 'git-svn find-rev r66' doesn't produce any output!

Sorry. I meant r67 and r68 instead of r66.

Quoted 124 lines

And later git-svn thinks that /trunk and all its files are still there, so e.g. /trunk/avogadro.pro stays in the repo forever.

-Peter

This is just for consistency here and for anyone interested in further analyses.

Here is the rest of the import analyses I've done. Look how "interesting" the repo is and how many times the files are moved.

/libavogadro is added

    ------------------------------------------------------------------------
    r69 | dcurtis3 | 2007-01-03 06:50:58 +0100 (Wed, 03 Jan 2007) | 3 lines
    Changed paths:
       A /libavogadro
       A /libavogadro/CMakeLists.txt
       A /libavogadro/FindOpenBabel.cmake
       A /libavogadro/src
       A /libavogadro/src/CMakeLists.txt
       A /libavogadro/src/color.cpp
       A /libavogadro/src/color.h
       A /libavogadro/src/engine.h
       A /libavogadro/src/engines
       A /libavogadro/src/engines/CMakeLists.txt
       A /libavogadro/src/engines/ResidueSphereEngine.cpp
       A /libavogadro/src/engines/ResidueSphereEngine.h
       A /libavogadro/src/engines/SphereEngine.cpp
       A /libavogadro/src/engines/SphereEngine.h
       A /libavogadro/src/engines/StickEngine.cpp
       A /libavogadro/src/engines/StickEngine.h
       A /libavogadro/src/engines/WireframeEngine.cpp
       A /libavogadro/src/engines/WireframeEngine.h
       A /libavogadro/src/engines/bsengine.cpp
       A /libavogadro/src/engines/bsengine.h
       A /libavogadro/src/engines/vertexarray.cpp
       A /libavogadro/src/engines/vertexarray.h
       A /libavogadro/src/glwidget.cpp
       A /libavogadro/src/glwidget.h
       A /libavogadro/src/primitives.cpp
       A /libavogadro/src/primitives.h

    Added libavogadro.

Create /libavogadro/{trunk,branches,tags} and move anything below the former /libavogadro into /libavogadro/trunk
------------------------------------------------------------------------
r70 | dcurtis3 | 2007-01-03 06:53:13 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
D /libavogadro/CMakeLists.txt
D /libavogadro/FindOpenBabel.cmake
A /libavogadro/branches
D /libavogadro/src
A /libavogadro/tags
A /libavogadro/trunk
A /libavogadro/trunk/CMakeLists.txt (from /libavogadro/CMakeLists.txt:69) A /libavogadro/trunk/FindOpenBabel.cmake (from /libavogadro/FindOpenBabel.cmake:69) A /libavogadro/trunk/src (from /libavogadro/src:69)

Putting in trunk / branches / tags.

------------------------------------------------------------------------
r72 | dcurtis3 | 2007-01-03 08:55:32 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/trunk/CMakeLists.txt
A /avogadro/trunk/FindAvogadro.cmake
A /avogadro/trunk/FindOpenBabel.cmake
D /avogadro/trunk/src/Engine.h
D /avogadro/trunk/src/GLWidget.cpp
D /avogadro/trunk/src/GLWidget.h
D /avogadro/trunk/src/MainWindow.cpp
D /avogadro/trunk/src/MainWindow.h
D /avogadro/trunk/src/Primitives.cpp
D /avogadro/trunk/src/Primitives.h
D /avogadro/trunk/src/Renderer.h
D /avogadro/trunk/src/Tool.cpp
D /avogadro/trunk/src/Tool.h
D /avogadro/trunk/src/Views.cpp
D /avogadro/trunk/src/Views.h
D /avogadro/trunk/src/color.cpp
D /avogadro/trunk/src/color.h
D /avogadro/trunk/src/engines
M /avogadro/trunk/src/main.cpp
A /avogadro/trunk/src/mainwindow.cpp (from /avogadro/trunk/src/MainWindow.cpp:70) A /avogadro/trunk/src/mainwindow.h (from /avogadro/trunk/src/MainWindow.h:70) A /avogadro/trunk/src/tool.cpp (from /avogadro/trunk/src/Tool.cpp:70) A /avogadro/trunk/src/tool.h (from /avogadro/trunk/src/Tool.h:70)
A /avogadro/trunk/untitled01.gpr

Now uses libavogadro. Starting to think we should package this a little different.

Renamed /libavogadro to /avogadro-lib

    ------------------------------------------------------------------------
    r73 | dcurtis3 | 2007-01-03 16:48:02 +0100 (Wed, 03 Jan 2007) | 3 lines
    Changed paths:
       A /avogadro-lib (from /libavogadro:72)
       D /libavogadro

    Refactor

mv /avogadro/trunk/avogadro.pro /trunk/avogadro/avogadro.pro
------------------------------------------------------------------------
r75 | dcurtis3 | 2007-01-03 20:49:35 +0100 (Wed, 03 Jan 2007) | 2 lines Changed paths:
D /avogadro
D /avogadro-lib
A /branches
A /tags
A /trunk
A /trunk/avogadro (from /avogadro/trunk:74)
A /trunk/libavogadro (from /avogadro-lib/trunk:74)

Moving things around. Conforming to a more KDE-like layout in SVN. I'm going nuts. SOrry

#3 lore raw
In reply to Peter Baumann
Quoted 84 lines · Peter Baumann
Quoted 18 lines · Marcus D. Hanwell

Hi,

I am quite new to git and git-svn but have been using both for my development work recently. I imported the Avogadro subversion repository (hosted on Sourceforge) using the following commands,

git svn init -t tags -b branches -T trunk
https://avogadro.svn.sourceforge.net/svnroot/avogadro

git svn fetch

The files avogadro.pro and README in the trunk/ directory appear in my imported git repository but not in Avogadro subversion trunk. We also had trunk/src/ and all its files/subdirectories appearing in the git checkout but not in subversion trunk. We deleted this using git and git svn which removed it from the git checkouts too after r858.

Quoted 8 lines

I have been talking to Peter who confirmed this and pointed out that the repo was reorganised several times in the past. Please CC me on replies as I am not on the list. There is a copy of my git repo at
http://platinum.cryos.net/avogadro.git/ if you would rather skip the import. Other than that everything has been working great. It would be good to get rid of this bug if possible. Let me know if there is anything else I can do to help.

[ Eric Cc'ed, as the author of git-svn ]

I can confirm that this looks like an import problem.
(e.g see svn log -v -r33:78 https://avogadro.svn.sourceforge.net/svnroot/avogadro)

I did my analysis on the file /trunk/avogadro.pro, because the error happens really early in the history so could just import up to revision 76 to see what goes wrong. (The file gets never deleted in the import, as it should be!)

trunk/avogadro.pro is added here:

    ------------------------------------------------------------------------
    r33 | dcurtis3 | 2006-08-21 07:34:10 +0200 (Mon, 21 Aug 2006) | 3 lines
    Changed paths:
       A /trunk/avogadro.pro

    Does a recursive build.

Here the refactoring starts (a new directory not tracked by git is added):

    ------------------------------------------------------------------------
    r66 | dcurtis3 | 2007-01-03 06:42:45 +0100 (Wed, 03 Jan 2007) | 3 lines
    Changed paths:
       A /avogadro

    Making room for libavogadro.

/branches is moved to /avogadro/branches
------------------------------------------------------------------------
r67 | dcurtis3 | 2007-01-03 06:47:11 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/branches (from /branches:66)
D /branches

Making room for libavogadro

ERROR HAPPENS HERE:
====================

/trunk and /tags are moved, too.
(/trunk/avogadro.pro becomes /avogadro/trunk/avogadro.pro):
------------------------------------------------------------------------
r68 | dcurtis3 | 2007-01-03 06:47:34 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/tags (from /tags:66)
A /avogadro/trunk (from /trunk:66)
D /tags
D /trunk

Quoted 6 lines

Making room for libavogadro.

The above delete/move of trunk isn't recorded anywhere in the git svn import. 'git-svn find-rev r66' doesn't produce any output!
And later git-svn thinks that /trunk and all its files are still there, so e.g. /trunk/avogadro.pro stays in the repo forever.

Hi,

Thanks for the analysis, Peter.

git-svn ignores deletions to the directory we're tracking in order to represent renames when the follow-parent case is hit.

Unfortunately, this never took into account the directory we're tracking reappearing later in history. I'll try to have a fix later tonight or over the weekend.

Quoted 12 lines

mv /avogadro/trunk/avogadro.pro /trunk/avogadro/avogadro.pro
------------------------------------------------------------------------
r75 | dcurtis3 | 2007-01-03 20:49:35 +0100 (Wed, 03 Jan 2007) | 2 lines Changed paths:
D /avogadro
D /avogadro-lib
A /branches
A /tags
A /trunk
A /trunk/avogadro (from /avogadro/trunk:74)
A /trunk/libavogadro (from /avogadro-lib/trunk:74)

Quoted 2 lines

Moving things around. Conforming to a more KDE-like layout in SVN. I'm going nuts. SOrry

Instead of handling the full delete of everything in r68, I think I'll make it so importing r75 will clobber all the stuff in trunk/ we ignored deleting in r68 before adding the contents of trunk/ in r75.

Signature · 1 line
Eric Wong
#4 lore raw
Quoted 115 lines · Eric Wong
Quoted 84 lines · Peter Baumann
Quoted 18 lines · Marcus D. Hanwell

Hi,

I am quite new to git and git-svn but have been using both for my development work recently. I imported the Avogadro subversion repository (hosted on Sourceforge) using the following commands,

git svn init -t tags -b branches -T trunk
https://avogadro.svn.sourceforge.net/svnroot/avogadro

git svn fetch

The files avogadro.pro and README in the trunk/ directory appear in my imported git repository but not in Avogadro subversion trunk. We also had trunk/src/ and all its files/subdirectories appearing in the git checkout but not in subversion trunk. We deleted this using git and git svn which removed it from the git checkouts too after r858.

Quoted 8 lines

I have been talking to Peter who confirmed this and pointed out that the repo was reorganised several times in the past. Please CC me on replies as I am not on the list. There is a copy of my git repo at
http://platinum.cryos.net/avogadro.git/ if you would rather skip the import. Other than that everything has been working great. It would be good to get rid of this bug if possible. Let me know if there is anything else I can do to help.

[ Eric Cc'ed, as the author of git-svn ]

I can confirm that this looks like an import problem.
(e.g see svn log -v -r33:78 https://avogadro.svn.sourceforge.net/svnroot/avogadro)

I did my analysis on the file /trunk/avogadro.pro, because the error happens really early in the history so could just import up to revision 76 to see what goes wrong. (The file gets never deleted in the import, as it should be!)

trunk/avogadro.pro is added here:

    ------------------------------------------------------------------------
    r33 | dcurtis3 | 2006-08-21 07:34:10 +0200 (Mon, 21 Aug 2006) | 3 lines
    Changed paths:
       A /trunk/avogadro.pro

    Does a recursive build.

Here the refactoring starts (a new directory not tracked by git is added):

    ------------------------------------------------------------------------
    r66 | dcurtis3 | 2007-01-03 06:42:45 +0100 (Wed, 03 Jan 2007) | 3 lines
    Changed paths:
       A /avogadro

    Making room for libavogadro.

/branches is moved to /avogadro/branches
------------------------------------------------------------------------
r67 | dcurtis3 | 2007-01-03 06:47:11 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/branches (from /branches:66)
D /branches

Making room for libavogadro

ERROR HAPPENS HERE:
====================

/trunk and /tags are moved, too.
(/trunk/avogadro.pro becomes /avogadro/trunk/avogadro.pro):
------------------------------------------------------------------------
r68 | dcurtis3 | 2007-01-03 06:47:34 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/tags (from /tags:66)
A /avogadro/trunk (from /trunk:66)
D /tags
D /trunk

Quoted 6 lines

Making room for libavogadro.

The above delete/move of trunk isn't recorded anywhere in the git svn import. 'git-svn find-rev r66' doesn't produce any output!
And later git-svn thinks that /trunk and all its files are still there, so e.g. /trunk/avogadro.pro stays in the repo forever.

Hi,

Thanks for the analysis, Peter.

git-svn ignores deletions to the directory we're tracking in order to represent renames when the follow-parent case is hit.

Unfortunately, this never took into account the directory we're tracking reappearing later in history. I'll try to have a fix later tonight or over the weekend.

Quoted 12 lines

mv /avogadro/trunk/avogadro.pro /trunk/avogadro/avogadro.pro
------------------------------------------------------------------------
r75 | dcurtis3 | 2007-01-03 20:49:35 +0100 (Wed, 03 Jan 2007) | 2 lines Changed paths:
D /avogadro
D /avogadro-lib
A /branches
A /tags
A /trunk
A /trunk/avogadro (from /avogadro/trunk:74)
A /trunk/libavogadro (from /avogadro-lib/trunk:74)

Quoted 7 lines
Quoted 2 lines

Moving things around. Conforming to a more KDE-like layout in SVN. I'm going nuts. SOrry

Instead of handling the full delete of everything in r68, I think I'll make it so importing r75 will clobber all the stuff in trunk/ we ignored deleting in r68 before adding the contents of trunk/ in r75.

Sorry, that last sentence I can't parse/understand. But I trust you to do the right thing.

-Peter

#5 lore raw

PATCH 1/1 git-svn: handle our top-level path is deleted and later re-added

Previously, git-svn would ignore cases where the path we're tracking is removed from the repository. This was to prevent heads with follow-parent from ending up with a tree full of empty revisions (and thus breaking rename detection).

The previous behavior is fine until the path we're tracking is re-added later on, leading to the old files being merged in with the new files in the directory (because the old files were never marked as deleted)

We will now only remove all the old files locally that were deleted remotely iff we detect the directory we're in is being created from scratch.

Thanks for Marcus D. Hanwell for the bug report and Peter Baumann for the analysis.

---

Quoted 46 lines · Peter Baumann
Quoted 45 lines · Eric Wong
Quoted 11 lines · Peter Baumann

On Sun, Dec 09, 2007 at 07:24:40PM -0500, Marcus D. Hanwell wrote:
/trunk and /tags are moved, too.
(/trunk/avogadro.pro becomes /avogadro/trunk/avogadro.pro):
------------------------------------------------------------------------
r68 | dcurtis3 | 2007-01-03 06:47:34 +0100 (Wed, 03 Jan 2007) | 3 lines Changed paths:
A /avogadro/tags (from /tags:66)
A /avogadro/trunk (from /trunk:66)
D /tags
D /trunk

Quoted 6 lines

Making room for libavogadro.

The above delete/move of trunk isn't recorded anywhere in the git svn import. 'git-svn find-rev r66' doesn't produce any output!
And later git-svn thinks that /trunk and all its files are still there, so e.g. /trunk/avogadro.pro stays in the repo forever.

Hi,

Thanks for the analysis, Peter.

git-svn ignores deletions to the directory we're tracking in order to represent renames when the follow-parent case is hit.

Unfortunately, this never took into account the directory we're tracking reappearing later in history. I'll try to have a fix later tonight or over the weekend.

Quoted 14 lines

mv /avogadro/trunk/avogadro.pro /trunk/avogadro/avogadro.pro
------------------------------------------------------------------------
r75 | dcurtis3 | 2007-01-03 20:49:35 +0100 (Wed, 03 Jan 2007) | 2 lines Changed paths:
D /avogadro
D /avogadro-lib
A /branches
A /tags
A /trunk
A /trunk/avogadro (from /avogadro/trunk:74)
A /trunk/libavogadro (from /avogadro-lib/trunk:74)

Moving things around. Conforming to a more KDE-like layout in SVN. I'm going nuts. SOrry

Quoted 7 lines
Quoted 4 lines

Instead of handling the full delete of everything in r68, I think I'll make it so importing r75 will clobber all the stuff in trunk/ we ignored deleting in r68 before adding the contents of trunk/ in r75.

Sorry, that last sentence I can't parse/understand. But I trust you to do the right thing.

I hope the commit message was a better explanation. Or the code and test case I've added makes perfect sense :)

 git-svn.perl                                 |   14 +++++++++
 t/t9103-git-svn-tracked-directory-removed.sh |   39 ++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 0 deletions(-)
 create mode 100755 t/t9103-git-svn-tracked-directory-removed.sh
git-svn.perl +14 -0
index 3aa7f8c..d411a34 100755
@@ -3045,6 +3045,20 @@ sub add_file {
 
 sub add_directory {
 	my ($self, $path, $cp_path, $cp_rev) = @_;
+	my $gpath = $self->git_path($path);
+	if ($gpath eq '') {
+		my ($ls, $ctx) = command_output_pipe(qw/ls-tree
+		                                     -r --name-only -z/,
+				                     $self->{c});
+		local $/ = "\0";
+		while (<$ls>) {
+			chomp;
+			$self->{gii}->remove($_);
+			print "\tD\t$_\n" unless $::_q;
+		}
+		command_close_pipe($ls, $ctx);
+		$self->{empty}->{$path} = 0;
+	}
 	my ($dir, $file) = ($path =~ m#^(.*?)/?([^/]+)$#);
 	delete $self->{empty}->{$dir};
 	$self->{empty}->{$path} = 1;
t/t9103-git-svn-tracked-directory-removed.sh new file +39 -0
new file mode 100755
index 0000000..0f0b0fd
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Eric Wong
+#
+
+test_description='git-svn tracking removed top-level path'
+. ./lib-git-svn.sh
+
+test_expect_success 'make history for tracking' '
+	mkdir import &&
+	mkdir import/trunk &&
+	echo hello >> import/trunk/README &&
+	svn import -m initial import $svnrepo &&
+	rm -rf import &&
+	svn co $svnrepo/trunk trunk &&
+	echo bye bye >> trunk/README &&
+	svn rm -m "gone" $svnrepo/trunk &&
+	rm -rf trunk &&
+	mkdir trunk &&
+	echo "new" > trunk/FOLLOWME &&
+	svn import -m "new trunk" trunk $svnrepo/trunk
+'
+
+test_expect_success 'clone repo with git' '
+	git svn clone -s $svnrepo x &&
+	test -f x/FOLLOWME &&
+	test ! -f x/README
+'
+
+test_expect_success 'make sure r2 still has old file' '
+	cd x &&
+		test -n "$(git svn find-rev r1)" &&
+		git reset --hard $(git svn find-rev r1) &&
+		test -f README &&
+		test ! -f FOLLOWME &&
+		test x$(git svn find-rev r2) = x
+'
+
+test_done
Signature · 1 line
Eric Wong
#6 lore raw

Re: [PATCH] git-svn: handle our top-level path is deleted and later re-added

Quoted 1 line

Subject: [PATCH] git-svn: handle our top-level path is deleted and later re-added

That should read:

Subject: [PATCH] git-svn: handle our top-level path being deleted and later re-added

Quoted 9 lines

---

Quoted 7 lines · Peter Baumann
Quoted 4 lines · Eric Wong

Instead of handling the full delete of everything in r68, I think I'll make it so importing r75 will clobber all the stuff in trunk/ we ignored deleting in r68 before adding the contents of trunk/ in r75.

Quoted 5 lines
Quoted 2 lines

Sorry, that last sentence I can't parse/understand. But I trust you to do the right thing.

I hope the commit message was a better explanation. Or the code and test case I've added makes perfect sense :)

My language generation module seems broken these days.

Signature · 1 line
Eric Wong
#7 lore raw

Re: [PATCH] git-svn: handle our top-level path is deleted and later re-added

In reply to Eric Wong
Quoted 10 lines · Eric Wong

Previously, git-svn would ignore cases where the path we're tracking is removed from the repository. This was to prevent heads with follow-parent from ending up with a tree full of empty revisions (and thus breaking rename detection).

The previous behavior is fine until the path we're tracking is re-added later on, leading to the old files being merged in with the new files in the directory (because the old files were never marked as deleted)

Quoted 8 lines

We will now only remove all the old files locally that were deleted remotely iff we detect the directory we're in is being created from scratch.

Thanks for Marcus D. Hanwell for the bug report and Peter Baumann for the analysis.

[...]

It seems to solve the problem seen in the avogadro repo. At least the suspicious revisions I checked looked identical in the imported version.

-Peter