1. 16 11月, 2009 1 次提交
  2. 01 11月, 2009 1 次提交
  3. 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
  4. 27 5月, 2009 1 次提交
  5. 15 3月, 2009 1 次提交
    • B
      Remove unused assignments · 8e76bf3f
      Benjamin Kramer 提交于
      These variables were always overwritten or the assigned
      value was unused:
      
        builtin-diff-tree.c::cmd_diff_tree(): nr_sha1
        builtin-for-each-ref.c::opt_parse_sort(): sort_tail
        builtin-mailinfo.c::decode_header_bq(): in
        builtin-shortlog.c::insert_one_record(): len
        connect.c::git_connect(): path
        imap-send.c::v_issue_imap_cmd(): n
        pretty.c::pp_user_info(): filler
        remote::parse_refspec_internal(): llen
      Signed-off-by: NBenjamin Kramer <benny.kra@googlemail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e76bf3f
  6. 15 2月, 2009 1 次提交
    • J
      imap.preformattedHTML to tell Thunderbird to send non-flowed text · c64d84f1
      Jeremy White 提交于
      Many e-mail based development communities require non-flowed text to carry
      patches to prevent whitespaces from getting mangled, but there is no easy
      way to tell Thunderbird MUA not to use format=flowed, unless you configure
      it to do so unconditionally for all outgoing mails.
      
      A workaround for users who use git-imap-send is to wrap the patch in "pre"
      element in the draft folder as an HTML message, and tell Thunderbird to
      send "text only".  Thunderbird turns such a message into a non-flowed
      plain text when sending it out, which is what we want for patch e-mails.
      Signed-off-by: NJeremy White <jwhite@codeweavers.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c64d84f1
  7. 26 1月, 2009 1 次提交
  8. 06 1月, 2009 1 次提交
  9. 13 10月, 2008 1 次提交
  10. 26 7月, 2008 4 次提交
  11. 15 5月, 2008 1 次提交
  12. 23 4月, 2008 1 次提交
    • J
      Don't force imap.host to be set when imap.tunnel is set · 34b5cd1f
      Jeff King 提交于
      The documentation for git-imap-send suggests a tunnel setting such as
      
        Tunnel = "ssh -q user@server.com /usr/bin/imapd ./Maildir 2> /dev/null"
      
      which works wonderfully and doesn't require a username, password or port
      setting.
      
      However, git-imap-send currently requires that the imap.host variable be
      set in the config even when it was unused.  This patch changes imap-send
      to only require that the imap.host setting is set if imap.tunnel is not
      set.  Otherwise, server.host is set to "tunnel" for reporting purposes.
      Acked-by: NAndy Parkins <andyparkins@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      34b5cd1f
  13. 27 3月, 2008 1 次提交
  14. 23 2月, 2008 1 次提交
    • J
      Avoid unnecessary "if-before-free" tests. · 8e0f7003
      Jim Meyering 提交于
      This change removes all obvious useless if-before-free tests.
      E.g., it replaces code like this:
      
              if (some_expression)
                      free (some_expression);
      
      with the now-equivalent:
      
              free (some_expression);
      
      It is equivalent not just because POSIX has required free(NULL)
      to work for a long time, but simply because it has worked for
      so long that no reasonable porting target fails the test.
      Here's some evidence from nearly 1.5 years ago:
      
          http://www.winehq.org/pipermail/wine-patches/2006-October/031544.html
      
      FYI, the change below was prepared by running the following:
      
        git ls-files -z | xargs -0 \
        perl -0x3b -pi -e \
          's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+(free\s*\(\s*\1\s*\))/$2/s'
      
      Note however, that it doesn't handle brace-enclosed blocks like
      "if (x) { free (x); }".  But that's ok, since there were none like
      that in git sources.
      
      Beware: if you do use the above snippet, note that it can
      produce syntactically invalid C code.  That happens when the
      affected "if"-statement has a matching "else".
      E.g., it would transform this
      
        if (x)
          free (x);
        else
          foo ();
      
      into this:
      
        free (x);
        else
          foo ();
      
      There were none of those here, either.
      
      If you're interested in automating detection of the useless
      tests, you might like the useless-if-before-free script in gnulib:
      [it *does* detect brace-enclosed free statements, and has a --name=S
       option to make it detect free-like functions with different names]
      
        http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/useless-if-before-free
      
      Addendum:
        Remove one more (in imap-send.c), spotted by Jean-Luc Herren <jlh@gmx.ch>.
      Signed-off-by: NJim Meyering <meyering@redhat.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e0f7003
  15. 12 2月, 2008 1 次提交
  16. 29 9月, 2007 1 次提交
    • P
      strbuf change: be sure ->buf is never ever NULL. · b315c5c0
      Pierre Habouzit 提交于
      For that purpose, the ->buf is always initialized with a char * buf living
      in the strbuf module. It is made a char * so that we can sloppily accept
      things that perform: sb->buf[0] = '\0', and because you can't pass "" as an
      initializer for ->buf without making gcc unhappy for very good reasons.
      
      strbuf_init/_detach/_grow have been fixed to trust ->alloc and not ->buf
      anymore.
      
      as a consequence strbuf_detach is _mandatory_ to detach a buffer, copying
      ->buf isn't an option anymore, if ->buf is going to escape from the scope,
      and eventually be free'd.
      
      API changes:
        * strbuf_setlen now always works, so just make strbuf_reset a convenience
          macro.
        * strbuf_detatch takes a size_t* optional argument (meaning it can be
          NULL) to copy the buffer's len, as it was needed for this refactor to
          make the code more readable, and working like the callers.
      Signed-off-by: NPierre Habouzit <madcoder@debian.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b315c5c0
  17. 21 9月, 2007 1 次提交
    • P
      nfv?asprintf are broken without va_copy, workaround them. · 19247e55
      Pierre Habouzit 提交于
      * drop nfasprintf.
      * move nfvasprintf into imap-send.c back, and let it work on a 8k buffer,
        and die() in case of overflow. It should be enough for imap commands, if
        someone cares about imap-send, he's welcomed to fix it properly.
      * replace nfvasprintf use in merge-recursive with a copy of the strbuf_addf
        logic, it's one place, we'll live with it.
        To ease the change, output_buffer string list is replaced with a strbuf ;)
      * rework trace.c to call vsnprintf itself.  It's used to format strerror()s
        and git command names, it should never be more than a few octets long, let
        it work on a 8k static buffer with vsnprintf or die loudly.
      Signed-off-by: NPierre Habouzit <madcoder@debian.org>
      19247e55
  18. 19 9月, 2007 1 次提交
  19. 17 9月, 2007 1 次提交
  20. 11 9月, 2007 1 次提交
  21. 07 6月, 2007 1 次提交
    • J
      War on whitespace · a6080a0a
      Junio C Hamano 提交于
      This uses "git-apply --whitespace=strip" to fix whitespace errors that have
      crept in to our source files over time.  There are a few files that need
      to have trailing whitespaces (most notably, test vectors).  The results
      still passes the test, and build result in Documentation/ area is unchanged.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a6080a0a
  22. 16 5月, 2007 1 次提交
  23. 21 2月, 2007 1 次提交
  24. 09 1月, 2007 2 次提交
  25. 22 12月, 2006 1 次提交
    • S
      Rename imap-send's internal info/warn functions. · 51dcaa96
      Shawn O. Pearce 提交于
      Because I am about to introduce a global warn() function (much
      like the global error function) this global declaration would
      conflict with the one supplied by imap-send.  Further since
      imap-send's warn function output depends on its Quiet setting
      we cannot simply remove its internal definition and use the
      forthcoming global one.
      
      So refactor warn() -> imap_warn() and info() -> imap_info()
      (the latter was done just to be consistent in naming).
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      51dcaa96
  26. 21 12月, 2006 1 次提交
    • J
      simplify inclusion of system header files. · 85023577
      Junio C Hamano 提交于
      This is a mechanical clean-up of the way *.c files include
      system header files.
      
       (1) sources under compat/, platform sha-1 implementations, and
           xdelta code are exempt from the following rules;
      
       (2) the first #include must be "git-compat-util.h" or one of
           our own header file that includes it first (e.g. config.h,
           builtin.h, pkt-line.h);
      
       (3) system headers that are included in "git-compat-util.h"
           need not be included in individual C source files.
      
       (4) "git-compat-util.h" does not have to include subsystem
           specific header files (e.g. expat.h).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      85023577
  27. 31 10月, 2006 1 次提交
  28. 18 10月, 2006 1 次提交
  29. 03 9月, 2006 1 次提交
    • C
      Trace into a file or an open fd and refactor tracing code. · 6ce4e61f
      Christian Couder 提交于
      If GIT_TRACE is set to an absolute path (starting with a
      '/' character), we interpret this as a file path and we
      trace into it.
      
      Also if GIT_TRACE is set to an integer value greater than
      1 and lower than 10, we interpret this as an open fd value
      and we trace into it.
      
      Note that this behavior is not compatible with the
      previous one.
      
      We also trace whole messages using one write(2) call to
      make sure messages from processes do net get mixed up in
      the middle.
      
      This patch makes it possible to get trace information when
      running "make test".
      Signed-off-by: NChristian Couder <chriscool@tuxfamily.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      6ce4e61f
  30. 02 9月, 2006 1 次提交
    • S
      Replace uses of strdup with xstrdup. · 9befac47
      Shawn Pearce 提交于
      Like xmalloc and xrealloc xstrdup dies with a useful message if
      the native strdup() implementation returns NULL rather than a
      valid pointer.
      
      I just tried to use xstrdup in new code and found it to be missing.
      However I expected it to be present as xmalloc and xrealloc are
      already commonly used throughout the code.
      
      [jc: removed the part that deals with last_XXX, which I am
       finding more and more dubious these days.]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9befac47
  31. 01 9月, 2006 1 次提交
  32. 28 6月, 2006 1 次提交
  33. 19 6月, 2006 1 次提交
  34. 09 6月, 2006 1 次提交
  35. 06 4月, 2006 2 次提交