1. 22 Jan, 2019 1 commit
  2. 01 Feb, 2018 1 commit
  3. 26 Dec, 2017 1 commit
  4. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  5. 28 Feb, 2017 2 commits
    • fsync parent directories when fsyncing · 1229e1c4
      When fsync'ing files, fsync the parent directory in the case where we
      rename a file into place, or create a new file, to ensure that the
      directory entry is flushed correctly.
      Edward Thomson committed
    • git_futils_writebuffer: optionally fsync · 5312621b
      Add a custom `O_FSYNC` bit (if it's not been defined by the operating
      system`) so that `git_futils_writebuffer` can optionally do an `fsync`
      when it's done writing.
      
      We call `fsync` ourselves, even on systems that define `O_FSYNC` because
      its definition is no guarantee of its actual support.  Mac, for
      instance, defines it but doesn't support it in an `open(2)` call.
      Edward Thomson committed
  6. 14 Nov, 2016 1 commit
  7. 04 Aug, 2016 2 commits
  8. 30 Oct, 2015 1 commit
  9. 19 Sep, 2015 1 commit
  10. 17 Sep, 2015 1 commit
    • git_futils_mkdir_*: make a relative-to-base mkdir · ac2fba0e
      Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter
      assumes that we own everything beneath the base, as if it were
      being called with a base of the repository or working directory,
      and is tailored towards checkout and ensuring that there is no
      bogosity beneath the base that must be cleaned up.
      
      This is (at best) slow and (at worst) unsafe in the larger context
      of a filesystem where we do not own things and cannot do things like
      unlink symlinks that are in our way.
      Edward Thomson committed
  11. 04 Feb, 2015 1 commit
  12. 20 Jan, 2015 2 commits
  13. 28 May, 2014 1 commit
  14. 17 Apr, 2014 2 commits
    • Fix broken logic for attr cache invalidation · 823c0e9c
      The checks to see if files were out of date in the attibute cache
      was wrong because the cache-breaker data wasn't getting stored
      correctly.  Additionally, when the cache-breaker triggered, the
      old file data was being leaked.
      Russell Belfer committed
    • Attribute file cache refactor · 7d490872
      This is a big refactoring of the attribute file cache to be a bit
      simpler which in turn makes it easier to enforce a lock around any
      updates to the cache so that it can be used in a threaded env.
      Tons of changes to the attributes and ignores code.
      Russell Belfer committed
  15. 25 Feb, 2014 1 commit
  16. 05 Nov, 2013 2 commits
  17. 03 Oct, 2013 1 commit
    • Initial iconv hookup for precomposed unicode · 219d3457
      This hooks up git_path_direach and git_path_dirload so that they
      will take a flag indicating if directory entry names should be
      tested and converted from decomposed unicode to precomposed form.
      This code will only come into play on the Apple platform and even
      then, only when certain types of filesystems are used.
      
      This involved adding a flag to these functions which involved
      changing a lot of places in the code.
      
      This was an opportunity to do a bit of code cleanup here and there,
      for example, getting rid of the git_futils_cleanupdir_r function in
      favor of a simple flag to git_futils_rmdir_r to not remove the top
      level entry.  That ended up adding depth tracking during rmdir_r
      which led to a safety check for infinite directory recursion.  Yay.
      
      This hasn't actually been tested on the Mac filesystems where the
      issue occurs.  I still need to get test environment for that.
      Russell Belfer committed
  18. 17 Sep, 2013 3 commits
  19. 05 Sep, 2013 3 commits
  20. 23 Jul, 2013 1 commit
  21. 11 Jul, 2013 1 commit
  22. 20 May, 2013 2 commits
    • Add more diff rename detection tests · 4742148d
      This adds a bunch more rename detection tests including checks
      vs the working directory, the new exact match options, some more
      whitespace variants, etc.
      
      This also adds a git_futils_writebuffer helper function and uses
      it in checkout.  This is mainly added because I wanted an easy
      way to write out a git_buf to disk inside my test code.
      Russell Belfer committed
    • More git_diff_find_similar improvements · 9be5be47
      - Add new GIT_DIFF_FIND_EXACT_MATCH_ONLY flag to do similarity
        matching without using the similarity metric (i.e. only compare
        the SHA).
      - Clean up the similarity measurement code to more rigorously
        distinguish between files that are not similar and files that
        are not comparable (previously, a 0 could either mean that the
        files could not be compared or that they were totally different)
      - When splitting a MODIFIED file into a DELETE/ADD pair, actually
        make a DELETED/UNTRACKED pair if the right side of the diff is
        from the working directory.  This prevents an odd mix of ADDED
        and UNTRACKED files on workdir diffs.
      Russell Belfer committed
  23. 18 Mar, 2013 1 commit
    • Switch search paths to classic delimited strings · 41954a49
      This switches the APIs for setting and getting the global/system
      search paths from using git_strarray to using a simple string with
      GIT_PATH_LIST_SEPARATOR delimited paths, just as the environment
      PATH variable would contain.  This makes it simpler to get and set
      the value.
      
      I also added code to expand "$PATH" when setting a new value to
      embed the old value of the path.  This means that I no longer
      require separate actions to PREPEND to the value.
      Russell Belfer committed
  24. 15 Mar, 2013 1 commit
    • Implement global/system file search paths · 5540d947
      The goal of this work is to expose the search logic for "global",
      "system", and "xdg" files through the git_libgit2_opts() interface.
      
      Behind the scenes, I changed the logic for finding files to have a
      notion of a git_strarray that represents a search path and to store
      a separate search path for each of the three tiers of config file.
      For each tier, I implemented a function to initialize it to default
      values (generally based on environment variables), and then general
      interfaces to get it, set it, reset it, and prepend new directories
      to it.
      
      Next, I exposed these interfaces through the git_libgit2_opts
      interface, reusing the GIT_CONFIG_LEVEL_SYSTEM, etc., constants
      for the user to control which search path they were modifying.
      There are alternative designs for the opts interface / argument
      ordering, so I'm putting this phase out for discussion.
      
      Additionally, I ended up doing a little bit of clean up regarding
      attr.h and attr_file.h, adding a new attrcache.h so the other two
      files wouldn't have to be included in so many places.
      Russell Belfer committed
  25. 01 Mar, 2013 1 commit
  26. 27 Feb, 2013 1 commit
    • Make mode handling during init more like git · 18f08264
      When creating files, instead of actually using GIT_FILEMODE_BLOB
      and the other various constants that happen to correspond to
      mode values, apparently I should be just using 0666 and 0777, and
      relying on the umask to clear bits and make the value sane.
      
      This fixes the rules for copying a template directory and fixes
      the checks to match that new behavior.  (Further changes to the
      checkout logic to follow separately.)
      Russell Belfer committed
  27. 26 Feb, 2013 1 commit
    • Fix initialization of repo directories · 3c42e4ef
      When PR #1359 removed the hooks from the test resources/template
      directory, it made me realize that the tests for
      git_repository_init_ext using templates must be pretty shabby
      because we could not have been testing if the hooks were getting
      created correctly.
      
      So, this started with me recreating a couple of hooks, including
      a sample and symlink, and adding tests that they got created
      correctly in the various circumstances, including with the SHARED
      modes, etc.  Unfortunately this uncovered some issues with how
      directories and symlinks were copied and chmod'ed.  Also, there
      was a FIXME in the code related to the chmod behavior as well.
      
      Going back over the directory creation logic for setting up a
      repository, I found it was a little difficult to read and could
      result in creating and/or chmod'ing directories that the user
      almost certainly didn't intend.
      
      So that let to this work which makes repo initialization much
      more careful (and hopefully easier to follow).  It required a
      couple of extensions / changes to core fileops utilities, but I
      also think those are for the better, at least for git_futils_cp_r
      in terms of being careful about what actions it takes.
      Russell Belfer committed
  28. 08 Jan, 2013 1 commit
  29. 09 Nov, 2012 2 commits
    • Rework checkout with new strategy options · ad9a921b
      This is a major reworking of checkout strategy options.  The
      checkout code is now sensitive to the contents of the HEAD tree
      and the new options allow you to update the working tree so that
      it will match the index content only when it previously matched
      the contents of the HEAD.  This allows you to, for example, to
      distinguish between removing files that are in the HEAD but not
      in the index, vs just removing all untracked files.
      
      Because of various corner cases that arise, etc., this required
      some additional capabilities in rmdir and other utility functions.
      
      This includes the beginnings of an implementation of code to read
      a partial tree into the index based on a pathspec, but that is
      not enabled because of the possibility of creating conflicting
      index entries.
      Russell Belfer committed
    • Extensions to rmdir and mkdir utilities · 331e7de9
      * Rework GIT_DIRREMOVAL values to GIT_RMDIR flags, allowing
        combinations of flags
      * Add GIT_RMDIR_EMPTY_PARENTS flag to remove parent dirs that
        are left empty after removal
      * Add GIT_MKDIR_VERIFY_DIR to give an error if item is a file,
        not a dir (previously an EEXISTS error was ignored, even for
        files) and enable this flag for git_futils_mkpath2file call
      * Improve accuracy of error messages from git_futils_mkdir
      Russell Belfer committed