Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jun 25, 2015
  1. @gitster

    Merge branch 'nd/diff-i-t-a'

    gitster authored
    * nd/diff-i-t-a:
      Revert "diff-lib.c: adjust position of i-t-a entries in diff"
Commits on Jun 23, 2015
  1. @gitster

    Revert "diff-lib.c: adjust position of i-t-a entries in diff"

    gitster authored
    This reverts commit d95d728.
    
    It turns out that many other commands that need to interact with the
    result of running diff-files and diff-index, e.g.  "git apply", "git
    rm", etc., need to be adjusted to the new world order it brings in.
    For example, it would break this sequence to correct a whitespace
    breakage in the parts you changed:
    
    	git add -N file
    	git diff --cached file | git apply --cached --whitespace=fix
    	git checkout file
    
    In the old world order, "diff" showed a patch to modify an existing
    empty file by adding its full contents, and "apply" updated the
    index by modifying the existing empty blob (which is what an
    Intent-to-Add entry records in the index) with that patch.
    
    In the new world order, "diff" shows a patch to create a new file
    with its full contents, but because "apply" thinks that the i-t-a
    entry already exists in the index, it refused to accept a creation.
    
    Adjusting "apply" to this new world order is easy, but we need to
    assess the extent of the damage to the rest of the system the new
    world order brought in before going forward and adjust them all,
    after which we can resurrect the commit being reverted here.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 19, 2015
  1. @gitster

    Merge branch 'nd/diff-i-t-a'

    gitster authored
    After "git add -N", the path appeared in output of "git diff HEAD"
    and "git diff --cached HEAD", leading "git status" to classify it
    as "Changes to be committed".  Such a path, however, is not yet to
    be scheduled to be committed.  "git diff" showed the change to the
    path as modification, not as a "new file", in the header of its
    output.
    
    Treat such paths as "yet to be added to the index but Git already
    know about them"; "git diff HEAD" and "git diff --cached HEAD"
    should not talk about them, and "git diff" should show them as new
    files yet to be added to the index.
    
    * nd/diff-i-t-a:
      diff-lib.c: adjust position of i-t-a entries in diff
Commits on May 6, 2015
  1. @gitster

    Merge branch 'bc/object-id'

    gitster authored
    Identify parts of the code that knows that we use SHA-1 hash to
    name our objects too much, and use (1) symbolic constants instead
    of hardcoded 20 as byte count and/or (2) use struct object_id
    instead of unsigned char [20] for object names.
    
    * bc/object-id:
      apply: convert threeway_stage to object_id
      patch-id: convert to use struct object_id
      commit: convert parts to struct object_id
      diff: convert struct combine_diff_path to object_id
      bulk-checkin.c: convert to use struct object_id
      zip: use GIT_SHA1_HEXSZ for trailers
      archive.c: convert to use struct object_id
      bisect.c: convert leaf functions to use struct object_id
      define utility functions for object IDs
      define a structure for object IDs
Commits on Feb 4, 2015
  1. @gitster

    run_diff_files(): clarify computation of sha1 validity

    gitster authored
    Remove the need to have duplicated "if there is a change then feed
    null_sha1 and otherwise sha1 from the cache entry" for the "new"
    side of the diff by introducing two temporary variables to point
    at the object name of the old and the new side of the blobs.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 16, 2014
  1. @gitster

    Merge branch 'jk/diff-files-assume-unchanged'

    gitster authored
    * jk/diff-files-assume-unchanged:
      run_diff_files: do not look at uninitialized stat data
Commits on Mar 7, 2014
  1. @gitster

    Merge branch 'jc/hold-diff-remove-q-synonym-for-no-deletion'

    gitster authored
    Remove a confusing and deprecated "-q" option from "git diff-files";
    "git diff-files --diff-filter=d" can be used instead.
