This project is mirrored from https://github.com/git/git. Pull mirroring updated .
  1. 20 Aug, 2014 1 commit
    • Jeff King's avatar
      intersect_paths: respect mode in git's tree-sort · e09867f0
      Jeff King authored
      When we do a combined diff, we individually diff against
      each parent, and then use intersect_paths to do a parallel
      walk through the sorted results and come up with a final
      list of interesting paths.
      
      The sort order here is that returned by the diffs, which
      means it is in git's tree-order which sorts sub-trees as if
      their paths have "/" at the end. When we do our parallel
      walk, we need to use a comparison function which provides
      the same order.
      
      Since 8518ff8f (combine-diff: optimize combine_diff_path sets
      intersection, 2014-01-20), we use a simple strcmp to
      compare the pathnames, and get this wrong. It's somewhat
      hard to trigger because normally a diff does not produce
      tree entries at all, and therefore the sort order is the
      same as a strcmp. However, if the "-t" option is used with
      the diff, then we will produce diff_filepairs for both trees
      and files.
      
      We can use base_name_compare to do the comparison, just as
      the tree-diff code does. Even though what we have are not
      technically base names (they are full paths within the
      tree), the end result is the same (we do not care about
      interior slashes at all, only about the final character).
      
      However, since we do not have the length of each path
      stored, we take a slight shortcut: if neither of the entries
      is a sub-tree then the comparison is equivalent to a strcmp.
      This lets us skip the extra strlen calls in the common case
      without having to reimplement base_name_compare from
      scratch.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      e09867f0
  2. 24 Feb, 2014 7 commits
    • Kirill Smelkov's avatar
      tests: add checking that combine-diff emits only correct paths · fce135c4
      Kirill Smelkov authored
      where "correct paths" stands for paths that are different to all
      parents.
      
      Up until now, we were testing combined diff only on one file, or on
      several files which were all different (t4038-diff-combined.sh).
      
      As recent thinko in "simplify intersect_paths() further" showed, and
      also, since we are going to rework code for finding paths different to
      all parents, lets write at least basic tests.
      Signed-off-by: default avatarKirill Smelkov <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      fce135c4
    • Junio C Hamano's avatar
      combine-diff: simplify intersect_paths() further · 7b1004b0
      Junio C Hamano authored
      Linus once said:
      
          I actually wish more people understood the really core low-level
          kind of coding. Not big, complex stuff like the lockless name
          lookup, but simply good use of pointers-to-pointers etc. For
          example, I've seen too many people who delete a singly-linked
          list entry by keeping track of the "prev" entry, and then to
          delete the entry, doing something like
      
      	if (prev)
      	    prev->next = entry->next;
      	else
      	    list_head = entry->next;
      
          and whenever I see code like that, I just go "This person
          doesn't understand pointers". And it's sadly quite common.
      
          People who understand pointers just use a "pointer to the entry
          pointer", and initialize that with the address of the
          list_head. And then as they traverse the list, they can remove
          the entry without using any conditionals, by just doing a "*pp =
          entry->next".
      
      Applying that simplification lets us lose 7 lines from this function
      even while adding 2 lines of comment.
      
      I was tempted to squash this into the original commit, but because
      the benchmarking described in the commit log is without this
      simplification, I decided to keep it a separate follow-up patch.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      7b1004b0
    • Kirill Smelkov's avatar
      combine-diff: combine_diff_path.len is not needed anymore · af82c788
      Kirill Smelkov authored
      The field was used in order to speed-up name comparison and also to
      mark removed paths by setting it to 0.
      
      Because the updated code does significantly less strcmp and also
      just removes paths from the list and free right after we know a path
      will not be needed, it is not needed anymore.
      Signed-off-by: default avatarKirill Smelkov <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      af82c788
    • Kirill Smelkov's avatar
      combine-diff: optimize combine_diff_path sets intersection · 8518ff8f
      Kirill Smelkov authored
      When generating combined diff, for each commit, we intersect diff
      paths from diff(parent_0,commit) to diff(parent_i,commit) comparing
      all paths pairs, i.e. doing it the quadratic way. That is correct,
      but could be optimized.
      
      Paths come from trees in sorted (= tree) order, and so does diff_tree()
      emits resulting paths in that order too. Now if we look at diffcore
      transformations, all of them, except diffcore_order, preserve resulting
      path ordering:
      
          - skip_stat_unmatch, grep, pickaxe, filter
                                  -- just skip elements -> order stays preserved
      
          - break                 -- just breaks diff for a path, adding path
                                     dup after the path -> order stays preserved
      
          - detect rename/copy    -- resulting paths are emitted sorted
                                     (verified empirically)
      
      So only diffcore_order changes diff paths ordering.
      
      But diffcore_order meaning affects only presentation - i.e. only how to
      show the diff, so we could do all the internal computations without
      paths reordering, and order only resultant paths set. This is faster,
      since, if we know two paths sets are all ordered, their intersection
      could be done in linear time.
      
      This patch does just that.
      
      Timings for `git log --raw --no-abbrev --no-renames` without `-c` ("git log")
      and with `-c` ("git log -c") before and after the patch are as follows:
      
                      linux.git v3.10..v3.11
      
                  log     log -c
      
          before  1.9s    20.4s
          after   1.9s    16.6s
      
                      navy.git    (private repo)
      
                  log     log -c
      
          before  0.83s   15.6s
          after   0.83s    2.1s
      
      P.S.
      
      I think linux.git case is sped up not so much as the second one, since
      in navy.git, there are more exotic (subtree, etc) merges.
      
      P.P.S.
      
      My tracing showed that the rest of the time (16.6s vs 1.9s) is usually
      spent in computing huge diffs from commit to second parent. Will try to
      deal with it, if I'll have time.
      
      P.P.P.S.
      
      For combine_diff_path, ->len is not needed anymore - will remove it in
      the next noisy cleanup path, to maintain good signal/noise ratio here.
      Signed-off-by: default avatarKirill Smelkov <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      8518ff8f
    • Kirill Smelkov's avatar
      diff test: add tests for combine-diff with orderfile · 91921cef
      Kirill Smelkov authored
      In the next patch combine-diff will have special code-path for taking
      orderfile into account. Prepare for making changes by introducing
      coverage tests for that case.
      Signed-off-by: default avatarKirill Smelkov <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      91921cef
    • Kirill Smelkov's avatar
      diffcore-order: export generic ordering interface · 1df4320f
      Kirill Smelkov authored
      diffcore_order() interface only accepts a queue of `struct
      diff_filepair`.
      
      In the next patches, we'll want to order `struct combine_diff_path`
      by path, so let's first rework diffcore-order to also provide
      generic low-level interface for ordering arbitrary objects, provided
      they have path accessors.
      
      The new interface is:
      
          - `struct obj_order`    for describing objects to ordering routine, and
          - order_objects()       for actually doing the ordering work.
      Signed-off-by: default avatarKirill Smelkov <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      1df4320f
    • Kirill Smelkov's avatar
      tree-walk: finally switch over tree descriptors to contain a pre-parsed entry · 7146e66f
      Kirill Smelkov authored
      This continues 4651ece8 (Switch over tree descriptors to contain a
      pre-parsed entry) and moves the only rest computational part
      
          mode = canon_mode(mode)
      
      from tree_entry_extract() to tree entry decode phase - to
      decode_tree_entry().
      
      The reason to do it, is that canon_mode() is at least 2 conditional
      jumps for regular files, and that could be noticeable should canon_mode()
      be invoked several times.
      
      That does not matter for current Git codebase, where typical tree
      traversal is
      
          while (t->size) {
              sha1 = tree_entry_extract(t, &path, &mode);
              ...
              update_tree_entry(t);
          }
      
      i.e. we do t -> sha1,path.mode "extraction" only once per entry. In such
      cases, it does not matter performance-wise, where that mode
      canonicalization is done - either once in tree_entry_extract(), or once
      in decode_tree_entry() called by update_tree_entry() - it is
      approximately the same.
      
      But for future code, which could need to work with several tree_desc's
      in parallel, it could be handy to operate on tree_desc descriptors, and
      do "extracts" only when needed, or at all, access only relevant part of
      it through structure fields directly.
      
      And for such situations, having canon_mode() be done once in decode
      phase is better - we won't need to pay the performance price of 2 extra
      conditional jumps on every t->mode access.
      
      So let's move mode canonicalization to decode_tree_entry(). That was the
      final bit. Now after tree entry is decoded, it is fully ready and could
      be accessed either directly via field, or through tree_entry_extract()
      which this time got really "totally trivial".
      Signed-off-by: default avatarKirill Smelkov <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      7146e66f
  3. 05 Feb, 2014 4 commits
  4. 31 Jan, 2014 4 commits
  5. 29 Jan, 2014 1 commit
  6. 28 Jan, 2014 1 commit
  7. 27 Jan, 2014 22 commits
    • Junio C Hamano's avatar
      Git 1.9-rc1 · bd3e186d
      Junio C Hamano authored
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      bd3e186d
    • Junio C Hamano's avatar
      Merge branch 'as/tree-walk-fix-aggressive-short-cut' · 8bba7206
      Junio C Hamano authored
      * as/tree-walk-fix-aggressive-short-cut:
        tree_entry_interesting: match against all pathspecs
      8bba7206
    • Junio C Hamano's avatar
      Merge branch 'ta/doc-http-protocol-in-html' · 1ad5417a
      Junio C Hamano authored
      * ta/doc-http-protocol-in-html:
        http-protocol.txt: don't use uppercase for variable names in "The Negotiation Algorithm"
        Documentation: make it easier to maintain enumerated documents
        create HTML for http-protocol.txt
      1ad5417a
    • Junio C Hamano's avatar
      Merge branch 'mh/doc-wo-names' · 78dc48e4
      Junio C Hamano authored
      * mh/doc-wo-names:
        doc: remote author/documentation sections from more pages
      78dc48e4
    • Junio C Hamano's avatar
      Merge branch 'jk/revision-o-is-in-libgit-a' · 69b024dc
      Junio C Hamano authored
      * jk/revision-o-is-in-libgit-a:
        Makefile: remove redundant object in git-http{fetch,push}
      69b024dc
    • Junio C Hamano's avatar
      Merge branch 'sb/repack-in-c' · 41106398
      Junio C Hamano authored
      "git repack --max-pack-size=8g" stopped being parsed correctly when
      the command was reimplemented in C.
      
      * sb/repack-in-c:
        repack: propagate pack-objects options as strings
        repack: make parsed string options const-correct
        repack: fix typo in max-pack-size option
      41106398
    • Junio C Hamano's avatar
      Merge branch 'jk/test-fixes' · cdc40bdb
      Junio C Hamano authored
      * jk/test-fixes:
        t7700: do not use "touch" unnecessarily
        t7501: fix "empty commit" test with NO_PERL
      cdc40bdb
    • Junio C Hamano's avatar
      Merge branch 'nd/negative-pathspec' · 017f804e
      Junio C Hamano authored
      * nd/negative-pathspec:
        tree-walk.c: ignore trailing slash on submodule in tree_entry_interesting()
      017f804e
    • Junio C Hamano's avatar
      Merge branch 'pw/git-p4' · 523f0a25
      Junio C Hamano authored
      Various "git p4" updates.
      
      * pw/git-p4:
        git p4 doc: use two-line style for options with multiple spellings
        git p4 test: examine behavior with locked (+l) files
        git p4: fix an error message when "p4 where" fails
        git p4: handle files with wildcards when doing RCS scrubbing
        git p4 test: do not pollute /tmp
        git p4 test: run as user "author"
        git p4 test: is_cli_file_writeable succeeds
        git p4 test: explicitly check p4 wildcard delete
        git p4: work around p4 bug that causes empty symlinks
        git p4 test: ensure p4 symlink parsing works
        git p4 test: wildcards are supported
      523f0a25
    • Junio C Hamano's avatar
      Merge branch 'ss/safe-create-leading-dir-with-slash' · 33d4669a
      Junio C Hamano authored
      "git clone $origin foo\bar\baz" on Windows failed to create the
      leading directories (i.e. a moral-equivalent of "mkdir -p").
      
      * ss/safe-create-leading-dir-with-slash:
        safe_create_leading_directories(): on Windows, \ can separate path components
      33d4669a
    • Junio C Hamano's avatar
      Merge branch 'mh/safe-create-leading-directories' · d0956cfa
      Junio C Hamano authored
      Code clean-up and protection against concurrent write access to the
      ref namespace.
      
      * mh/safe-create-leading-directories:
        rename_tmp_log(): on SCLD_VANISHED, retry
        rename_tmp_log(): limit the number of remote_empty_directories() attempts
        rename_tmp_log(): handle a possible mkdir/rmdir race
        rename_ref(): extract function rename_tmp_log()
        remove_dir_recurse(): handle disappearing files and directories
        remove_dir_recurse(): tighten condition for removing unreadable dir
        lock_ref_sha1_basic(): if locking fails with ENOENT, retry
        lock_ref_sha1_basic(): on SCLD_VANISHED, retry
        safe_create_leading_directories(): add new error value SCLD_VANISHED
        cmd_init_db(): when creating directories, handle errors conservatively
        safe_create_leading_directories(): introduce enum for return values
        safe_create_leading_directories(): always restore slash at end of loop
        safe_create_leading_directories(): split on first of multiple slashes
        safe_create_leading_directories(): rename local variable
        safe_create_leading_directories(): add explicit "slash" pointer
        safe_create_leading_directories(): reduce scope of local variable
        safe_create_leading_directories(): fix format of "if" chaining
      d0956cfa
    • Junio C Hamano's avatar
      Merge branch 'tr/nth-previous-is-a-commit' · c380cf85
      Junio C Hamano authored
      * tr/nth-previous-is-a-commit:
        Documentation: @{-N} can refer to a commit
      c380cf85
    • Junio C Hamano's avatar
      Merge branch 'tr/gitk-doc-range-trace' · bf393990
      Junio C Hamano authored
      * tr/gitk-doc-range-trace:
        Documentation/gitk: document -L option
      bf393990
    • Junio C Hamano's avatar
      Merge branch 'jk/mark-edges-uninteresting' · a6bec001
      Junio C Hamano authored
      Fix performance regression in v1.8.4.x and later.
      
      * jk/mark-edges-uninteresting:
        list-objects: only look at cmdline trees with edge_hint
        t/perf: time rev-list with UNINTERESTING commits
      a6bec001
    • Junio C Hamano's avatar
      Merge branch 'jk/diff-filespec-cleanup' · e049109e
      Junio C Hamano authored
      * jk/diff-filespec-cleanup:
        diff_filespec: use only 2 bits for is_binary flag
        diff_filespec: reorder is_binary field
        diff_filespec: drop xfrm_flags field
        diff_filespec: drop funcname_pattern_ident field
        diff_filespec: reorder dirty_submodule macro definitions
      e049109e
    • Junio C Hamano's avatar
      Merge branch 'ef/mingw-write' · 7b4e2b7e
      Junio C Hamano authored
      * ef/mingw-write:
        mingw: remove mingw_write
        prefer xwrite instead of write
      7b4e2b7e
    • Junio C Hamano's avatar
      Merge branch 'rk/send-email-ssl-cert' · de20e447
      Junio C Hamano authored
      The "if /etc/ssl/certs/ directory exists, explicitly telling the
      library to use it as SSL_ca_path" blind-defaulting in "git
      send-email" broke platforms where /etc/ssl/certs/ directory exists,
      but it cannot used as SSL_ca_path (e.g. Fedora rawhide).  Fix it by
      not specifying any SSL_ca_path/SSL_ca_file but still asking for peer
      verification in such a case.
      
      * rk/send-email-ssl-cert:
        send-email: /etc/ssl/certs/ directory may not be usable as ca_path
      de20e447
    • Junio C Hamano's avatar
      Merge branch 'jn/ignore-doc' · a0f4525a
      Junio C Hamano authored
      Explicitly list $HOME/.config/git/ignore as one of the places you
      can use to keep ignore patterns that depend on your personal choice
      of tools, e.g. *~ for Emacs users.
      
      * jn/ignore-doc:
        gitignore doc: add global gitignore to synopsis
      a0f4525a
    • Junio C Hamano's avatar
      Merge branch 'jk/interpret-branch-name-fix' · 4e9f9320
      Junio C Hamano authored
      Fix a handful of bugs around interpreting [email protected]{upstream}
      notation and its lookalike, when $branch part has interesting
      characters, e.g. "@", and ":".
      
      * jk/interpret-branch-name-fix:
        interpret_branch_name: find all possible @-marks
        interpret_branch_name: avoid @{upstream} past colon
        interpret_branch_name: always respect "namelen" parameter
        interpret_branch_name: rename "cp" variable to "at"
        interpret_branch_name: factor out upstream handling
      4e9f9320
    • Junio C Hamano's avatar
      Merge branch 'jk/allow-fetch-onelevel-refname' · f583ace1
      Junio C Hamano authored
      "git clone" would fail to clone from a repository that has a ref
      directly under "refs/", e.g. "refs/stash", because different
      validation paths do different things on such a refname.  Loosen the
      client side's validation to allow such a ref.
      
      * jk/allow-fetch-onelevel-refname:
        fetch-pack: do not filter out one-level refs
      f583ace1
    • Junio C Hamano's avatar
      Merge branch 'jc/revision-range-unpeel' · 63763273
      Junio C Hamano authored
      "git log --left-right A...B" lost the "leftness" of commits
      reachable from A when A is a tag as a side effect of a recent
      bugfix.  This is a regression in 1.8.4.x series.
      
      * jc/revision-range-unpeel:
        revision: propagate flag bits from tags to pointees
        revision: mark contents of an uninteresting tree uninteresting
      63763273
    • Junio C Hamano's avatar
      Merge branch 'mh/retire-ref-fetch-rules' · 9bb52870
      Junio C Hamano authored
      Code simplification.
      
      * mh/retire-ref-fetch-rules:
        refname_match(): always use the rules in ref_rev_parse_rules
      9bb52870