1. 20 10月, 2009 1 次提交
    • T
      Refactor pretty_print_commit arguments into a struct · dd2e794a
      Thomas Rast 提交于
      pretty_print_commit() has a bunch of rarely-used arguments, and
      introducing more of them requires yet another update of all the call
      sites.  Refactor most of them into a struct to make future extensions
      easier.
      
      The ones that stay "plain" arguments were chosen on the grounds that
      all callers put real arguments there, whereas some callers have 0/NULL
      for all arguments that were factored into the struct.
      
      We declare the struct 'const' to ensure none of the callers are bitten
      by the changed (no longer call-by-value) semantics.
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dd2e794a
  2. 27 8月, 2009 1 次提交
  3. 19 8月, 2009 1 次提交
  4. 11 8月, 2009 1 次提交
  5. 08 8月, 2009 1 次提交
  6. 20 7月, 2009 2 次提交
    • J
      show: add space between multiple items · ae03ee64
      Jeff King 提交于
      When showing an annotated tag, "git show" will always
      display the pointed-to object. However, it didn't separate
      the two with whitespace, making it more difficult to notice
      where the new object started. For example:
      
        $ git tag -m 'my message' foo
        $ git show foo
        tag foo
        Tagger: Jeff King <peff@peff.net>
        Date:   Fri Jul 17 18:46:25 2009 -0400
      
        my message
        commit 41cabf8fed2694ba33e01d64f9094f2fc5e5805a
        Author: Jeff King <peff@peff.net>
        Date:   Thu Jul 16 17:31:34 2009 -0400
        ...
      
      This patch respects and sets the rev.shown_one member to
      prepend a blank line before showing a second item. We use
      this member of rev_info instead of a local flag, because the
      log_tree_commit we call into for showing commits already
      respects and sets that flag. Meaning that everything will be
      spaced properly if you intermix commits and tags, like:
      
        $ git show v1.6.3 v1.6.2 HEAD
      
      In that case, a single blank line will separate the first
      tag, the commit it points to, the second tag, the commit
      that one points to, and the final commit.
      
      While we're at it, let's also support trees, so that even
      something as crazy as
      
        $ git show HEAD^{tree} HEAD~1^{tree} HEAD
      
      will also be spaced in an easy-to-read way. However, we
      intentionally do _not_ insert blank lines for blobs, so
      that specifying multiple blobs gives a strict concatenation.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ae03ee64
    • J
      show: suppress extra newline when showing annotated tag · ca4ca9ed
      Jeff King 提交于
      When showing a tag, our header parsing finishes with the
      offset pointing to the newline separating the tag header
      from the tag body. This means that the printed body will
      always start with a newline.
      
      However, we also add an extra newline when printing the
      tagger information. This leads to an ugly double-newline:
      
          $ git show v1.6.3
          tag v1.6.3
          Tagger: Junio C Hamano <gitster@pobox.com>
          Date:   Wed May 6 18:16:47 2009 -0700
      
          GIT 1.6.3
          -----BEGIN PGP SIGNATURE-----
          ...
      
      This patch removes the extra newline from the end of the
      tagger headers. This is a better solution than suppressing
      the separator newline, because it retains the behavior for
      tags which have no tagger. E.g., "git show v0.99" will
      continue to look like:
      
            $ git show v0.99
            tag v0.99
      
            Test-release for wider distribution.
            ...
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ca4ca9ed
  7. 28 6月, 2009 1 次提交
    • T
      Use die_errno() instead of die() when checking syscalls · 0721c314
      Thomas Rast 提交于
      Lots of die() calls did not actually report the kind of error, which
      can leave the user confused as to the real problem.  Use die_errno()
      where we check a system/library call that sets errno on failure, or
      one of the following that wrap such calls:
      
        Function              Passes on error from
        --------              --------------------
        odb_pack_keep         open
        read_ancestry         fopen
        read_in_full          xread
        strbuf_read           xread
        strbuf_read_file      open or strbuf_read_file
        strbuf_readlink       readlink
        write_in_full         xwrite
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0721c314
  8. 21 6月, 2009 1 次提交
    • L
      Fix various sparse warnings in the git source code · 2af202be
      Linus Torvalds 提交于
      There are a few remaining ones, but this fixes the trivial ones. It boils
      down to two main issues that sparse complains about:
      
       - warning: Using plain integer as NULL pointer
      
         Sparse doesn't like you using '0' instead of 'NULL'. For various good
         reasons, not the least of which is just the visual confusion. A NULL
         pointer is not an integer, and that whole "0 works as NULL" is a
         historical accident and not very pretty.
      
         A few of these remain: zlib is a total mess, and Z_NULL is just a 0.
         I didn't touch those.
      
       - warning: symbol 'xyz' was not declared. Should it be static?
      
         Sparse wants to see declarations for any functions you export. A lack
         of a declaration tends to mean that you should either add one, or you
         should mark the function 'static' to show that it's in file scope.
      
         A few of these remain: I only did the ones that should obviously just
         be made static.
      
      That 'wt_status_submodule_summary' one is debatable. It has a few related
      flags (like 'wt_status_use_color') which _are_ declared, and are used by
      builtin-commit.c. So maybe we'd like to export it at some point, but it's
      not declared now, and not used outside of that file, so 'static' it is in
      this patch.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2af202be
  9. 25 5月, 2009 1 次提交
  10. 19 5月, 2009 1 次提交
  11. 18 5月, 2009 1 次提交
  12. 09 5月, 2009 1 次提交
  13. 06 4月, 2009 1 次提交
  14. 28 3月, 2009 1 次提交
  15. 23 3月, 2009 4 次提交
  16. 22 3月, 2009 1 次提交
  17. 19 3月, 2009 1 次提交
  18. 22 2月, 2009 3 次提交
    • T
      format-patch: support deep threading · 30984ed2
      Thomas Rast 提交于
      For deep threading mode, i.e., the mode that gives a thread structured
      like
      
        + [PATCH 0/n] Cover letter
         `-+ [PATCH 1/n] First patch
            `-+ [PATCH 2/n] Second patch
               `-+ ...
      
      we currently have to use 'git send-email --thread' (the default).  On
      the other hand, format-patch also has a --thread option which gives
      shallow mode, i.e.,
      
        + [PATCH 0/n] Cover letter
        |-+ [PATCH 1/n] First patch
        |-+ [PATCH 2/n] Second patch
        ...
      
      To reduce the confusion resulting from having two indentically named
      features in different tools giving different results, let format-patch
      take an optional argument '--thread=deep' that gives the same output
      as 'send-mail --thread'.  With no argument, or 'shallow', behave as
      before.  Also add a configuration variable format.thread with the same
      semantics.
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      30984ed2
    • T
      format-patch: thread as reply to cover letter even with in-reply-to · 2175c10d
      Thomas Rast 提交于
      Currently, format-patch --thread --cover-letter --in-reply-to $parent
      makes all mails, including the cover letter, a reply to $parent.
      However, we would want the reader to consider the cover letter above
      all the patches.
      
      This changes the semantics so that only the cover letter is a reply to
      $parent, while all the patches are formatted as replies to the cover
      letter.
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2175c10d
    • T
      format-patch: track several references · b079c50e
      Thomas Rast 提交于
      Currently, format-patch can only track a single reference (the
      In-Reply-To:) for each mail.  To ensure proper threading, we should
      list all known references for every mail.
      
      Change the rev_info.ref_message_id field to a string_list, so that we
      can append references at will, and change the output formatting
      routines to print all of them in the References: header.  The last
      entry in the list is implicitly assumed to be the In-Reply-To:, which
      gives output consistent with RFC 2822:
      
         The "References:" field will contain the contents of the parent's
         "References:" field (if any) followed by the contents of the
         parent's "Message-ID:" field (if any).
      
      Note that this is just preparatory work; nothing uses it yet, so all
      "References:" fields in the output are still only one deep.
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b079c50e
  19. 13 2月, 2009 1 次提交
  20. 13 1月, 2009 1 次提交
  21. 11 1月, 2009 1 次提交
    • J
      format-patch: show patch text for the root commit · 68c2ec7f
      Junio C Hamano 提交于
      Even without --root specified, if the range given on the command line
      happens to include a root commit, we should include its patch text in the
      output.
      
      This fix deliberately ignores log.showroot configuration variable because
      "format-patch" and "log -p" can and should behave differently in this
      case, as the former is about exporting a part of your history in a form
      that is replayable elsewhere and just giving the commit log message
      without the patch text does not make any sense for that purpose.
      
      Noticed and fix originally attempted by Nathan W. Panike; credit goes to
      Alexander Potashev for injecting sanity to my initial (broken) fix that
      used the value from log.showroot configuration, which was misguided.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      68c2ec7f
  22. 06 1月, 2009 3 次提交
  23. 01 1月, 2009 1 次提交
  24. 15 12月, 2008 1 次提交
  25. 08 12月, 2008 1 次提交
    • J
      reorder ALLOW_TEXTCONV option setting · 5ec11af6
      Jeff King 提交于
      Right now for the diff porcelain and the log family, we
      call:
      
        init_revisions();
        setup_revisions();
        DIFF_OPT_SET(ALLOW_TEXTCONV);
      
      However, that means textconv will _always_ be on, instead of
      being a default that can be manipulated with
      setup_revisions. Instead, we want:
      
        init_revisions();
        DIFF_OPT_SET(ALLOW_TEXTCONV);
        setup_revisions();
      
      which is what this patch does.
      
      We'll go ahead and move the callsite in wt-status, also;
      even though the user can't pass any options here, it is a
      cleanup that will help avoid any surprise later if the
      setup_revisions line is changed.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5ec11af6
  26. 04 11月, 2008 2 次提交
  27. 27 10月, 2008 1 次提交
    • J
      userdiff: require explicitly allowing textconv · c7534ef4
      Jeff King 提交于
      Diffs that have been produced with textconv almost certainly
      cannot be applied, so we want to be careful not to generate
      them in things like format-patch.
      
      This introduces a new diff options, ALLOW_TEXTCONV, which
      controls this behavior. It is off by default, but is
      explicitly turned on for the "log" family of commands, as
      well as the "diff" porcelain (but not diff-* plumbing).
      
      Because both text conversion and external diffing are
      controlled by these diff options, we can get rid of the
      "plumbing versus porcelain" distinction when reading the
      config. This was an attempt to control the same thing, but
      suffered from being too coarse-grained.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c7534ef4
  28. 18 10月, 2008 1 次提交
  29. 13 10月, 2008 1 次提交
  30. 20 9月, 2008 1 次提交
  31. 05 9月, 2008 1 次提交