1. 05 Apr, 2013 5 commits
    • Junio C Hamano's avatar
      diffcore-pickaxe: fix leaks in "log -S<block>" and "log -G<pattern>" · 88ff684d
      Junio C Hamano authored
      The diff_grep() and has_changes() functions had early return
      codepaths for unmerged filepairs, which simply returned 0.  When we
      taught textconv filter to them, one was ignored and continued to
      return early without freeing the result filtered by textconv, and
      the other had a failed attempt to fix, which allowed the planned
      return value 0 to be overwritten by a bogus call to contains().
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Junio C Hamano's avatar
      diffcore-pickaxe: port optimization from has_changes() to diff_grep() · ebb72262
      Junio C Hamano authored
      These two functions are called in the same codeflow to implement
      "log -S<block>" and "log -G<pattern>", respectively, but the latter
      lacked two obvious optimizations the former implemented, namely:
       - When a pickaxe limit is not given at all, they should return
         without wasting any cycle;
       - When both sides of the filepair are the same, and the same
         textconv conversion apply to them, return early, as there will be
         no interesting differences between the two anyway.
      Also release the filespec data once the processing is done (this is
      not about leaking memory--it is about releasing data we finished
      looking at as early as possible).
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Simon Ruderich's avatar
      diffcore-pickaxe: respect --no-textconv · a8f61094
      Simon Ruderich authored
      git log -S doesn't respect --no-textconv:
          $ echo '*.txt diff=wrong' > .gitattributes
          $ git -c diff.wrong.textconv='xxx' log --no-textconv -Sfoo
          error: cannot run xxx: No such file or directory
          fatal: unable to read files to diff
      Reported-by: Matthieu Moy's avatarMatthieu Moy <Matthieu.Moy@grenoble-inp.fr>
      Signed-off-by: Simon Ruderich's avatarSimon Ruderich <simon@ruderich.org>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Jeff King's avatar
      diffcore-pickaxe: remove fill_one() · 7cdb9b42
      Jeff King authored
      fill_one is _almost_ identical to just calling fill_textconv; the
      exception is that for the !DIFF_FILE_VALID case, fill_textconv gives us
      an empty buffer rather than a NULL one. Since we currently use the NULL
      pointer as a signal that the file is not present on one side of the
      diff, we must now switch to using DIFF_FILE_VALID to make the same
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: Simon Ruderich's avatarSimon Ruderich <simon@ruderich.org>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Simon Ruderich's avatar
      diffcore-pickaxe: remove unnecessary call to get_textconv() · bc615898
      Simon Ruderich authored
      The fill_one() function is responsible for finding and filling the
      textconv filter as necessary, and is called by diff_grep() function
      that implements "git log -G<pattern>".
      The has_changes() function that implements "git log -S<block>" calls
      get_textconv() for two sides being compared, before it checks to see
      if it was asked to perform the pickaxe limiting.  Move the code
      around to avoid this wastage.
      After has_changes() calls get_textconv() to obtain textconv for both
      sides, fill_one() is called to use them.
      By adding get_textconv() to diff_grep() and relieving fill_one() of
      responsibility to find the textconv filter, we can avoid calling
      get_textconv() twice in has_changes().
      With this change it's also no longer necessary for fill_one() to
      modify the textconv argument, therefore pass a pointer instead of a
      pointer to a pointer.
      Signed-off-by: Simon Ruderich's avatarSimon Ruderich <simon@ruderich.org>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  2. 28 Oct, 2012 3 commits
    • Jeff King's avatar
      pickaxe: use textconv for -S counting · ef90ab66
      Jeff King authored
      We currently just look at raw blob data when using "-S" to
      pickaxe. This is mostly historical, as pickaxe predates the
      textconv feature. If the user has bothered to define a
      textconv filter, it is more likely that their search string will be
      on the textconv output, as that is what they will see in the
      diff (and we do not even provide a mechanism for them to
      search for binary needles that contain NUL characters).
      This patch teaches "-S" to use textconv, just as we
      already do for "-G".
      Signed-off-by: default avatarJeff King <peff@peff.net>
    • Jeff King's avatar
      pickaxe: hoist empty needle check · 8fa4b09f
      Jeff King authored
      If we are given an empty pickaxe needle like "git log -S ''",
      it is impossible for us to find anything (because no matter
      what the content, the count will always be 0). We currently
      check this at the lowest level of contains(). Let's hoist
      the logic much earlier to has_changes(), so that it is
      simpler to return our answer before loading any blob data.
      Signed-off-by: default avatarJeff King <peff@peff.net>
    • Jeff King's avatar
      diff_grep: use textconv buffers for add/deleted files · b1c2f57d
      Jeff King authored
      If you use "-G" to grep a diff, we will apply a configured
      textconv filter to the data before generating the diff.
      However, if the diff is an addition or deletion, we do not
      bother running the diff at all, and just look for the token
      in the added (or removed) content. This works because we
      know that the diff must contain every line of content.
      However, while we used the textconv-derived buffers in the
      regular diff, we accidentally passed the original unmodified
      buffers to regexec when checking the added or removed
      content. This could lead to an incorrect answer.
      Worse, in some cases we might have a textconv buffer but no
      original buffer (e.g., if we pulled the textconv data from
      cache, or if we reused a working tree file when generating
      it). In that case, we could actually feed NULL to regexec
      and segfault.
      Reported-by: Peter Oberndorfer's avatarPeter Oberndorfer <kumbayo84@arcor.de>
      Signed-off-by: default avatarJeff King <peff@peff.net>
  3. 17 Oct, 2012 12 commits
  4. 14 Oct, 2012 1 commit
  5. 12 Oct, 2012 2 commits
    • Jeff King's avatar
      http: fix segfault in handle_curl_result · 188923f0
      Jeff King authored
      When we create an http active_request_slot, we can set its
      "results" pointer back to local storage. The http code will
      fill in the details of how the request went, and we can
      access those details even after the slot has been cleaned
      Commit 88097030 (http: factor out http error code handling)
      switched us from accessing our local results struct directly
      to accessing it via the "results" pointer of the slot. That
      means we're accessing the slot after it has been marked as
      finished, defeating the whole purpose of keeping the results
      storage separate.
      Most of the time this doesn't matter, as finishing the slot
      does not actually clean up the pointer. However, when using
      curl's multi interface with the dumb-http revision walker,
      we might actually start a new request before handing control
      back to the original caller. In that case, we may reuse the
      slot, zeroing its results pointer, and leading the original
      caller to segfault while looking for its results inside the
      Instead, we need to pass a pointer to our local results
      storage to the handle_curl_result function, rather than
      relying on the pointer in the slot struct. This matches what
      the original code did before the refactoring (which did not
      use a separate function, and therefore just accessed the
      results struct directly).
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Dylan Simon's avatar
      gitweb.cgi: fix "comitter_tz" typo in feed · debf29dc
      Dylan Simon authored
      gitweb's feeds sometimes contained committer timestamps in the wrong timezone
      due to a misspelling.
      Signed-off-by: Dylan Simon's avatarDylan Simon <dylan@dylex.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  6. 10 Oct, 2012 1 commit
  7. 09 Oct, 2012 1 commit
  8. 08 Oct, 2012 8 commits
  9. 07 Oct, 2012 1 commit
  10. 05 Oct, 2012 1 commit
  11. 04 Oct, 2012 1 commit
  12. 02 Oct, 2012 4 commits
    • Junio C Hamano's avatar
      t1450: the order the objects are checked is undefined · 9dad83be
      Junio C Hamano authored
      When a tag T points at an object X that is of a type that is
      different from what the tag records as, fsck should report it as an
      However, depending on the order X and T are checked individually,
      the actual error message can be different.  If X is checked first,
      fsck remembers X's type and then when it checks T, it notices that T
      records X as a wrong type (i.e. the complaint is about a broken tag
      T).  If T is checked first, on the other hand, fsck remembers that we
      need to verify X is of the type tag records, and when it later
      checks X, it notices that X is of a wrong type (i.e. the complaint
      is about a broken object X).
      The important thing is that fsck notices such an error and diagnoses
      the issue on object X, but the test was expecting that we happen to
      check objects in the order to make us detect issues with tag T, not
      with object X.  Remove this unwarranted assumption.
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Junio C Hamano's avatar
      Start preparing for · 9376c860
      Junio C Hamano authored
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Junio C Hamano's avatar
      Merge branch 'rr/maint-submodule-unknown-cmd' into maint · e2c7a5b6
      Junio C Hamano authored
      "git submodule frotz" was not diagnosed as "frotz" being an unknown
      subcommand to "git submodule"; the user instead got a complaint that
      "git submodule status" was run with an unknown path "frotz".
      * rr/maint-submodule-unknown-cmd:
        submodule: if $command was not matched, don't parse other args
    • Junio C Hamano's avatar
      Merge branch 'sp/maint-http-enable-gzip' into maint · 0a65df58
      Junio C Hamano authored
      "git fetch" over http advertised that it supports "deflate", which
      is much less common, and did not advertise more common "gzip" on its
      Accept-Encoding header.
      * sp/maint-http-enable-gzip:
        Enable info/refs gzip decompression in HTTP client