Commits on Mar 5, 2014
  1. @gitster

    Merge branch 'ks/combine-diff'

    gitster authored
    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 Sep 9, 2013
  1. @gitster

    Merge branch 'jl/submodule-mv'

    gitster authored
    "git mv A B" when moving a submodule A does "the right thing",
    inclusing relocating its working tree and adjusting the paths in
    the .gitmodules file.
    
    * jl/submodule-mv: (53 commits)
      rm: delete .gitmodules entry of submodules removed from the work tree
      mv: update the path entry in .gitmodules for moved submodules
      submodule.c: add .gitmodules staging helper functions
      mv: move submodules using a gitfile
      mv: move submodules together with their work trees
      rm: do not set a variable twice without intermediate reading.
      t6131 - skip tests if on case-insensitive file system
      parse_pathspec: accept :(icase)path syntax
      pathspec: support :(glob) syntax
      pathspec: make --literal-pathspecs disable pathspec magic
      pathspec: support :(literal) syntax for noglob pathspec
      kill limit_pathspec_to_literal() as it's only used by parse_pathspec()
      parse_pathspec: preserve prefix length via PATHSPEC_PREFIX_ORIGIN
      parse_pathspec: make sure the prefix part is wildcard-free
      rename field "raw" to "_raw" in struct pathspec
      tree-diff: remove the use of pathspec's raw[] in follow-rename codepath
      remove match_pathspec() in favor of match_pathspec_depth()
      remove init_pathspec() in favor of parse_pathspec()
      remove diff_tree_{setup,release}_paths
      convert common_prefix() to use struct pathspec
      ...
  2. @gitster

    Merge branch 'jc/diff-filter-negation'

    gitster authored
    Teach "git diff --diff-filter" to express "I do not want to see
    these classes of changes" more directly by listing only the
    unwanted ones in lowercase (e.g. "--diff-filter=d" will show
    everything but deletion) and deprecate "diff-files -q" which did
    the same thing as "--diff-filter=d".
    
    * jc/diff-filter-negation:
      diff: deprecate -q option to diff-files
      diff: allow lowercase letter to specify what change class to exclude
      diff: reject unknown change class given to --diff-filter
      diff: preparse --diff-filter string argument
      diff: factor out match_filter()
      diff: pass the whole diff_options to diffcore_apply_filter()
Commits on Jul 19, 2013
  1. @gitster

    diff: remove "diff-files -q" in a version of Git in a distant future

    gitster authored
    This was inherited from "show-diff -q" that was invented to tell
    comparison between the index and the working tree to ignore only
    removals in 2005.
    
    These days, it is spelled as "--diff-filter=d".
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    diff: deprecate -q option to diff-files

    gitster authored
    This reimplements the ancient "-q" option to "git diff-files" that
    was inherited from "show-diff -q" in terms of "--diff-filter=d".  We
    will be deprecating the "-q" option, so let's issue a warning when
    we do so.
    
    Incidentally this also tentatively fixes "git diff --no-index" to
    honor "-q" and hide deletions; the use will get the same warning.
    
    We should remove the support for "-q" in a future version but it is
    not that urgent.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 5, 2011
  1. @gitster

    Merge branch 'cn/eradicate-working-copy'

    gitster authored
    * cn/eradicate-working-copy:
      Remove 'working copy' from the documentation and C code
  2. @gitster

    Merge branch 'jc/diff-index-unpack'

    gitster authored
    * jc/diff-index-unpack:
      diff-index: pass pathspec down to unpack-trees machinery
      unpack-trees: allow pruning with pathspec
      traverse_trees(): allow pruning with pathspec
Commits on Aug 29, 2011
  1. @gitster

    diff-index: pass pathspec down to unpack-trees machinery

    gitster authored
    And finally, pass the pathspec down through unpack_trees() to traverse_trees()
    callchain.
    
    Before and after applying this series, looking for changes in the kernel
    repository with a fairly narrow pathspec becomes somewhat faster.
    
      (without patch)
      $ /usr/bin/time git diff --raw v2.6.27 -- net/ipv6 >/dev/null
      0.48user 0.05system 0:00.53elapsed 100%CPU (0avgtext+0avgdata 163296maxresident)k
      0inputs+952outputs (0major+11163minor)pagefaults 0swaps
    
      (with patch)
      $ /usr/bin/time git diff --raw v2.6.27 -- net/ipv6 >/dev/null
      0.01user 0.00system 0:00.02elapsed 104%CPU (0avgtext+0avgdata 43856maxresident)k
      0inputs+24outputs (0major+3688minor)pagefaults 0swaps
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 8, 2011
  1. @gitster

    Merge branch 'jc/diff-index-refactor'

    gitster authored
    * jc/diff-index-refactor:
      diff-lib: refactor run_diff_index() and do_diff_cache()
      diff-lib: simplify do_diff_cache()
Commits on Aug 1, 2011
  1. @gitster

    Merge branch 'jc/maint-reset-unmerged-path'

    gitster authored
    * jc/maint-reset-unmerged-path:
      reset [<commit>] paths...: do not mishandle unmerged paths
