Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Symlink support #172

Merged
merged 14 commits into from
Jun 24, 2014
Merged

Symlink support #172

merged 14 commits into from
Jun 24, 2014

Commits on Jun 21, 2014

  1. MinGW: Add symlink support for NTFS on windows

    This patch implements git support for NTFS symbolic link type reparse points.
    
    * There is a specific privelege required to create symbolic links that is not
      generally associated with a standard user. This part is up to the user to worry
      about.
    
    * NTFS reparse points differentiate between file and directory links.  This
      patch assumes file links are meant. (A separate patch will develop this
      further).
    
    * This patch is not intended to implement symbolic links in the shell utilities.
      This means that as of when this was written, bash and gnu utilities do not
      handle them.
    
    * Windows chdir behaves differently to *nix, and we need to unravel symbolic
      links for various operations to work as expected.
    
    * For efficiency, as much as possible of the calls are done with wchar_t, before
      being converted to utf-8.  This is as much about avoiding dealing with windows
      default encoding as anything else.
    
    * resolve_symlink needed to be replaced in lockfile.c since there are some
      issues with recognising absolute paths, as well as for efficiency with
      wchar_t.
    
    This work was based on a combination of patches developed by the following
    people:
    
    original-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    original-by: Thorvald Natvig <slicer@users.sourceforge.net>
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    82cc187 View commit details
    Browse the repository at this point in the history
  2. MinGW: Allow passing the symlink target type from index information.

    Required for msysgit which needs to know whether the target of a symbolic link
    is a directory or file.
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    75b8a67 View commit details
    Browse the repository at this point in the history
  3. mingw: Create directory/file symlink from information available

    Windows NTFS symbolic links require specifying whether the target is a file or
    directory at creation time.  This can partially be done by interrogating the
    filesystem, however when creating symbolic links that are within a repository,
    there can be no guarantee of the order of creation.
    
    This patch enables the code to allow interrogation of the git cache to determine
    whether a target will be a file or a directory.
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    eabcbcc View commit details
    Browse the repository at this point in the history
  4. test: Work around lack of windows native symlink support in current msys

    The current msys does not have support for NTFS symlinks.  This includes in
    'ln', 'test', 'rm'.
    
    Here the commands are overridden to use windows cmd.exe instead of msys.
    The implementation of test is quite expensive but works for the test.
    
    'rm' needs to handle many scenarios. Symlinks are not supported at all by the
    msys version.
    * 'rm -rf' equivalent needs to first delete the files, and then the directories.
    * Directory symbolic links need to use cmd.exe 'rmdir'
    * file symbolic links need to use 'del'.
    * A couple of places use 'rm -rf' on a mix of files and directories, so needs to
      be split up.
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    4d733b9 View commit details
    Browse the repository at this point in the history
  5. test: Don't have dangling symlinks in tests (for msys)

    There are 2 reasons for this:
      * Under windows, ln() must determine whether the target is a directory or a
        file before creating the link.
      * msys doesn't handle dangling NTFS symlinks well (for example 'ls' will abort
        at that point, claiming the file doesn't exist).
    
    So I have reordered commands to make sure our symlinks don't dangle from the
    time of their creation.
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    dda0d3d View commit details
    Browse the repository at this point in the history
  6. test: Factor abspath_of_dir for testing 'absolute paths'

    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    4a83680 View commit details
    Browse the repository at this point in the history
  7. test: Implement mingw abspath_of_dir

    needed to translate /c/ -> c: for comparison.
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    a662ef7 View commit details
    Browse the repository at this point in the history
  8. test: Factor out 'check_symlink' for stash tests

    Required by msysgit while the msys core does not handle reading NTFS
    Symbolic-Link Reparse Points.
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    2fa9eca View commit details
    Browse the repository at this point in the history
  9. test: Override 'check_symlink' to work with incomplete mingw

    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    3259ff9 View commit details
    Browse the repository at this point in the history
  10. contrib: make git-new-workdir work with windows symlinks.

    Required for tests to work.
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    1919ecf View commit details
    Browse the repository at this point in the history
  11. test: Differentiate ability for gnu utils to handle symlinks from git

    t7800 failed under symlink enabled msysgit without symlink enabled perl/msys
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    0a77793 View commit details
    Browse the repository at this point in the history
  12. test: Fixup 3900 i38n quoting

    Failure of test_when_finished caused test to fail
    required for overridden rm () to work without error
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 21, 2014
    Configuration menu
    Copy the full SHA
    1930ec6 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2014

  1. test: Introduce binary compare function

    In msysgit there were some crashes caused by the line conversions
    when comparing binary files.
    
    I've also used the patch originally by Stepan Kasal to extend coverage
    of binary compares.
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 23, 2014
    Configuration menu
    Copy the full SHA
    db19ecf View commit details
    Browse the repository at this point in the history
  2. test: Fix remote failure test to use correct env variable

    The test was using the wrong testgit variable helper to cause the failure.
    I still don't know why this test wasn't failing on all machines.
    
    Signed-off-by: Michael Geddes <michael@frog.wheelycreek.net>
    frogonwheels committed Jun 23, 2014
    Configuration menu
    Copy the full SHA
    3e5df5d View commit details
    Browse the repository at this point in the history