1. 23 Aug, 2019 2 commits
  2. 01 Apr, 2018 1 commit
    • revwalk: avoid walking the entire history when output is unsorted · 2a6d0956
      As part of reducing our divergence from git, its code for revwalk was ported
      into our codebase. A detail about when to limit the list was lost and we ended
      up always calling that code.
      
      Limiting the list means performing the walk and creating the final list of
      commits to be output during the preparation stage. This is unavoidable when
      sorting and when there are negative refs.
      
      We did this even when asked for unsorted output with no negative refs, which you
      might do to retrieve something like the "last 10 commits on HEAD" for a
      nominally unsorted meaning of "last".
      
      This commit adds and sets a flag indicating when we do need to limit the list,
      letting us avoid doing so when we can. The previously mentioned query thus no
      longer loads the entire history of the project during the prepare stage, but
      loads it iteratively during the walk.
      Carlos Martín Nieto committed
  3. 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
  4. 11 Mar, 2015 1 commit
  5. 15 Feb, 2015 1 commit
  6. 08 Oct, 2014 2 commits
  7. 31 Mar, 2014 1 commit
  8. 24 Mar, 2014 1 commit
  9. 20 Mar, 2014 1 commit
    • revwalk: don't try to find merge bases when there can be none · 704b55cc
      As a way to speed up the cases where we need to hide some commits, we
      find out what the merge bases are so we know to stop marking commits as
      uninteresting and avoid walking down a potentially very large amount of
      commits which we will never see. There are however two oversights in
      current code.
      
      The merge-base finding algorithm fails to recognize that if it is only
      given one commit, there can be no merge base. It instead walks down the
      whole ancestor chain needlessly. Make it return an empty list
      immediately in this situation.
      
      The revwalk does not know whether the user has asked to hide any commits
      at all. In situation where the user pushes multiple commits but doesn't
      hide any, the above fix wouldn't do the trick. Keep track of whether the
      user wants to hide any commits and only run the merge-base finding
      algorithm when it's needed.
      Carlos Martín Nieto committed
  10. 09 Sep, 2013 1 commit
  11. 08 Jan, 2013 1 commit
  12. 30 Nov, 2012 1 commit
  13. 27 Nov, 2012 1 commit
  14. 16 Mar, 2011 1 commit
  15. 14 Mar, 2011 1 commit
    • Rewrite the Revision Walker · 71db842f
      The new revision walker uses an internal Commit object storage system,
      custom memory allocator and much improved topological and time sorting
      algorithms. It's about 20x times faster than the previous implementation
      when browsing big repositories.
      
      The following external API calls have changed:
      
      	`git_revwalk_next` returns an OID instead of a full commit object.
      	The initial call to `git_revwalk_next` is no longer blocking when
      	iterating through a repo with a time-sorting mode.
      
      	Iterating with Topological or inverted modes still makes the initial
      	call blocking to preprocess the commit list, but this block should be
      	mostly unnoticeable on most repositories (topological preprocessing
      	times at 0.3s on the git.git repo).
      
      	`git_revwalk_push` and `git_revwalk_hide` now take an OID instead
      	of a full commit object.
      Vicent Marti committed
  16. 06 Dec, 2010 1 commit
  17. 12 Aug, 2010 1 commit
    • Redesigned the walking/object lookup interface · 3315782c
      The old 'git_revpool' object has been removed and
      split into two distinct objects with separate
      functionality, in order to have separate methods for
      object management and object walking.
      
      *	A new object 'git_repository' does the high-level
      	management of a repository's objects (commits, trees,
      	tags, etc) on top of a 'git_odb'.
      
      	Eventually, it will also manage other repository
      	attributes (e.g. tag resolution, references, etc).
      
      	See: src/git/repository.h
      
      *	A new external method
      		'git_repository_lookup(repo, oid, type)'
      	has been added to the 'git_repository' API.
      
      	All object lookups (git_XXX_lookup()) are now
      	wrappers to this method, and duplicated code
      	has been removed. The method does automatic type
      	checking and returns a generic 'git_revpool_object'
      	that can be cast to any specific object.
      
      	See: src/git/repository.h
      
      *	The external methods for object parsing of repository
      	objects (git_XXX_parse()) have been removed.
      
      	Loading objects from the repository is now managed
      	through the 'lookup' functions. These objects are
      	loaded with minimal information, and the relevant
      	parsing is done automatically when the user requests
      	any of the parsed attributes through accessor methods.
      
      	An attribute has been added to 'git_repository' in
      	order to force the parsing of all the repository objects
      	immediately after lookup.
      
      	See: src/git/commit.h
      	See: src/git/tag.h
      	See: src/git/tree.h
      
      *	The previous walking functionality of the revpool
      	is now found in 'git_revwalk', which does the actual
      	revision walking on a repository; the attributes
      	when walking through commits in a database have been
      	decoupled from the actual commit objects.
      	This increases performance when accessing commits
      	during the walk and allows to have several
      	'git_revwalk' instances working at the same time on
      	top of the same repository, without having to load
      	commits in memory several times.
      
      	See: src/git/revwalk.h
      
      *	The old 'git_revpool_table' has been renamed to
      	'git_hashtable' and now works as a generic hashtable
      	with support for any kind of object and custom hash
      	functions.
      
      	See: src/hashtable.h
      
      *	All the relevant unit tests have been updated, renamed
      	and grouped accordingly.
      
      Signed-off-by: Vicent Marti <tanoku@gmail.com>
      Vicent Marti committed
  18. 15 Jul, 2010 1 commit
  19. 02 Jun, 2010 9 commits
  20. 31 Dec, 2008 1 commit
  21. 22 Nov, 2008 1 commit