Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Aug 22, 2012
  1. @gitster

    Merge branch 'ms/git-svn-1.7'

    gitster authored
    A series by Michael Schwern via Eric to update git-svn to revamp the
    way URLs are internally passed around, to make it work with SVN 1.7.
    
    * ms/git-svn-1.7:
      git-svn: remove ad-hoc canonicalizations
      git-svn: canonicalize newly-minted URLs
      git-svn: introduce add_path_to_url function
      git-svn: canonicalize earlier
      git-svn: replace URL escapes with canonicalization
      git-svn: attempt to mimic SVN 1.7 URL canonicalization
      t9107: fix typo
      t9118: workaround inconsistency between SVN versions
      Git::SVN{,::Ra}: canonicalize earlier
      git-svn: path canonicalization uses SVN API
      Git::SVN::Utils: remove irrelevant comment
      git-svn: add join_paths() to safely concatenate paths
      git-svn: factor out _collapse_dotdot function
      git-svn: use SVN 1.7 to canonicalize when possible
      git-svn: move canonicalization to Git::SVN::Utils
      use Git::SVN{,::RA}->url accessor globally
      use Git::SVN->path accessor globally
      Git::SVN::Ra: use accessor for URLs
      Git::SVN: use accessor for URLs internally
      Git::SVN: use accessors internally for path
Commits on Aug 10, 2012
  1. git svn: reset invalidates the memoized mergeinfo caches

    Peter Baumann authored Eric Wong committed
    Since v1.7.0-rc2~11 (git-svn: persistent memoization, 2010-01-30),
    git-svn has maintained some private per-repository caches in
    .git/svn/.caches to avoid refetching and recalculating some
    mergeinfo-related information with every 'git svn fetch'.
    
    This memoization can cause problems, e.g consider the following case:
    
    SVN repo:
    
      ... - a - b - c - m  <- trunk
              \        /
                d  -  e    <- branch1
    
    The Git import of the above repo is at commit 'a' and doesn't know about
    the branch1. In case of an 'git svn rebase', only the trunk of the
    SVN repo is imported. During the creation of the git commit 'm', git svn
    uses the svn:mergeinfo property and tries to find the corresponding git
    commit 'e' to create 'm' with 'c' and 'e' as parents. But git svn rebase
    only imports the current branch so commit 'e' is not imported.
    Therefore git svn fails to create commit 'm' as a merge commit, because one
    of its parents is not known to git. The imported history looks like this:
    
      ... - a - b - c - m  <- trunk
    
    A later 'git svn fetch' to import all branches can't rewrite the commit 'm'
    to add 'e' as a parent and to make it a real git merge commit, because it
    was already imported.
    
    That's why the imported history misses the merge and looks like this:
    
      ... - a - b - c - m  <- trunk
              \
                d  -  e    <- branch1
    
    Right now the only known workaround for importing 'm' as a merge is to
    force reimporting 'm' again from SVN, e.g. via
    
      $ git svn reset --revision $(git find-rev $c)
      $ git svn fetch
    
    Sadly, this is where the behavior has regressed: git svn reset doesn't
    invalidate the old mergeinfo cache, which is no longer valid for the
    reimport, which leads to 'm' beeing imprted with only 'c' as parent.
    
    As solution to this problem, this commit invalidates the mergeinfo cache
    to force correct recalculation of the parents.
    
    During development of this patch, several ways for invalidating the cache
    where considered. One of them is to use Memoize::flush_cache, which will
    call the CLEAR method on the underlying Memoize persistency implementation.
    Sadly, neither Memoize::Storable nor the newer Memoize::YAML module
    introduced in 68f532f could optionally be used implement the
    CLEAR method, so this is not an option.
    
    Reseting the internal hash used to store the memoized values has the same
    problem, because it calls the non-existing CLEAR method of the
    underlying persistency layer, too.
    
    Considering this and taking into account the different implementations
    of the memoization modules, where Memoize::Storable is not in our control,
    implementing the missing CLEAR method is not an option, at least not if
    Memoize::Storable is still used.
    
    Therefore the easiest solution to clear the cache is to delete the files
    on disk in 'git svn reset'. Normally, deleting the files behind the back
    of the memoization module would be problematic, because the in-memory
    representation would still exist and contain wrong data. Fortunately, the
    memoization is active in memory only for a small portion of the code.
    Invalidating the cache by deleting the files on disk if it isn't active
    should be safe.
    
    Signed-off-by: Peter Baumann <waste.manager@gmx.de>
    Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