Commits on Jul 14, 2011
  1. @gitster

    diff-lib: refactor run_diff_index() and do_diff_cache()

    gitster authored
    The latter is meant to be an API for internal callers that want to inspect
    the resulting diff-queue, while the former is an implementation of "git
    diff-index" command. Extract the common logic into a single helper
    function and make them thin wrappers around it.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    diff-lib: simplify do_diff_cache()

    gitster authored
    Since 34110cd (Make 'unpack_trees()' have a separate source and
    destination index, 2008-03-06), we can run unpack_trees() without munging
    the index at all, but do_diff_cache() tried ever so carefully to work
    around the old behaviour of the function.
    
    We can just tell unpack_trees() not to touch the original index and there
    is no need to clean-up whatever the previous round has done.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @gitster

    reset [<commit>] paths...: do not mishandle unmerged paths

    gitster authored
    Because "diff --cached HEAD" showed an incorrect blob object name on the
    LHS of the diff, we ended up updating the index entry with bogus value,
    not what we read from the tree.
    
    Noticed by John Nowak.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 6, 2011
  1. @gitster

    Merge branch 'jk/diff-not-so-quick'

    gitster authored
    * jk/diff-not-so-quick:
      diff: futureproof "stop feeding the backend early" logic
      diff_tree: disable QUICK optimization with diff filter
    
    Conflicts:
    	diff.c
Commits on May 31, 2011
  1. @gitster

    diff-index --quiet: learn the "stop feeding the backend early" logic

    gitster authored
    A negative return from the unpack callback function usually means unpack
    failed for the entry and signals the unpack_trees() machinery to fail the
    entire merge operation, immediately and there is no other way for the
    callback to tell the machinery to exit early without reporting an error.
    
    This is what we usually want to make a merge all-or-nothing operation, but
    the machinery is also used for diff-index codepath by using a custom
    unpack callback function. And we do sometimes want to exit early without
    failing, namely when we are under --quiet and can short-cut the diff upon
    finding the first difference.
    
    Add "exiting_early" field to unpack_trees_options structure, to signal the
    unpack_trees() machinery that the negative return value is not signaling
    an error but an early return from the unpack_trees() machinery. As this by
    definition hasn't unpacked everything, discard the resulting index just
    like the failure codepath.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    Merge remote-tracking branch 'ko/maint' into jc/diff-index-quick-exit…

    gitster authored
    …-early
    
    * ko/maint: (4352 commits)
      git-submodule.sh: separate parens by a space to avoid confusing some shells
      Documentation/technical/api-diff.txt: correct name of diff_unmerge()
      read_gitfile_gently: use ssize_t to hold read result
      remove tests of always-false condition
      rerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'
      Git 1.7.5.3
      init/clone: remove short option -L and document --separate-git-dir
      do not read beyond end of malloc'd buffer
      git-svn: Fix git svn log --show-commit
      Git 1.7.5.2
      provide a copy of the LGPLv2.1
      test core.gitproxy configuration
      copy_gecos: fix not adding nlen to len when processing "&"
      Update draft release notes to 1.7.5.2
      Documentation/git-fsck.txt: fix typo: unreadable -> unreachable
      send-pack: avoid deadlock on git:// push with failed pack-objects
      connect: let callers know if connection is a socket
      connect: treat generic proxy processes like ssh processes
      sideband_demux(): fix decl-after-stmt
      t3503: test cherry picking and reverting root commits
      ...
    
    Conflicts:
    	diff.c
  3. @gitster

    diff: futureproof "stop feeding the backend early" logic

    gitster authored
    Refactor the "do not stop feeding the backend early" logic into a small
    helper function and use it in both run_diff_files() and diff_tree() that
    has the stop-early optimization. We may later add other types of diffcore
    transformation that require to look at the whole result like diff-filter
    does, and having the logic in a single place is essential for longer term
    maintainability.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 13, 2011
  1. @gitster

    Merge branch 'jc/fix-diff-files-unmerged' into maint

    gitster authored
    * jc/fix-diff-files-unmerged:
      diff-files: show unmerged entries correctly
      diff: remove often unused parameters from diff_unmerge()
      diff.c: return filepair from diff_unmerge()
      test: use $_z40 from test-lib
Commits on May 6, 2011
  1. @gitster

    Merge branch 'jc/fix-diff-files-unmerged'

    gitster authored
    * jc/fix-diff-files-unmerged:
      diff-files: show unmerged entries correctly
      diff: remove often unused parameters from diff_unmerge()
      diff.c: return filepair from diff_unmerge()
      test: use $_z40 from test-lib
Commits on Apr 24, 2011
  1. @gitster

    diff-files: show unmerged entries correctly

    gitster authored
    Earlier, e9c8409 (diff-index --cached --raw: show tree entry on the LHS
    for unmerged entries., 2007-01-05) taught the command to show the object
    name and the mode from the entry coming from the tree side when comparing
    a tree with an unmerged index.
    
    This is a belated companion patch that teaches diff-files to show the mode
    from the entry coming from the working tree side, when comparing an
    unmerged index and the working tree.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    diff: remove often unused parameters from diff_unmerge()

    gitster authored
    e9c8409 (diff-index --cached --raw: show tree entry on the LHS for
    unmerged entries., 2007-01-05) added a <mode, object name> pair as
    parameters to this function, to store them in the pre-image side of an
    unmerged file pair.  Now the function is fixed to return the filepair it
    queued, we can make the caller on the special case codepath to do so.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 23, 2011
  1. @gitster

    Merge branch 'jc/maint-diff-q-filter'

    gitster authored
    * jc/maint-diff-q-filter:
      diff --quiet: disable optimization when --diff-filter=X is used
