1. 17 1月, 2015 4 次提交
    • J
      strbuf.h: format asciidoc code blocks as 4-space indent · 088c9a86
      Jeff King 提交于
      This is much easier to read when the whole thing is stuffed
      inside a comment block. And there is precedent for this
      convention in markdown (and just in general ascii text).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      088c9a86
    • J
      strbuf.h: drop asciidoc list formatting from API docs · aa07cac4
      Jeff King 提交于
      Using a hanging indent is much more readable. This means we
      won't format as asciidoc anymore, but since we don't have a
      working system for extracting these comments anyway, it's
      probably more important to just make the source readable.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      aa07cac4
    • S
      strbuf.h: unify documentation comments beginnings · 6afbbdda
      Stefan Beller 提交于
      The prior patch uses "/**" to denote "documentation"
      comments that we pulled from api-strbuf.txt. Let's use a
      consistent style for similar comments that were already in
      strbuf.h.
      Signed-off-by: NStefan Beller <sbeller@google.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6afbbdda
    • J
      strbuf.h: integrate api-strbuf.txt documentation · bdfdaa49
      Jeff King 提交于
      Some of strbuf is documented as comments above functions,
      and some is separate in Documentation/technical/api-strbuf.txt.
      This makes it annoying to find the appropriate documentation.
      We'd rather have it all in one place, which means all in the
      text document, or all in the header.
      
      Let's choose the header as that place. Even though the
      formatting is not quite as pretty, this keeps the
      documentation close to the related code.  The hope is that
      this makes it easier to find what you want (human-readable
      comments are right next to the C declarations), and easier
      for writers to keep the documentation up to date.
      
      This is more or less a straight import of the text from
      api-strbuf.txt into C comments, complete with asciidoc
      formatting. The exceptions are:
      
       1. All comments created in this way are started with "/**"
          to indicate they are part of the API documentation. This
          may help later with extracting the text to pretty-print
          it.
      
       2. Function descriptions do not repeat the function name,
          as it is available in the context directly below.  So:
      
            `strbuf_add`::
      
                Add data of given length to the buffer.
      
          from api-strbuf.txt becomes:
      
            /**
             * Add data of given length to the buffer.
             */
            void strbuf_add(struct strbuf *sb, const void *, size_t);
      
          As a result, any block-continuation required in asciidoc
          for that list item was dropped in favor of straight
          blank-line paragraph (since it is not necessary when we
          are not in a list item).
      
       3. There is minor re-wording to integrate existing comments
          and api-strbuf text. In each case, I took whichever
          version was more descriptive, and eliminated any
          redundancies. In one case, for strbuf_addstr, the api
          documentation gave its inline definition; I eliminated
          this as redundant with the actual definition, which can
          be seen directly below the comment.
      
       4. The functions in the header file are re-ordered to match
          the ordering of the API documentation, under the
          assumption that more thought went into the grouping
          there.
      Helped-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bdfdaa49
  2. 13 12月, 2014 12 次提交
  3. 06 12月, 2014 13 次提交
  4. 01 12月, 2014 2 次提交
    • J
      push: truly use "simple" as default, not "upstream" · 00a6fa07
      Jeff King 提交于
      The plan for the push.default transition had all along been
      to use the "simple" method rather than "upstream" as a
      default if the user did not specify their own push.default
      value. Commit 11037ee7 (push: switch default from "matching"
      to "simple", 2013-01-04) tried to implement that by moving
      PUSH_DEFAULT_UNSPECIFIED in our switch statement to
      fall-through to the PUSH_DEFAULT_SIMPLE case.
      
      When the commit that became 11037ee7 was originally written,
      that would have been enough. We would fall through to
      calling setup_push_upstream() with the "simple" parameter
      set to 1. However, it was delayed for a while until we were
      ready to make the transition in Git 2.0.
      
      And in the meantime, commit ed2b1829 (push: change `simple`
      to accommodate triangular workflows, 2013-06-19) threw a
      monkey wrench into the works. That commit drops the "simple"
      parameter to setup_push_upstream, and instead checks whether
      the global "push_default" is PUSH_DEFAULT_SIMPLE. This is
      right when the user has explicitly configured push.default
      to simple, but wrong when we are a fall-through for the
      "unspecified" case.
      
      We never noticed because our push.default tests do not cover
      the case of the variable being totally unset; they only
      check the "simple" behavior itself.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      00a6fa07
    • K
      pack-bitmap: do not use gcc packed attribute · b5007211
      Karsten Blees 提交于
      The "__attribute__" flag may be a noop on some compilers.
      That's OK as long as the code is correct without the
      attribute, but in this case it is not. We would typically
      end up with a struct that is 2 bytes too long due to struct
      padding, breaking both reading and writing of bitmaps.
      
      Instead of marshalling the data in a struct, let's just
      provide helpers for reading and writing the appropriate
      types. Besides being correct on all platforms, the result is
      more efficient and simpler to read.
      Signed-off-by: NKarsten Blees <blees@dcon.de>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b5007211
  5. 29 11月, 2014 2 次提交
  6. 27 11月, 2014 2 次提交
  7. 22 11月, 2014 5 次提交