Commits on Aug 2, 2012
  1. @schwern

    git-svn: remove ad-hoc canonicalizations

    schwern authored Eric Wong committed
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  2. @schwern

    git-svn: canonicalize newly-minted URLs

    schwern authored Eric Wong committed
    Go through all the spots that use the new add_path_to_url() to
    make a new URL and canonicalize them.
    
    * copyfrom_path has to be canonicalized else find_parent_branch
      will get confused
    
    * due to the `canonicalize_url($full_url) ne $full_url)` line of
      logic in gs_do_switch(), $full_url is left alone until after.
    
    At this point SVN 1.7 passes except for 3 tests in
    t9100-git-svn-basic.sh that look like an SVN bug to do with
    symlinks.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  3. @schwern

    git-svn: introduce add_path_to_url function

    schwern authored Eric Wong committed
    Remove the ad-hoc versions.
    
    This is mostly to normalize the process and ensure the URLs produced
    don't have double slashes or anything.
    
    Also provides a place to fix the corner case where a file path
    contains a percent sign.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  4. @schwern

    git-svn: canonicalize earlier

    schwern authored Eric Wong committed
    Just a few things I noticed.  Its good to canonicalize as early as
    possible.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  5. @schwern

    git-svn: replace URL escapes with canonicalization

    schwern authored Eric Wong committed
    The old hand-rolled URL escape functions were inferior to
    canonicalization functions.
    
    Continuing to move towards getting everything canonicalizing the same way.
    
    * Git::SVN->init_remote_config and Git::SVN::Ra->minimize_url both
      have to canonicalize the same way else init_remote_config
      will incorrectly think they're different URLs causing
      t9107-git-svn-migrate.sh to fail.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  6. @schwern

    git-svn: attempt to mimic SVN 1.7 URL canonicalization

    schwern authored Eric Wong committed
    Previously, our URL canonicalization didn't do much of anything.
    Now it actually escapes and collapses slashes.  This is mostly a cut & paste
    of escape_url from git-svn.
    
    This is closer to how SVN 1.7's canonicalization behaves.  Doing it with
    1.6 lets us chase down some problems caused by more effective canonicalization
    without having to deal with all the other 1.7 issues on top of that.
    
    * Remote URLs have to be canonicalized otherwise Git::SVN->find_existing_remote
      will think they're different.
    
    * The SVN remote is now written to the git config canonicalized.  That
      should be ok.  Adjust a test to account for that.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  7. @schwern

    Git::SVN{,::Ra}: canonicalize earlier

    schwern authored Eric Wong committed
    This canonicalizes paths and urls as early as possible so we don't
    have to remember to do it at the point of use.  It will fix a swath
    of SVN 1.7 problems in one go.
    
    Its ok to double canonicalize things.
    
    SVN 1.7 still fails, still not worrying about that.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  8. @schwern

    git-svn: path canonicalization uses SVN API

    schwern authored Eric Wong committed
    All tests pass with SVN 1.6.  SVN 1.7 remains broken, not worrying
    about it yet.
    
    SVN changed its path canonicalization API between 1.6 and 1.7.
    http://svnbook.red-bean.com/en/1.6/svn.developer.usingapi.html#svn.developer.usingapi.urlpath
    http://svnbook.red-bean.com/en/1.7/svn.developer.usingapi.html#svn.developer.usingapi.urlpath
    
    The SVN API does not accept foo/.. but it also doesn't canonicalize
    it.  We have to do it ourselves.
    
    [ew: commit title, fall back if SVN <= 1.6 fails to canonicalize]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  9. @schwern

    Git::SVN::Utils: remove irrelevant comment

    schwern authored Eric Wong committed
    The code doesn't use File::Spec.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  10. @schwern

    git-svn: add join_paths() to safely concatenate paths

    schwern authored Eric Wong committed
    Otherwise you might wind up with things like...
    
        my $path1 = undef;
        my $path2 = 'foo';
        my $path = $path1 . '/' . $path2;
    
    creating '/foo'.  Or this...
    
        my $path1 = 'foo/';
        my $path2 = 'bar';
        my $path = $path1 . '/' . $path2;
    
    creating 'foo//bar'.
    
    Could have used File::Spec, but I'm shying away from it due to SVN
    1.7's pickiness about paths.  Felt it would be better to have our own
    we can control completely.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  11. @schwern

    git-svn: factor out _collapse_dotdot function

    schwern authored Eric Wong committed
    The SVN API functions will not accept ../foo but their canonicalization
    functions will not collapse it.  So we'll have to do it ourselves.
    
    _collapse_dotdot() works better than the existing regex did.
    
    This will be used shortly when canonicalize_path() starts using the
    SVN API.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  12. @schwern

    git-svn: use SVN 1.7 to canonicalize when possible

    schwern authored Eric Wong committed
    No change on SVN 1.6.  The tests all pass with SVN 1.6 if
    canonicalize_url() does nothing, so tests passing doesn't have
    much meaning.
    
    The tests are so messed up right now with SVN 1.7 it isn't really
    useful to check.  They will be useful later.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  13. @schwern

    git-svn: move canonicalization to Git::SVN::Utils

    schwern authored Eric Wong committed
    So they can be used by others.
    
    I'd like to test them, but they're going to become SVN API wrappers shortly
    and those aren't predictable.
    
    No functional change.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  14. @schwern

    use Git::SVN{,::RA}->url accessor globally

    schwern authored Eric Wong committed
    Note: The structure returned from Git::SVN->read_all_remotes() does not
    appear to contain objects, so I'm leaving them alone.
    
    That's everything converted over to the url and path accessors.
    
    No functional change.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  15. @schwern

    use Git::SVN->path accessor globally

    schwern authored Eric Wong committed
    No functional change.
    
    [ew: commit title]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  16. @schwern

    Git::SVN::Ra: use accessor for URLs

    schwern authored Eric Wong committed
    Later it can canonicalize automatically.
    
    A later change will make other things use the accessor.
    
    No functional change.
    
    [ew: commit title, reformatted accessor to match existing style]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  17. @schwern

    Git::SVN: use accessor for URLs internally

    schwern authored Eric Wong committed
    So later it can do automatic canonicalization.
    
    A later patch will make other things use the accessor.
    
    No functional change here.
    
    [ew: commit title]
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  18. @schwern

    Git::SVN: use accessors internally for path

    schwern authored Eric Wong committed
    Then later it can be canonicalized automatically rather than everywhere
    its used.
    
    Later patch will make other things use it.
    
    [ew: commit title, reformatted accessor to match existing style]
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
Commits on Jul 27, 2012
  1. @schwern

    Extract Git::SVN::GlobSpec from git-svn.

    schwern authored Eric Wong committed
    Straight cut & paste.  That's the last class.
    
    * Make Git::SVN load it on its own, its the only thing that needs it.
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  2. @schwern

    Move Git::IndexInfo into its own file.

    schwern authored Eric Wong committed
    Straight cut & paste.  Didn't require any fixing.
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  3. @schwern

    Extract Git::SVN::Migration from git-svn.

    schwern authored Eric Wong committed
    Straight cut & paste.
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  4. @schwern

    Extract Git::SVN::Log from git-svn.

    schwern authored Eric Wong committed
    Straight cut & paste.
    
    Also noticed Git::SVN::Ra wasn't in the compile test.  It is now.
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  5. @schwern

    Move initialization of Git::SVN variables into Git::SVN.

    schwern authored Eric Wong committed
    Also it can compile on its own now, yay!
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  6. @schwern

    Extract Git::SVN from git-svn into its own .pm file.

    schwern authored Eric Wong committed
    Except for adding the 1; at the end, this is a straight copy & paste.
    
    Tests still pass, but its doubtful Git::SVN will compile on its own
    without git-svn being loaded.  Next commit will fix that.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  7. @schwern

    Extract some utilities from git-svn to allow extracting Git::SVN.

    schwern authored Eric Wong committed
    Put them in a new module called Git::SVN::Utils.  Yeah, not terribly
    original and it will be a dumping ground.  But its better than having
    them in the main git-svn program.  At least they can be documented
    and tested.
    
    * fatal() is used by many classes.
    * Change the $can_compress lexical into a function.
    
    This should be enough to extract Git::SVN.
    
    Signed-off-by: Michael G. Schwern <schwern@pobox.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  8. @gitster

    perl: detect new files in MakeMaker builds

    gitster authored Eric Wong committed
    While Makefile.PL now finds .pm files on its own, it does not
    detect new files after it generates perl/perl.mak.
    
    [ew: commit message, minor tweaks]
    
    ref: http://mid.gmane.org/7vlii51xz4.fsf@alter.siamese.dyndns.org
    
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  9. @schwern

    The Makefile.PL will now find .pm files itself.

    schwern authored Eric Wong committed
    It is no longer necessary to manually add new .pm files to the
    Makefile.PL.  This makes it easier to add modules.
    
    It is still necessary to add them to the Makefile, but that extra work
    should be removed at a future date.
    
    Signed-off-by: Michael G Schwern <schwern@pobox.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  10. @schwern

    Don't lose Error.pm if $@ gets clobbered.

    schwern authored Eric Wong committed
    In older Perls, sometimes $@ can become unset between the eval and
    checking $@.  Its safer to check the eval directly.
    
    Signed-off-by: Michael G Schwern <schwern@pobox.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
  11. @schwern

    Quiet warning if Makefile.PL is run with -w and no --localedir

    schwern authored Eric Wong committed
    Usually it isn't, but its nice if it can be run with warnings on.
    
    Signed-off-by: Michael G Schwern <schwern@pobox.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Eric Wong <normalperson@yhbt.net>
