1. 21 1月, 2008 4 次提交
    • G
      http-push and http-fetch: handle URLs without trailing / · 3057ded0
      Grégoire Barbier 提交于
      The URL to a repository http-push and http-fetch takes should
      have a trailing slash.  Instead of failing the request, add it
      ourselves before attempting such a request.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3057ded0
    • J
      http-push: clarify the reason of error from the initial PROPFIND request · 325ce395
      Junio C Hamano 提交于
      The first thing http-push does is a PROPFIND to see if the other
      end supports locking.  The failure message we give is always
      reported as "no DAV locking support at the remote repository",
      regardless of the reason why we ended up not finding the locking
      support on the other end.
      
      This moves the code to report "no DAV locking support" down the
      codepath so that the message is issued only when we successfully
      get a response to PROPFIND and the other end say it does not
      support locking.  Other failures, such as connectivity glitches
      and credential mismatches, have their own error message issued
      and we will not issue "no DAV locking" error (we do not even
      know if the remote end supports it).
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      325ce395
    • G
      http-push: fail when info/refs exists and is already locked · 9bdbabad
      Grégoire Barbier 提交于
      Failing instead of silently not updating remote refs makes the things
      clearer for the user when trying to push on a repository while another
      person do (or while a dandling locks are waiting for a 10 minutes
      timeout).
      
      When silently not updating remote refs, the user does not even know
      that git has pushed the objects but leaved the refs as they were
      before (e.g. a new bunch of commits on branch "master" is uploaded,
      however the branch by itsel still points on the previous head commit).
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9bdbabad
    • G
      http-push: fix webdav lock leak. · 9116de59
      Grégoire Barbier 提交于
      Releasing webdav lock even if push fails because of bad (or no)
      reference on command line.
      
      To reproduce the issue that this patch fixes, prepare a test repository
      availlable over http+webdav, say at http://myhost/myrepo.git/
      
      Then:
      
        $ git clone http://myhost/myrepo.git/
        $ cd myrepo
        $ git push http
        Fetching remote heads...
          refs/
          refs/heads/
          refs/tags/
        No refs in common and none specified; doing nothing.
        $ git push http
        Fetching remote heads...
          refs/
          refs/heads/
          refs/tags/
        No refs in common and none specified; doing nothing.
        $
      
      Finally, you look at the web server logs, and will find one LOCK query
      and no UNLOCK query, of course the second one will be in 423 return
      code instead of 200:
      
      1.2.3.4 - gb [19/Jan/2008:14:24:56 +0100] "LOCK /myrepo.git/info/refs HTTP/1.1" 200 465
      (...)
      1.2.3.4 - gb [19/Jan/2008:14:25:10 +0100] "LOCK /myrepo.git/info/refs HTTP/1.1" 423 363
      
      With this patch, there would have be two UNLOCKs in addition of the LOCKs
      
      From the user's point of view:
      
      - If you realize that you should have typed e.g. "git push http
        master" instead of "git push http", you will have to wait for 10
        minutes for the lock to expire by its own.
      
      - Furthermore, if somebody else is dumb enough to type "git push http"
        while you need to push "master" branch, then you'll need too to wait
        for 10 minutes too.
      Signed-off-by: NGr.ANigoire Barbier <gb@gbarbier.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9116de59
  2. 19 1月, 2008 1 次提交
  3. 31 12月, 2007 1 次提交
  4. 15 12月, 2007 6 次提交
  5. 13 12月, 2007 1 次提交
  6. 26 11月, 2007 1 次提交
  7. 10 11月, 2007 1 次提交
    • A
      Teach send-pack a mirror mode · 28b9d6e5
      Andy Whitcroft 提交于
      Existing "git push --all" is almost perfect for backing up to
      another repository, except that "--all" only means "all
      branches" in modern git, and it does not delete old branches and
      tags that exist at the back-up repository that you have removed
      from your local repository.
      
      This teaches "git-send-pack" a new "--mirror" option.  The
      difference from the "--all" option are that (1) it sends all
      refs, not just branches, and (2) it deletes old refs you no
      longer have on the local side from the remote side.
      
      Original patch by Junio C Hamano.
      Signed-off-by: NAndy Whitcroft <apw@shadowen.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      28b9d6e5
  8. 04 11月, 2007 1 次提交
  9. 03 11月, 2007 1 次提交
    • D
      Miscellaneous const changes and utilities · 4577370e
      Daniel Barkalow 提交于
      The list of remote refs in struct transport should be const, because
      builtin-fetch will get confused if it changes.
      
      The url in git_connect should be const (and work on a copy) instead of
      requiring the caller to copy it.
      
      match_refs doesn't modify the refspecs it gets.
      
      get_fetch_map and get_remote_ref don't change the list they get.
      
      Allow transport get_refs_list methods to modify the struct transport.
      
      Add a function to copy a list of refs, when a function needs a mutable
      copy of a const list.
      
      Add a function to check the type of a ref, as per the code in connect.c
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4577370e
  10. 16 10月, 2007 1 次提交
  11. 19 9月, 2007 4 次提交
  12. 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
  13. 21 5月, 2007 1 次提交
  14. 06 4月, 2007 1 次提交
  15. 22 3月, 2007 1 次提交
  16. 02 3月, 2007 1 次提交
  17. 01 3月, 2007 1 次提交
  18. 27 2月, 2007 1 次提交
    • N
      convert object type handling from a string to a number · 21666f1a
      Nicolas Pitre 提交于
      We currently have two parallel notation for dealing with object types
      in the code: a string and a numerical value.  One of them is obviously
      redundent, and the most used one requires more stack space and a bunch
      of strcmp() all over the place.
      
      This is an initial step for the removal of the version using a char array
      found in object reading code paths.  The patch is unfortunately large but
      there is no sane way to split it in smaller parts without breaking the
      system.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      21666f1a
  19. 21 2月, 2007 2 次提交
    • J
      prefixcmp(): fix-up leftover strncmp(). · 1968d77d
      Junio C Hamano 提交于
      There were instances of strncmp() that were formatted improperly
      (e.g. whitespace around parameter before closing parenthesis)
      that caused the earlier mechanical conversion step to miss
      them.  This step cleans them up.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1968d77d
    • 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
  20. 28 1月, 2007 1 次提交
    • J
      Don't force everybody to call setup_ident(). · 01754769
      Junio C Hamano 提交于
      Back when only handful commands that created commit and tag were
      the only users of committer identity information, it made sense
      to explicitly call setup_ident() to pre-fill the default value
      from the gecos information.  But it is much simpler for programs
      to make the call automatic when get_ident() is called these days,
      since many more programs want to use the information when updating
      the reflog.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      01754769
  21. 10 1月, 2007 1 次提交
    • S
      Don't die in git-http-fetch when fetching packs. · 1c23d794
      Shawn O. Pearce 提交于
      My sp/mmap changes to pack-check.c modified the function such that
      it expects packed_git.pack_size to be populated with the total
      bytecount of the packfile by the caller.
      
      But that isn't the case for packs obtained by git-http-fetch as
      pack_size was not initialized before being accessed.  This caused
      verify_pack to think it had 2^32-21 bytes available when the
      downloaded pack perhaps was only 305 bytes in length.  The use_pack
      function then later dies with "offset beyond end of packfile"
      when computing the overall file checksum.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1c23d794
  22. 09 1月, 2007 2 次提交
  23. 21 9月, 2006 2 次提交
    • J
      Tell between packed, unpacked and symbolic refs. · 8da19775
      Junio C Hamano 提交于
      This adds a "int *flag" parameter to resolve_ref() and makes
      for_each_ref() family to call callback function with an extra
      "int flag" parameter.  They are used to give two bits of
      information (REF_ISSYMREF and REF_ISPACKED) about the ref.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8da19775
    • J
      Add callback data to for_each_ref() family. · cb5d709f
      Junio C Hamano 提交于
      This is a long overdue fix to the API for for_each_ref() family
      of functions.  It allows the callers to specify a callback data
      pointer, so that the caller does not have to use static
      variables to communicate with the callback funciton.
      
      The updated for_each_ref() family takes a function of type
      
      	int (*fn)(const char *, const unsigned char *, void *)
      
      and a void pointer as parameters, and calls the function with
      the name of the ref and its SHA-1 with the caller-supplied void
      pointer as parameters.
      
      The commit updates two callers, builtin-name-rev.c and
      builtin-pack-refs.c as an example.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cb5d709f
  24. 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
  25. 28 8月, 2006 1 次提交
  26. 24 8月, 2006 1 次提交