Skip to content
Commits on Jun 8, 2008
  1. Remove unused code in parse_commit_buffer()

    Miklos Vajna committed with Jun 7, 2008
    The n_refs variable is no longer really used in this function, so there
    is no reason to keep it.
    
    It was introduced in 27dedf0 and the code that really used it was
    removed in 7914053.
    
    Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 26, 2008
  1. builtin-fsck: reports missing parent commits

    Martin Koegler committed with Feb 25, 2008
    parse_commit ignores parent commits with certain errors
    (eg. a non commit object is already loaded under the sha1 of
    the parent). To make fsck reports such errors, it has to compare
    the nummer of parent commits returned by parse commit with the
    number of parent commits in the object or in the graft/shallow file.
    
    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Remove unused object-ref code

    Martin Koegler committed with Feb 25, 2008
    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 19, 2008
  1. check return value from parse_commit() in various functions

    Martin Koegler committed with Feb 18, 2008
    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. parse_commit: don't fail, if object is NULL

    Martin Koegler committed with Feb 18, 2008
    Some codepaths (eg. builtin-rev-parse -> get_merge_bases -> parse_commit)
    can pass NULL.
    
    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. check results of parse_commit in merge_bases

    Martin Koegler committed with Feb 18, 2008
    An error is signaled by returning NULL.
    
    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 20, 2008
  1. parse_commit_buffer: tighten checks while parsing

    Martin Koegler committed with Jan 19, 2008
    This tightens the parsing of a commit object in a couple of ways.
    
     - The "tree " header must end with a LF (earlier we did not
       check this condition).
    
     - Make sure parsing of timestamp on the "committer " header
       does not go beyond the buffer, even when (1) the "author "
       header does not end with a LF (this means that the commit
       object is malformed and lacks the committer information) or
       (2) the "committer " header does not have ">" that is the end
       of the e-mail address, or (3) the "committer " header does
       not end with a LF.
    
    We however still keep the existing behaviour to return a parsed
    commit object even when non-structural headers such as committer
    and author are malformed, so that tools that need to look at
    commits to clean up a history with such broken commits can still
    get at the structural data (i.e. the parents chain and the tree
    object).
    
    Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 19, 2007
  1. Merge branch 'lt/rev-list-interactive'

    committed Nov 18, 2007
    * lt/rev-list-interactive:
      Fix parent rewriting in --early-output
      revision walker: mini clean-up
      Enhance --early-output format
      Add "--early-output" log flag for interactive GUI use
      Simplify topo-sort logic
Commits on Nov 5, 2007
  1. @dscho

    Split off the pretty print stuff into its own file

    dscho committed with Nov 4, 2007
    The file commit.c got quite large, but it does not have to be: the
    code concerning pretty printing is pretty well contained.  In fact,
    this commit just splits it off into pretty.c, leaving commit.c with
    just 672 lines.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 4, 2007
  1. @torvalds

    Simplify topo-sort logic

    torvalds committed with Nov 2, 2007
    .. by not using quite so much indirection.
    
    This currently grows the "struct commit" a bit, which could be avoided by
    using a union for "util" and "indegree" (the topo-sort used to use "util"
    anyway, so you cannot use them together), but for now the goal of this was
    to simplify, not optimize.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Commits on Nov 2, 2007
  1. format-patch -s: add MIME encoding header if signer's name requires so

    committed Oct 31, 2007
    When the body of the commit log message contains a non-ASCII character,
    format-patch correctly emitted the encoding header to mark the resulting
    message as such.  However, if the original message was fully ASCII, the
    command line switch "-s" was given to add a new sign-off, and
    the signer's name was not ASCII only, the resulting message would have
    contained non-ASCII character but was not marked as such.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 16, 2007
  1. @spearce

    Merge branch 'maint'

    spearce committed Oct 15, 2007
    * maint:
      Whip post 1.5.3.4 maintenance series into shape.
      rebase -i: use diff plumbing instead of porcelain
      Do not remove distributed configure script
      git-archive: document --exec
      git-reflog: document --verbose
      git-config: handle --file option with relative pathname properly
      clear_commit_marks(): avoid deep recursion
      git add -i: Remove unused variables
      git add -i: Fix parsing of abbreviated hunk headers
      git-config: don't silently ignore options after --list
      Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT
      Fix embarrassing "git log --follow" bug
    
    Conflicts:
    
    	RelNotes
    	git-rebase--interactive.sh
  2. @dscho @spearce

    clear_commit_marks(): avoid deep recursion

    dscho committed with spearce Oct 10, 2007
    Before this patch, clear_commit_marks() recursed for each parent.  This
    could be potentially very expensive in terms of stack space.  Probably
    the only reason that this did not lead to problems is the fact that we
    typically call clear_commit_marks() after marking a relatively small set
    of commits.
    
    Use (sort of) a tail recursion instead: first recurse on the parents
    other than the first one, and then continue the loop with the first
    parent.
    
    Noticed by Shawn Pearce.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Lars Hjemli <hjemli@gmail.com>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Commits on Oct 3, 2007
  1. Merge branch 'mv/unknown'

    committed Oct 3, 2007
    * mv/unknown:
      Don't use "<unknown>" for placeholders and suppress printing of empty user formats.
