1. 15 9月, 2009 4 次提交
    • J
      Merge branch 'jc/maint-1.6.0-blank-at-eof' (early part) into jc/maint-blank-at-eof · afd9db41
      Junio C Hamano 提交于
      * 'jc/maint-1.6.0-blank-at-eof' (early part):
        diff --whitespace: fix blank lines at end
        core.whitespace: split trailing-space into blank-at-{eol,eof}
        diff --color: color blank-at-eof
        diff --whitespace=warn/error: fix blank-at-eof check
        diff --whitespace=warn/error: obey blank-at-eof
        diff.c: the builtin_diff() deals with only two-file comparison
        apply --whitespace: warn blank but not necessarily empty lines at EOF
        apply --whitespace=warn/error: diagnose blank at EOF
        apply.c: split check_whitespace() into two
        apply --whitespace=fix: detect new blank lines at eof correctly
        apply --whitespace=fix: fix handling of blank lines at the eof
      afd9db41
    • J
      diff --whitespace: fix blank lines at end · d68fe26f
      Junio C Hamano 提交于
      The earlier logic tried to colour any and all blank lines that were added
      beyond the last blank line in the original, but this was very wrong.  If
      you added 96 blank lines, a non-blank line, and then 3 blank lines at the
      end, only the last 3 lines should trigger the error, not the earlier 96
      blank lines.
      
      We need to also make sure that the lines are after the last non-blank line
      in the postimage as well before deciding to paint them.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d68fe26f
    • J
      Merge branch 'rc/maint-http-no-head-pack-check' into maint · 4197ce3c
      Junio C Hamano 提交于
      * rc/maint-http-no-head-pack-check:
        http.c: avoid freeing an uninitialized pointer
      4197ce3c
    • J
      http.c: avoid freeing an uninitialized pointer · b2025146
      Junio C Hamano 提交于
      An earlier 59b8d38f (http.c: remove verification of remote packs) left
      the variable "url" uninitialized; "goto cleanup" codepath can free it
      which is not very nice.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b2025146
  2. 13 9月, 2009 3 次提交
  3. 11 9月, 2009 1 次提交
  4. 08 9月, 2009 4 次提交
  5. 06 9月, 2009 3 次提交
  6. 05 9月, 2009 8 次提交
    • J
      diff --color: color blank-at-eof · 690ed843
      Junio C Hamano 提交于
      Since the coloring logic processed the patch output one line at a time, we
      couldn't easily color code the new blank lines at the end of file.
      
      Reuse the adds_blank_at_eof() function to find where the runs of such
      blank lines start, keep track of the line number in the preimage while
      processing the patch output one line at a time, and paint the new blank
      lines that appear after that line to implement this.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      690ed843
    • J
      diff --whitespace=warn/error: fix blank-at-eof check · 467babf8
      Junio C Hamano 提交于
      The "diff --check" logic used to share the same issue as the one fixed for
      "git apply" earlier in this series, in that a patch that adds new blank
      lines at end could appear as
      
          @@ -l,5 +m,7 @@$
          _context$
          _context$
          -deleted$
          +$
          +$
          +$
          _$
          _$
      
      where _ stands for SP and $ shows a end-of-line.  Instead of looking at
      each line in the patch in the callback, simply count the blank lines from
      the end in two versions, and notice the presence of new ones.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      467babf8
    • J
      diff --whitespace=warn/error: obey blank-at-eof · 5b5061ef
      Junio C Hamano 提交于
      The "diff --check" code used to conflate trailing-space whitespace error
      class with this, but now we have a proper separate error class, we should
      check it under blank-at-eof, not trailing-space.
      
      The whitespace error is not about _having_ blank lines at end, but about
      adding _new_ blank lines.  To keep the message consistent with what is
      given by "git apply", call whitespace_error_string() to generate it,
      instead of using a hardcoded custom message.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5b5061ef
    • J
      diff.c: the builtin_diff() deals with only two-file comparison · b8d9c1a6
      Junio C Hamano 提交于
      The combined diff is implemented in combine_diff() and fn_out_consume()
      codepath never has to deal with anything but two-file comparision.
      
      Drop nparents from the emit_callback structure and simplify the code.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b8d9c1a6
    • J
      apply --whitespace: warn blank but not necessarily empty lines at EOF · 94ea026b
      Junio C Hamano 提交于
      The whitespace error of adding blank lines at the end of file should
      trigger if you added a non-empty line at the end, if the contents of the
      line is full of whitespaces.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      94ea026b
    • J
      apply --whitespace=warn/error: diagnose blank at EOF · 77b15bbd
      Junio C Hamano 提交于
      "git apply" strips new blank lines at EOF under --whitespace=fix option,
      but neigher --whitespace=warn nor --whitespace=error paid any attention to
      these errors.
      
      Introduce a new whitespace error class, blank-at-eof, to make the
      whitespace error handling more consistent.
      
      The patch adds a new "linenr" field to the struct fragment in order to
      record which line the hunk started in the input file, but this is needed
      solely for reporting purposes.  The detection of this class of whitespace
      errors cannot be done while parsing a patch like we do for all the other
      classes of whitespace errors.  It instead has to wait until we find where
      to apply the hunk, but at that point, we do not have an access to the
      original line number in the input file anymore, hence the new field.
      
      Depending on your point of view, this may be a bugfix that makes warn and
      error in line with fix.  Or you could call it a new feature.  The line
      between them is somewhat fuzzy in this case.
      
      Strictly speaking, triggering more errors than before is a change in
      behaviour that is not backward compatible, even though the reason for the
      change is because the code was not checking for an error that it should
      have.  People who do not want added blank lines at EOF to trigger an error
      can disable the new error class.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      77b15bbd
    • J
      apply.c: split check_whitespace() into two · 92a1747e
      Junio C Hamano 提交于
      This splits the logic to record the presence of whitespace errors out of
      the check_whitespace() function, which checks and then records.  The new
      function, record_ws_error(), can be used by the blank-at-eof check that
      does not use ws_check() logic to report its findings in the same output
      format.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      92a1747e
    • J
      apply --whitespace=fix: detect new blank lines at eof correctly · efa57443
      Junio C Hamano 提交于
      The command tries to strip blank lines at the end of the file added by a
      patch.  It is done by first detecting if a hunk in patch has additional
      blank lines at the end of itself, and if so checking if such a hunk
      applies at the end of file.  This patch addresses a bug in the logic to
      implement the former (the previous one addressed a bug in the latter).
      
      If the original ends with blank lines, often the patch hunk ends like
      this:
      
          @@ -l,5 +m,7 @@$
          _context$
          _context$
          -deleted$
          +$
          +$
          +$
          _$
          _$
      
      where _ stands for SP and $ shows a end-of-line.  This example patch adds
      three trailing blank lines, but the code fails to notice it, because it
      only pays attention to added blank lines at the very end of the hunk.  In
      this example, the three added blank lines do not appear textually at the
      end in the patch, even though you can see that they are indeed added at
      the end, if you rearrange the diff like this:
      
          @@ -l,5 +m,7 @@$
          _context$
          _context$
          -deleted$
          _$
          _$
          +$
          +$
          +$
      
      The fix is not to reset the number of (candidate) added blank lines at the
      end when the loop sees a context line that is empty.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      efa57443
  7. 04 9月, 2009 4 次提交
  8. 03 9月, 2009 2 次提交
    • G
      git-cvsserver: no longer use deprecated 'git-subcommand' commands · d2feb01a
      Gerrit Pape 提交于
      git-cvsserver still references git commands like 'git-config', which
      is depcrecated.  This commit changes git-cvsserver to use the
      'git subcommand' form.
      
      Sylvain Beucler reported the problem through
       http://bugs.debian.org/536067Signed-off-by: NGerrit Pape <pape@smarden.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d2feb01a
    • J
      clone: disconnect transport after fetching · 12d49966
      Jeff King 提交于
      The current code just leaves the transport in whatever state
      it was in after performing the fetch.  For a non-empty clone
      over the git protocol, the transport code already
      disconnects at the end of the fetch.
      
      But for an empty clone, we leave the connection hanging, and
      eventually close the socket when clone exits. This causes
      the remote upload-pack to complain "the remote end hung up
      unexpectedly". While this message is harmless to the clone
      itself, it is unnecessarily scary for a user to see and may
      pollute git-daemon logs.
      
      This patch just explicitly calls disconnect after we are
      done with the remote end, which sends a flush packet to
      upload-pack and cleanly disconnects, avoiding the error
      message.
      
      Other transports are unaffected or slightly improved:
      
       - for a non-empty repo over the git protocol, the second
         disconnect is a no-op (since we are no longer connected)
      
       - for "walker" transports (like HTTP or FTP), we actually
         free some used memory (which previously just sat until
         the clone process exits)
      
       - for "rsync", disconnect is always a no-op anyway
      Signed-off-by: NJeff King <peff@peff.net>
      Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      12d49966
  9. 30 8月, 2009 1 次提交
  10. 29 8月, 2009 3 次提交
  11. 28 8月, 2009 7 次提交