Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Mar 18, 2014
  1. @gitster

    Merge branch 'jk/diff-filespec-cleanup'

    gitster committed
    Portability fix to a topic already in v1.9
    * jk/diff-filespec-cleanup:
      diffcore.h: be explicit about the signedness of is_binary
Commits on Mar 5, 2014
  1. @gitster

    Merge branch 'ks/combine-diff'

    gitster committed
    Teach combine-diff to honour the path-output-order imposed by
    diffcore-order, and optimize how matching paths are found in
    the N-way diffs made with parents.
    * ks/combine-diff:
      tests: add checking that combine-diff emits only correct paths
      combine-diff: simplify intersect_paths() further
      combine-diff: combine_diff_path.len is not needed anymore
      combine-diff: optimize combine_diff_path sets intersection
      diff test: add tests for combine-diff with orderfile
      diffcore-order: export generic ordering interface
Commits on Feb 27, 2014
  1. @gitster

    Merge branch 'nd/diff-quiet-stat-dirty'

    gitster committed
    "git diff --quiet -- pathspec1 pathspec2" sometimes did not return
    correct status value.
    * nd/diff-quiet-stat-dirty:
      diff: do not quit early on stat-dirty files
      diff.c: move diffcore_skip_stat_unmatch core logic out for reuse later
Commits on Aug 27, 2012
  1. @gitster

    Merge branch 'jk/maint-null-in-trees'

    gitster committed
    We do not want a link to 0{40} object stored anywhere in our objects.
    * jk/maint-null-in-trees:
      fsck: detect null sha1 in tree entries
      do not write null sha1s to on-disk index
      diff: do not use null sha1 as a sentinel value
Commits on Jul 13, 2012
  1. @gitster

    Merge branch 'jc/refactor-diff-stdin'

    gitster committed
    Due to the way "git diff --no-index" is bolted onto by touching the
    low level code that is shared with the rest of the "git diff" code,
    even though it has to work in a very different way, any comparison
    that involves a file "-" at the root level incorrectly tried to read
    from the standard input.  This cleans up the no-index codepath
    further to remove code that reads from the standard input from the
    core side, which is never necessary when git is running its usual
    diff operation.
    * jc/refactor-diff-stdin:
      diff-index.c: "git diff" has no need to read blob from the standard input
      diff-index.c: unify handling of command line paths
      diff-index.c: do not pretend paths are pathspecs
Commits on Jun 28, 2012
  1. @gitster

    diff-index.c: "git diff" has no need to read blob from the standard i…

    gitster committed
    Only "diff --no-index -" does.  Bolting the logic into the low-level
    function diff_populate_filespec() was a layering violation from day
    one.  Move populate_from_stdin() function out of the generic diff.c
    to its only user, diff-index.c.
    Also make sure "-" from the command line stays a special token "read
    from the standard input", even if we later decide to sanitize the
    result from prefix_filename() function in a few obvious ways,
    e.g. removing unnecessary "./" prefix, duplicated slashes "//" in
    the middle, etc.
    Signed-off-by: Junio C Hamano <>
Commits on Aug 21, 2011
  1. @gitster

    combine-diff: support format_callback

    gitster committed
    This teaches combine-diff machinery to feed a combined merge to a callback
    function when DIFF_FORMAT_CALLBACK is specified.
    So far, format callback functions are not used for anything but 2-way
    diffs. A callback is given a diff_queue_struct, which is an array of
    diff_filepair. As its name suggests, a diff_filepair is a _pair_ of
    diff_filespec that represents a single preimage and a single postimage.
    Since "diff -c" is to compare N parents with a single merge result and
    filter out any paths whose result match one (or more) of the parent(s),
    its output has to be able to represent N preimages and 1 postimage. For
    this reason, a callback function that inspects a diff_filepair that
    results from this new infrastructure can and is expected to view the
    preimage side (i.e. pair->one) as an array of diff_filespec. Each element
    in the array, except for the last one, is marked with "has_more_entries"
    bit, so that the same callback function can be used for 2-way diffs and
    combined diffs.
    Signed-off-by: Junio C Hamano <>
Commits on Aug 31, 2010
  1. @gitster

    diff: pass the entire diff-options to diffcore_pickaxe()

    gitster committed
    That would make it easier to give enhanced feature to the
    pickaxe transformation.
    Signed-off-by: Junio C Hamano <>