Commits on Sep 29, 2007
  1. strbuf change: be sure ->buf is never ever NULL.

    Pierre Habouzit committed with Sep 27, 2007
    For that purpose, the ->buf is always initialized with a char * buf living
    in the strbuf module. It is made a char * so that we can sloppily accept
    things that perform: sb->buf[0] = '\0', and because you can't pass "" as an
    initializer for ->buf without making gcc unhappy for very good reasons.
    
    strbuf_init/_detach/_grow have been fixed to trust ->alloc and not ->buf
    anymore.
    
    as a consequence strbuf_detach is _mandatory_ to detach a buffer, copying
    ->buf isn't an option anymore, if ->buf is going to escape from the scope,
    and eventually be free'd.
    
    API changes:
      * strbuf_setlen now always works, so just make strbuf_reset a convenience
        macro.
      * strbuf_detatch takes a size_t* optional argument (meaning it can be
        NULL) to copy the buffer's len, as it was needed for this refactor to
        make the code more readable, and working like the callers.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 26, 2007
  1. Don't use "<unknown>" for placeholders and suppress printing of empty…

    Michal Vitecek committed with Sep 25, 2007
    … user formats.
    
    This changes the interporate() to replace entries with NULL values
    by the empty string, and uses it to interpolate missing fields in
    custom format output used in git-log and friends.  It is most useful
    to avoid <unknown> output from %b format for a commit log message
    that lack any body text.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 21, 2007
  1. strbuf API additions and enhancements.

    Pierre Habouzit committed with Sep 20, 2007
    Add strbuf_remove, change strbuf_insert:
      As both are special cases of strbuf_splice, implement them as such.
      gcc is able to do the math and generate almost optimal code this way.
    
    Add strbuf_swap:
      Exchange the values of its arguments.
      Use it in fast-import.c
    
    Also fix spacing issues in strbuf.h
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Commits on Sep 19, 2007
  1. Use xmemdupz() in many places.

    Pierre Habouzit committed with Sep 16, 2007
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 17, 2007
  1. Remove preemptive allocations.

    Pierre Habouzit committed with Sep 16, 2007
    Careful profiling shows that we spend more time guessing what pattern
    allocation will have, whereas we can delay it only at the point where
    add_rfc2047 will be used and don't allocate huge memory area for the many
    cases where it's not.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Refactor replace_encoding_header.

    Pierre Habouzit committed with Sep 15, 2007
    * Be more clever in how we search for "encoding ...\n": parse for real
      instead of the sloppy strstr's.
    * use strbuf_splice to do the substring replacements.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 10, 2007
  1. Rework pretty_print_commit to use strbufs instead of custom buffers.

    Pierre Habouzit committed with Sep 10, 2007
      Also remove the "len" parameter, as:
      (1) it was used as a max boundary, and every caller used ~0u
      (2) we check for final NUL no matter what, so it doesn't help for speed.
    
      As a result most of the pp_* function takes 3 arguments less, and we need
    a lot less local variables, this makes the code way more readable, and
    easier to extend if needed.
    
      This patch also fixes some spacing and cosmetic issues.
    
      This patch also fixes (as a side effect) a memory leak intoruced in
    builtin-archive.c at commit df4a394 (fmt was xmalloc'ed and not free'd)
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Change semantics of interpolate to work like snprintf.

    Pierre Habouzit committed with Sep 10, 2007
      Also fix many off-by-ones and a useless memset.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 3, 2007
  1. Export format_commit_message()

    Ren,bi(B Scharfe committed with Sep 3, 2007
    Drop the parameter "msg" of format_commit_message() (as it can be
    inferred from the parameter "commit"), add a parameter "template"
    in order to avoid accessing the static variable user_format
    directly and export the result.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 22, 2007
  1. @mcostalba

    Avoid to duplicate commit message when is not encoded

    mcostalba committed with Jul 22, 2007
    When a commit message doesn't have encoding information
    and encoding output is utf-8 (default) then an useless
    xstrdup() of commit message is done.
    
    If we assume most of users live in an utf-8 world, this
    useless copy is the common case.
    
    Performance issue found with KCachegrind.
    
    Signed-off-by: Marco Costalba <mcostalba@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 14, 2007
  1. Make show_rfc2822_date() just another date output format.

    committed Jul 13, 2007
    These days, show_date() takes a date_mode parameter to specify
    the output format, and a separate specialized function for dates
    in E-mails does not make much sense anymore.
    
    This retires show_rfc2822_date() function and make it just
    another date output format.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @robinrosenberg

    Support output ISO 8601 format dates

    robinrosenberg committed with Jul 14, 2007
    Support output of full ISO 8601 style dates in e.g. git log
    and other places that use interpolation for formatting.
    
    Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 23, 2007
  1. Merge branch 'jc/oneline'

    committed Jun 22, 2007
    * jc/oneline:
      pp_header(): work around possible memory corruption
  2. Merge branch 'ei/oneline+add-empty'

    committed Jun 22, 2007
    * ei/oneline+add-empty:
      Fix ALLOC_GROW calls with obsolete semantics
      Fix ALLOC_GROW off-by-one
      builtin-add: simplify (and increase accuracy of) exclude handling
      dir_struct: add collect_ignored option
      Extend --pretty=oneline to cover the first paragraph,
      Lift 16kB limit of log message output
Commits on Jun 17, 2007
  1. @dscho

    pp_header(): work around possible memory corruption

    dscho committed with Jun 15, 2007
    add_user_info() possibly adds way more than just the commit header line.
    In fact, it sometimes needs so much more space that there is a buffer
    overrun, leading to an ugly crash. For example, the date is printed in its
    own line, and usually takes up more space than the equivalent Unix epoch.
    
    So, for good measure, add 80 characters (a full line) to the allocated
    space, in addition to the header line length.
    
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 13, 2007
  1. More static

    committed Jun 13, 2007
    There still are quite a few symbols that ought to be static.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Extend --pretty=oneline to cover the first paragraph,

    committed Jun 11, 2007
    so that an ugly commit message like this can be
    handled sanely.
    
    Currently, --pretty=oneline and --pretty=email (hence
    format-patch) take and use only the first line of the commit log
    message.  This changes them to:
    
     - Take the first paragraph, where the definition of the first
       paragraph is "skip all blank lines from the beginning, and
       then grab everything up to the next empty line".
    
     - Replace all line breaks with a whitespace.
    
    This change would not affect a well-behaved commit message that
    adheres to the convention of "single line summary, a blank line,
    and then body of message", as its first paragraph always
    consists of a single line.  Commit messages from different
    culture, such as the ones imported from CVS/SVN, can however get
    chomped with the existing behaviour at the first linebreak in
    the middle of sentence right now, which would become much easier
    to see with this change.
    
    The Subject: and --pretty=oneline output would become very long
    and unsightly for non-conforming commits, but their messages are
    already ugly anyway, and thischange at least avoids the loss of
    information.
    
    The Subject: line from a multi-line paragraph is folded using
    RFC2822 line folding rules at the places where line breaks were
    in the original.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. Lift 16kB limit of log message output

    committed Jun 11, 2007
    Traditionally we had 16kB limit when formatting log messages for
    output, because it was easier to arrange for the caller to have
    a reasonably big buffer and pass it down without ever worrying
    about reallocating.
    
    This changes the calling convention of pretty_print_commit() to
    lift this limit.  Instead of the buffer and remaining length, it
    now takes a pointer to the pointer that points at the allocated
    buffer, and another pointer to the location that stores the
    allocated length, and reallocates the buffer as necessary.
    
    To support the user format, the error return of interpolate()
    needed to be changed.  It used to return a bool telling "Ok the
    result fits", or "Sorry, I had to truncate it".  Now it returns
    0 on success, and returns the size of the buffer it wants in
    order to fit the whole result.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 8, 2007
  1. Even more missing static

    committed Jun 8, 2007
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 7, 2007
  1. War on whitespace

    committed Jun 7, 2007
    This uses "git-apply --whitespace=strip" to fix whitespace errors that have
    crept in to our source files over time.  There are a few files that need
    to have trailing whitespaces (most notably, test vectors).  The results
    still passes the test, and build result in Documentation/ area is unchanged.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 2, 2007
  1. @krh

    Use =20 when rfc2047 encoding spaces.

    krh committed with Junio C Hamano Jun 1, 2007
    Encode ' ' using '=20' even though rfc2047 allows using '_' for
    readability.  Unfortunately, many programs do not understand this and
    just leave the underscore in place.  Using '=20' seems to work better.
    
    [jc: with adjustment to t3901]
    
    Signed-off-by: Kristian Høgsberg <hoegsberg@gmail.com>
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Something went wrong with that request. Please try again.