Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jul 7, 2014
  1. @kblees @gitster

    hashmap: factor out getting a hash code from a SHA1

    kblees authored gitster committed
    Copying the first bytes of a SHA1 is duplicated in six places,
    however, the implications (the actual value would depend on the
    endianness of the platform) is documented only once.
    
    Add a properly documented API for this.
    
    Signed-off-by: Karsten Blees <blees@dcon.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 16, 2013
  1. @gitster

    decorate.c: compact table when growing

    Kevin Bracey authored gitster committed
    When growing the table, take the opportunity to "compact" it by removing
    entries with NULL decoration.
    
    Users may have "removed" decorations by passing NULL to
    insert_decoration. An object's table entry can't actually be removed
    during normal operation, as it would break the linear hash collision
    search. But we can remove NULL decoration entries when rebuilding the
    table.
    
    Signed-off-by: Kevin Bracey <kevin@bracey.fi>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 20, 2009
  1. @toofishes @gitster

    Unify signedness in hashing calls

    toofishes authored gitster committed
    Our hash_obj and hashtable_index calls and functions were doing a lot of
    funny things with signedness. Unify all of it to 'unsigned int'.
    
    Signed-off-by: Dan McGee <dpmcgee@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 17, 2009
  1. @toofishes @gitster

    Fix type-punning issues

    toofishes authored gitster committed
    In these two places we are casting part of our unsigned char sha1 array into
    an unsigned int, which violates GCCs strict-aliasing rules (and probably
    other compilers).
    
    Signed-off-by: Dan McGee <dpmcgee@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 20, 2008
  1. @peff @gitster

    decorate: allow const objects to be decorated

    peff authored gitster committed
    We don't actually modify the struct object, so there is no
    reason not to accept const versions (and this allows other
    callsites, like the next patch, to use the decoration
    machinery).
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 3, 2008
  1. @gitster

    fast-export --export-marks: fix off by one error

    gitster authored
    The export_marks() function iterated over a (potentially sparsely
    populated) hashtable, but it accessed it starting from offset 1 and one
    element beyond the end.
    
    Noticed by SungHyun Nam.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 21, 2007
  1. @torvalds

    Fix a copy-n-paste bug in the object decorator code.

    torvalds authored Junio C Hamano committed
    Duh.
    
    When I did the object decorator thing, I made the "loop over the hash"
    function use the same logic for updating the hash, ie made them use
    
    	if (++j >= size)
    		j = 0;
    
    for both the hash update for both "insert" and "lookup"
    
    HOWEVER.
    
    For some inexplicable reason I had an extraneous
    
    	j++;
    
    in the insert path (probably just from the fact that the old code there
    used
    
    	j++;
    	if (j >= size)
    		j = 0;
    
    and when I made them use the same logic I just didn't remove the old
    extraneous line properly.
    
    This fixes it.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Commits on Apr 16, 2007
  1. @torvalds

    Add a generic "object decorator" interface, and make object refs use it

    torvalds authored Junio C Hamano committed
    This allows you to add an arbitrary "decoration" of your choice to any
    object.  It's a space- and time-efficient way to add information to
    arbitrary objects, especially if most objects probably do not have the
    decoration.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Something went wrong with that request. Please try again.