Commits on Aug 13, 2010
  1. @gitster

    diff --follow: do call diffcore_std() as necessary

    gitster committed
    Usually, diff frontends populate the output queue with filepairs without
    any rename information and call diffcore_std() to sort the renames out.
    When --follow is in effect, however, diff-tree family of frontend has a
    hack that looks like this:
        diff-tree frontend
        -> diff_tree_sha1()
           . populate diff_queued_diff
           . if --follow is in effect and there is only one change that
             creates the target path, then
           -> try_to_follow_renames()
    	  -> diff_tree_sha1() with no pathspec but with -C
    	  -> diffcore_std() to find renames
    	  . if rename is found, tweak diff_queued_diff and put a
    	    single filepair that records the found rename there
        -> diffcore_std()
           . tweak elements on diff_queued_diff by
           - rename detection
           - path ordering
           - pickaxe filtering
    We need to skip parts of the second call to diffcore_std() that is related
    to rename detection, and do so only when try_to_follow_renames() did find
    a rename.  Earlier 1da6175 (Make diffcore_std only can run once before a
    diff_flush, 2010-05-06) tried to deal with this issue incorrectly; it
    unconditionally disabled any second call to diffcore_std().
    This hopefully fixes the breakage.
    Signed-off-by: Junio C Hamano <>
Commits on Nov 3, 2008
  1. @gitster

    Merge branch 'maint'

    gitster committed
    * maint:
      Add reference for status letters in documentation.
      Document that git-log takes --all-match.
      Update draft release notes
Commits on Oct 3, 2007
  1. @gitster

    rename diff_free_filespec_data_large() to diff_free_filespec_blob()

    gitster committed
    Signed-off-by: Junio C Hamano <>
Commits on Jul 7, 2007
  1. @gitster

    Fix configuration syntax to specify customized hunk header patterns.

    gitster committed
    This updates the hunk header customization syntax.  The special
    case 'funcname' attribute is gone.
    You assign the name of the type of contents to path's "diff"
    attribute as a string value in .gitattributes like this:
    	*.java diff=java
    	*.perl diff=perl
    	*.doc diff=doc
    If you supply "diff.<name>.funcname" variable via the
    configuration mechanism (e.g. in $HOME/.gitconfig), the value is
    used as the regexp set to find the line to use for the hunk
    header (the variable is called "funcname" because such a line
    typically is the one that has the name of the function in
    programming language source text).
    If there is no such configuration, built-in default is used, if
    any.  Currently there are two default patterns: default and java.
    Signed-off-by: Junio C Hamano <>
Commits on Jul 6, 2007
  1. @gitster

    Per-path attribute based hunk header selection.

    gitster committed
    This makes"diff -p" hunk headers customizable via gitattributes mechanism.
    It is based on Johannes's earlier patch that allowed to define a single
    regexp to be used for everything.
    The mechanism to arrive at the regexp that is used to define hunk header
    is the same as other use of gitattributes.  You assign an attribute, funcname
    (because "diff -p" typically uses the name of the function the patch is about
    as the hunk header), a simple string value.  This can be one of the names of
    built-in pattern (currently, "java" is defined) or a custom pattern name, to
    be looked up from the configuration file.
      (in .gitattributes)
      *.java   funcname=java
      *.perl   funcname=perl
      (in .git/config)
        java = ... # ugly and complicated regexp to override the built-in one.
        perl = ... # another ugly and complicated regexp to define a new one.
    Signed-off-by: Junio C Hamano <>
  2. @gitster

    Introduce diff_filespec_is_binary()

    gitster committed
    This replaces an explicit initialization of filespec->is_binary
    field used for rename/break followed by direct access to that
    field with a wrapper function that lazily iniaitlizes and
    accesses the field.  We would add more attribute accesses for
    the use of diff routines, and it would be better to make this
    abstraction earlier.
    Signed-off-by: Junio C Hamano <>
Commits on Jul 1, 2007
  1. @gitster

    diffcore_filespec: add is_binary

    gitster committed
    diffcore-break and diffcore-rename would want to behave slightly
    differently depending on the binary-ness of the data, so add one
    bit to the filespec, as the structure is now passed down to
    diffcore_count_changes() function.
    Signed-off-by: Junio C Hamano <>
  2. @gitster

    diffcore_count_changes: pass diffcore_filespec

    gitster committed
    We may want to use richer information on the data we are dealing
    with in this function, so instead of passing a buffer address
    and length, just pass the diffcore_filespec structure.  Existing
    callers always call this function with parameters taken from a
    filespec anyway, so there is no functionality changes.
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.