Commits on Mar 16, 2011
  1. @gitster

    diff --quiet: disable optimization when --diff-filter=X is used

    gitster authored
    The code notices that the caller does not want any detail of the changes
    and only wants to know if there is a change or not by specifying --quiet.
    And it breaks out of the loop when it knows it already found any change.
    
    When you have a post-process filter (e.g. --diff-filter), however, the
    path we found to be different in the previous round and set HAS_CHANGES
    bit may end up being uninteresting, and there may be no output at the end.
    The optimization needs to be disabled for such case.
    
    Note that the f245194 (diff: change semantics of "ignore whitespace"
    options, 2009-05-22) already disables this optimization by refraining
    from setting HAS_CHANGES when post-process filters that need to inspect
    the contents of the files (e.g. -S, -w) in diff_change() function.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 24, 2010
  1. @gitster

    Merge branch 'jl/submodule-diff-dirtiness'

    gitster authored
    * jl/submodule-diff-dirtiness:
      git status: ignoring untracked files must apply to submodules too
      git status: Fix false positive "new commits" output for dirty submodules
      Refactor dirty submodule detection in diff-lib.c
      git status: Show detailed dirty status of submodules in long format
      git diff --submodule: Show detailed dirty status of submodules
Commits on Mar 9, 2010
  1. @gitster

    revision: introduce setup_revision_opt

    gitster authored
    So far the last parameter to setup_revisions() was to specify the default
    ref when the command line did not give any (typically "HEAD").  This changes
    it to take a pointer to a structure so that we can add other information without
    touching too many codepaths in later patches.
    
    There is no functionality change.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 27, 2010
  1. @gitster

    Merge branch 'jl/diff-submodule-ignore'

    gitster authored
    * jl/diff-submodule-ignore:
      Teach diff --submodule that modified submodule directory is dirty
      git diff: Don't test submodule dirtiness with --ignore-submodules
      Make ce_uptodate() trustworthy again
Commits on Jan 25, 2010
  1. @gitster

    Merge branch 'jc/fix-tree-walk'

    gitster authored
    * jc/fix-tree-walk:
      read-tree --debug-unpack
      unpack-trees.c: look ahead in the index
      unpack-trees.c: prepare for looking ahead in the index
      Aggressive three-way merge: fix D/F case
      traverse_trees(): handle D/F conflict case sanely
      more D/F conflict tests
      tests: move convenience regexp to match object names to test-lib.sh
    
    Conflicts:
    	builtin-read-tree.c
    	unpack-trees.c
    	unpack-trees.h
Commits on Jan 24, 2010
  1. @gitster

    Make ce_uptodate() trustworthy again

    gitster authored
    The rule has always been that a cache entry that is ce_uptodate(ce)
    means that we already have checked the work tree entity and we know
    there is no change in the work tree compared to the index, and nobody
    should have to double check.  Note that false ce_uptodate(ce) does not
    mean it is known to be dirty---it only means we don't know if it is
    clean.
    
    There are a few codepaths (refresh-index and preload-index are among
    them) that mark a cache entry as up-to-date based solely on the return
    value from ie_match_stat(); this function uses lstat() to see if the
    work tree entity has been touched, and for a submodule entry, if its
    HEAD points at the same commit as the commit recorded in the index of
    the superproject (a submodule that is not even cloned is considered
    clean).
    
    A submodule is no longer considered unmodified merely because its HEAD
    matches the index of the superproject these days, in order to prevent
    people from forgetting to commit in the submodule and updating the
    superproject index with the new submodule commit, before commiting the
    state in the superproject.  However, the patch to do so didn't update
    the codepath that marks cache entries up-to-date based on the updated
    definition and instead worked it around by saying "we don't trust the
    return value of ce_uptodate() for submodules."
    
    This makes ce_uptodate() trustworthy again by not marking submodule
    entries up-to-date.
    
    The next step _could_ be to introduce a few "in-core" flag bits to
    cache_entry structure to record "this entry is _known_ to be dirty",
    call is_submodule_modified() from ie_match_stat(), and use these new
    bits to avoid running this rather expensive check more than once, but
    that can be a separate patch.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.