Commits on Jun 29, 2012
  1. @gitster

    perl/Makefile: Fix a missing double-quote

    Johannes Sixt authored gitster committed
    Signed-off-by: Johannes Sixt <j6t@kdbg.org>
    Acked-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 15, 2012
  1. @jrn @gitster

    perl/Makefile: move "mkdir -p" to module installation loop for mainta…

    jrn authored gitster committed
    …inability
    
    In the NO_PERL_MAKEMAKER=YesPlease fallback case, make the directory
    that will contain each module when installing it (simulating "install
    -D") instead of hardcoding "Git/SVN/Memoize is the deepest level".
    This should make this codepath which is not used often on development
    machines a little easier to maintain.
    
    Requested-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @jrn @gitster

    perl/Makefile: install Git::SVN::* when NO_PERL_MAKEMAKER=yes, too

    jrn authored gitster committed
    v1.7.11-rc1~12^2~2 (2012-05-27) and friends split some git-svn code
    into separate modules but did not update the fallback rules to install
    them when NO_PERL_MAKEMAKER is set.  Add the appropriate rules so
    users without MakeMaker can use git-svn again.
    
    Affected modules: Git::SVN::Prompt, Git::SVN::Fetcher,
    Git::SVN::Editor, Git::SVN::Ra, Git::SVN::Memoize::YAML.
    
    Reported-by: Adam Roben <adam@roben.org>
    Signed-off-by: Jonathan Nieder <jrnieder@gmali.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @jrn @gitster

    perl/Makefile.PL: warn about duplicate module list in perl/Makefile

    jrn authored gitster committed
    Adding or removing a module requires modifying both files to support
    builds with and without MakeMaker.  Add a comment to remind patch
    authors and reviewers at the crucial moment.
    
    Longer term, it would be nicer to maintain a single list, perhaps in a
    separate file used by both build systems.
    
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.