1. 21 5月, 2007 1 次提交
  2. 17 5月, 2007 1 次提交
  3. 28 3月, 2007 1 次提交
    • L
      Fix "getaddrinfo()" buglet · 608d48b2
      Linus Torvalds 提交于
      At least in Linux glibc, "getaddrinfo()" has a very irritating feature (or
      bug, who knows..).
      
      Namely if you pass it in an empty string for the service name, it will
      happily and quietly consider it identical to a NULL port pointer, and
      return port number zero and no errors. Which obviously will not work.
      
      Maybe that's what it's really expected to do, although the man-page for
      getaddrinfo() certainly implies that it's a bug.
      
      So when somebody passes me a "please pull" request pointing to something
      like the following
      
      	git://git.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
      
      (note the extraneous colon at the end of the host name), git would happily
      try to connect to port 0, which would generally just cause the remote to
      not even answer, and the "connect()" will take a long time to time out.
      
      So to work around the glibc feature/bug, just notice this empty port case
      automatically. Also, add the port information to the error information
      when it fails to look up (maybe it's the host-name that fails, maybe it's
      the port-name - we should print out both).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      608d48b2
  4. 13 3月, 2007 1 次提交
  5. 21 2月, 2007 1 次提交
    • J
      Mechanical conversion to use prefixcmp() · cc44c765
      Junio C Hamano 提交于
      This mechanically converts strncmp() to use prefixcmp(), but only when
      the parameters match specific patterns, so that they can be verified
      easily.  Leftover from this will be fixed in a separate step, including
      idiotic conversions like
      
          if (!strncmp("foo", arg, 3))
      
        =>
      
          if (!(-prefixcmp(arg, "foo")))
      
      This was done by using this script in px.perl
      
         #!/usr/bin/perl -i.bak -p
         if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
                 s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
         }
         if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
                 s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
         }
      
      and running:
      
         $ git grep -l strncmp -- '*.c' | xargs perl px.perl
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cc44c765
  6. 22 1月, 2007 1 次提交
    • J
      Make sure git_connect() always give two file descriptors. · ec587fde
      Junio C Hamano 提交于
      Earlier, git_connect() returned the same fd twice or two
      separate fds, depending on the way the connection was made (when
      we are talking to the other end over a single socket, we used
      the same fd twice, and when our end is connected to a pipepair
      we used two).
      
      This forced callers who do close() and dup() to really care
      which was which, and most of the existing callers got this
      wrong, although without much visible ill effect.  Many were
      closing the same fd twice when we are talking over a single
      socket, and one was leaking a fd.
      
      This fixes it to uniformly use two separate fds, so if somebody
      wants to close only reader side can just do close() on it
      without worrying about it accidentally also closing the writer
      side or vice versa.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ec587fde
  7. 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
  8. 24 11月, 2006 2 次提交
    • J
      Allow git push to delete remote ref. · d4f694ba
      Junio C Hamano 提交于
      This allows you to say
      
      	git send-pack $URL :refs/heads/$branch
      
      to delete the named remote branch.  The refspec $src:$dst means
      replace the destination ref with the object known as $src on the
      local side, so this is a natural extension to make an empty $src
      mean "No object" to delete the target.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d4f694ba
    • J
      refs outside refs/{heads,tags} match less strongly. · 29561ad0
      Junio C Hamano 提交于
      This changes the refname matching logic used to decide which ref
      is updated with git-send-pack.  We used to error out when
      pushing 'master' when the other end has both 'master' branch and
      a tracking branch 'remotes/$name/master' but with this, 'master'
      matches only 'refs/heads/master' when both and no other 'master'
      exist.
      
      Pushing 'foo' when both heads/foo and tags/foo exist at the
      remote end is still considered an error and you would need to
      disambiguate between them by being more explicit.
      
      When neither heads/foo nor tags/foo exists at the remote,
      pushing 'foo' when there is only remotes/origin/foo is not
      ambiguous, while it still is ambiguous when there are more than
      one such weaker match (remotes/origin/foo and remotes/alt/foo,
      for example).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      29561ad0
  9. 13 9月, 2006 1 次提交
  10. 11 9月, 2006 1 次提交
  11. 06 9月, 2006 1 次提交
    • A
      send-pack: remove remote reference limit · c41e20b3
      Andy Whitcroft 提交于
      When build a pack for a push we query the remote copy for existant
      heads.  These are used to prune unnecessary objects from the pack.
      As we receive the remote references in get_remote_heads() we validate
      the reference names via check_ref() which includes a length check;
      rejecting those >45 characters in size.
      
      This is a miss converted change, it was originally designed to reject
      messages which were less than 45 characters in length (a 40 character
      sha1 and refs/) to prevent comparing unitialised memory.  check_ref()
      now gets the raw length so check for at least 5 characters.
      Signed-off-by: NAndy Whitcroft <apw@shadowen.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c41e20b3
  12. 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
  13. 24 8月, 2006 1 次提交
    • S
      Convert memcpy(a,b,20) to hashcpy(a,b). · e702496e
      Shawn Pearce 提交于
      This abstracts away the size of the hash values when copying them
      from memory location to memory location, much as the introduction
      of hashcmp abstracted away hash value comparsion.
      
      A few call sites were using char* rather than unsigned char* so
      I added the cast rather than open hashcpy to be void*.  This is a
      reasonable tradeoff as most call sites already use unsigned char*
      and the existing hashcmp is also declared to be unsigned char*.
      
      [jc: Splitted the patch to "master" part, to be followed by a
       patch for merge-recursive.c which is not in "master" yet.
      
       Fixed the cast in the latter hunk to combine-diff.c which was
       wrong in the original.
      
       Also converted ones left-over in combine-diff.c, diff-lib.c and
       upload-pack.c ]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e702496e
  14. 16 8月, 2006 2 次提交
  15. 05 7月, 2006 1 次提交
    • L
      Improve git-peek-remote · 2718ff09
      Linus Torvalds 提交于
      This makes git-peek-remote able to basically do everything that
      git-ls-remote does (but obviously just for the native protocol, so no
      http[s]: or rsync: support).
      
      The default behaviour is the same, but you can now give a mixture of
      "--refs", "--tags" and "--heads" flags, where "--refs" forces
      git-peek-remote to only show real refs (ie none of the fakey tag lookups,
      but also not the special pseudo-refs like HEAD and MERGE_HEAD).
      
      The "--tags" and "--heads" flags respectively limit the output to just
      regular tags and heads, of course.
      
      You can still also ask to limit them by name too.
      
      You can combine the flags, so
      
      	git peek-remote --refs --tags .
      
      will show all local _true_ tags, without the generated tag lookups
      (compare the output without the "--refs" flag).
      
      And "--tags --heads" will show both tags and heads, but will avoid (for
      example) any special refs outside of the standard locations.
      
      I'm also planning on adding a "--ignore-local" flag that allows us to ask
      it to ignore any refs that we already have in the local tree, but that's
      an independent thing.
      
      All this is obviously gearing up to making "git fetch" cheaper.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2718ff09
  16. 02 7月, 2006 1 次提交
  17. 28 6月, 2006 2 次提交
  18. 26 6月, 2006 1 次提交
  19. 20 6月, 2006 1 次提交
    • J
      Restore SIGCHLD to SIG_DFL where we care about waitpid(). · f0b7367c
      Junio C Hamano 提交于
      It was reported that under one implementation of socks client
      "git clone" fails with "error: waitpid failed (No child processes)",
      because "git" is spawned after setting SIGCHLD to SIG_IGN.
      
      Arguably it may be a broken setting, but we should protect
      ourselves so that we can get reliable results from waitpid() for
      the children we care about.
      
      This patch resets SIGCHLD to SIG_DFL in three places:
      
       - connect.c::git_connect() - initiators of git native
         protocol transfer are covered with this.
      
       - daemon.c::main() - obviously.
      
       - merge-index.c::main() - obviously.
      
      There are other programs that do fork() but do not waitpid():
      http-push, imap-send.  upload-pack does not either, but in the
      case of that program, each of the forked halves runs exec()
      another program, so this change would not have much effect
      there.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f0b7367c
  20. 09 6月, 2006 1 次提交
  21. 07 6月, 2006 1 次提交
  22. 22 5月, 2006 1 次提交
  23. 18 4月, 2006 1 次提交
  24. 26 1月, 2006 1 次提交
  25. 25 1月, 2006 1 次提交
    • M
      local push/pull env cleanup · 016fb48b
      Matt Draisey 提交于
      remove environment variables relating to the current repository
      before execing the 'remote' half of a local push or pull operation
      
      [jc: the original from Matt spelled out the environment variable
       names, which I changed to the preprocessor symbols defined in
       cache.h.  Also it missed GRAFT_ENVIRONMENT.]
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      016fb48b
  26. 28 12月, 2005 1 次提交
  27. 22 12月, 2005 1 次提交
  28. 23 11月, 2005 1 次提交
  29. 22 11月, 2005 3 次提交
    • Y
      GIT: Fix compilation error in connect.c · c3df8568
      YOSHIFUJI Hideaki / 吉藤英明 提交于
      Fix compilation error for gcc-2.95.
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c3df8568
    • J
      git-proxy updates. · e814bc4d
      Junio C Hamano 提交于
      This builds on top of the git-proxy mechanism Paul Collins did,
      and updates its configuration mechanism.
      
       * GIT_PROXY_COMMAND environment variable is used as the
         catch-all fallback, as in the original.  This has not
         changed.
      
       * Renames proxy configuration variables to core.gitproxy; this
         has become a multi-value variable per list discussion, most
         notably from suggestion by Linus.
      
      	[core]
      	;# matches www.kernel.org as well
      	gitproxy = netcatter for kernel.org
      	gitproxy = netscatter for sample.xz
      	gitproxy = none for mydomain.xz
      	gitproxy = netcatter-default
      
         The values are command names, followed by an optional " for "
         and domainname; the first tail-match of the domainname
         determines which proxy command is used.  An entry without "
         for " matches any domain and can be used as the default.
      
         The command name "none" is special -- it tells the mechanism
         not to use any proxy command and use the native git://
         connection.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e814bc4d
    • P
      proxy-command support for git:// · f8014776
      Paul Collins 提交于
      Here is an updated patch that first looks for GIT_PROXY_COMMAND
      in the environment and then git.proxycommand in the repository's
      configuration file.  I have left the calling convention the same
      argv[1] is the host and argv[2] is the port.
      
      I've taken the hostname parsing verbatim from git_tcp_connect(),
      so it should now support an explicit port number and whatever
      that business with the square brackets is.  (Should I move this
      to a helper function?)
      
      Regarding internal vs. external hosts, the proxy command can
      simply run netcat locally to internal hosts, so perhaps that is
      sufficient.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f8014776
  30. 20 11月, 2005 1 次提交
  31. 29 10月, 2005 3 次提交
  32. 26 10月, 2005 1 次提交
  33. 25 10月, 2005 1 次提交