1. 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
  2. 04 Aug, 2016 1 commit
  3. 25 Jun, 2014 1 commit
    • pack: clean up error returns · c19b1c04
      Set a message when we fail to lock.
      
      Also make the put function void, since it's called from free, which
      cannot report errors. The only errors we can experience here are
      internal state corruption, so we assert that we are trying to put a
      pack which we have previously got.
      Carlos Martín Nieto committed
  4. 23 Jun, 2014 1 commit
    • Share packs across repository instances · b3b66c57
      Opening the same repository multiple times will currently open the same
      file multiple times, as well as map the same region of the file multiple
      times. This is not necessary, as the packfile data is immutable.
      
      Instead of opening and closing packfiles directly, introduce an
      indirection and allocate packfiles globally. This does mean locking on
      each packfile open, but we already use this lock for the global mwindow
      list so it doesn't introduce a new contention point.
      Carlos Martín Nieto committed
  5. 08 Jan, 2013 1 commit
  6. 06 Jan, 2013 1 commit
    • git_mwindow_file_deregister() shouldn't return errors · f9b55bcb
      As a function that appears to only be called on error paths, I don't
      think it makes sense for it to return an error, or clobber the global
      giterr. Note that no existing callsites actually check the return
      code.
      
      In my own application, there are errors where the real error ends
      up being hidden, as git_mwindow_file_deregister() clobbers the
      global giterr. I'm not sure this error is even relevant?
      Scott J. Goldman committed
  7. 20 Aug, 2012 1 commit
    • Make the memory-window conrol structures global · 8cef828d
      Up to now, the idea was that the user would do all the operations for
      one repository in the same thread. Thus we could have the
      memory-mapped window information thread-local and avoid any locking.
      
      This is not practical in a few environments, such as Apple's GCD which
      allocates threads arbitrarily or the .NET CLR, where the OS-level
      thread can change at any moment.
      
      Make the control structure global and protect it with a mutex so we
      don't depend on the thread currently executing the code.
      Carlos Martín Nieto committed
  8. 28 Jun, 2012 1 commit
  9. 15 Mar, 2012 1 commit
    • Continue error conversion · deafee7b
      This converts blob.c, fileops.c, and all of the win32 files.
      Also, various minor cleanups throughout the code.  Plus, in
      testing the win32 build, I cleaned up a bunch (although not
      all) of the warnings with the 64-bit build.
      Russell Belfer committed
  10. 13 Feb, 2012 1 commit
  11. 16 Nov, 2011 1 commit
  12. 18 Sep, 2011 1 commit
    • Cleanup legal data · bb742ede
      1. The license header is technically not valid if it doesn't have a
      copyright signature.
      
      2. The COPYING file has been updated with the different licenses used in
      the project.
      
      3. The full GPLv2 header in each file annoys me.
      Vicent Marti committed
  13. 08 Aug, 2011 1 commit
  14. 02 Aug, 2011 2 commits
  15. 01 Jul, 2011 1 commit
  16. 07 Jun, 2010 1 commit
  17. 04 May, 2010 1 commit
  18. 14 Apr, 2010 1 commit
    • Add block-sha1 in favour of the mozilla routines · 5dddf7c8
      Since block-sha1 from git.git has such excellent performance, we
      can also get rid of the openssl dependency. It's rather simple
      to add it back later as an optional extra, but we really needn't
      bother to pull in the entire ssl library and have to deal with
      linking issues now that we have the portable and, performance-wise,
      truly excellent block-sha1 code to fall back on.
      
      Since this requires a slight revamp of the build rules anyway, we
      take the opportunity to fix including EXTRA_OBJS in the final build
      as well.
      
      The block-sha1 code was originally implemented for git.git by
      Linus Torvalds <torvalds@linux-foundation.org> and was later
      polished by Nicolas Pitre <nico@cam.org>.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Andreas Ericsson committed
  19. 18 Mar, 2009 1 commit
    • Add built-in (Mozilla) SHA1 routines · 1906f236
      Paul agreed to the GCC-exception license by email:
      |
      | From: Paul Kocher <paul@cryptography.com>
      | Date: Sun, 15 Mar 2009 11:37:23 -0700
      | Subject: Re: Adding Mozilla SHA1 implementation to libgit2
      |
      | Yes - that's fine.
      |
      | At 01:56 AM 3/5/2009, Andreas Ericsson wrote:
      | > Hi Paul. We spoke earlier about this, if you remember?
      | > We'd like to add the GCC-exception to the GPL license
      | > for these files.
      
      Signed-off-by: Paul Kocher <paul@cryptography.com>
      Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Ramsay Jones committed
  20. 31 Dec, 2008 1 commit
    • Wrap malloc and friends and report out of memory as GIT_ENOMEM · 64a47c01
      We now forbid direct use of malloc, strdup or calloc within the
      library and instead use wrapper functions git__malloc, etc. to
      invoke the underlying library malloc and set git_errno to a no
      memory error code if the allocation fails.
      
      In the future once we have pack objects in memory we are likely
      to enhance these routines with garbage collection logic to purge
      cached pack data when allocations fail.  Because the size of the
      function will grow somewhat large, we don't want to mark them for
      inline as gcc tends to aggressively inline, creating larger than
      expected executables.
      
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Shawn O. Pearce committed
  21. 30 Dec, 2008 1 commit
  22. 22 Nov, 2008 1 commit
  23. 18 Nov, 2008 1 commit
    • s/git_revp/git_revpool/ · 1b9e92c7
      git_revp is something I personally can't stop pronouncing
      "rev pointer". I'm sure others would suffer the same
      problem.
      
      Also, rename the git_revp_ sub-api "gitrp_". This is the
      first of many such renames, primarily done to prevent
      extreme inflation in the "git_" namespace, which we'd like
      to reserve for a higher-level API.
      
      While we're at it, we remove the noise-char "c" from a lot
      of functions. Since revision walking is all about commits,
      the common case should be that we're dealing with commits.
      Exceptions can get a more mnemonic description as needed.
      
      Signed-off-by: Andreas Ericsson <ae@op5.se>
      Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
      Andreas Ericsson committed
  24. 01 Nov, 2008 5 commits
  25. 31 Oct, 2008 6 commits