1. 31 12月, 2006 1 次提交
  2. 30 12月, 2006 1 次提交
    • J
      send-pack: fix pipeline. · e40a9e2c
      Junio C Hamano 提交于
      send-pack builds a pipeline that runs "rev-list | pack-objects"
      and sends the output from pack-objects to the other side, while
      feeding the input side of that pipe from itself.  However, the
      file descriptor that is given to this pipeline (so that it can
      be dup2(2)'ed into file descriptor 1 of pack-objects) is closed
      by the caller before the complex fork+exec dance!  Worse yet,
      the caller already dup2's it to 1, so the child process did not
      even have to.
      
      I do not understand how this code could possibly have been
      working, but it somehow was working by accident.
      
      Merging the sliding mmap() code reveals this problem, presumably
      because it keeps one extra file descriptor open for a packfile
      and changes the way file descriptors are allocated.  I am too
      tired to diagnose the problem now, but this seems to be a
      sensible fix.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e40a9e2c
  3. 14 12月, 2006 1 次提交
    • J
      send-pack: tighten checks for remote names · 37adac76
      Junio C Hamano 提交于
      "git push $URL HEAD~6" created a bogus ref HEAD~6 immediately
      under $GIT_DIR of the remote repository.  While we should keep
      refspecs that have arbitrary extended SHA-1 expression on the
      source side working (e.g. "HEAD~6:refs/tags/yesterday"), we
      should not create bogus ref on the other end.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      37adac76
  4. 24 11月, 2006 1 次提交
    • 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
  5. 02 11月, 2006 1 次提交
  6. 31 10月, 2006 1 次提交
  7. 29 10月, 2006 1 次提交
    • J
      send-pack --keep: do not explode into loose objects on the receiving end. · c7740a94
      Junio C Hamano 提交于
      This adds "keep-pack" extension to send-pack vs receive pack protocol,
      and makes the receiver invoke "index-pack --stdin --fix-thin".
      
      With this, you can ask send-pack not to explode the result into
      loose objects on the receiving end.
      
      I've patched has_sha1_file() to re-check for added packs just
      like is done in read_sha1_file() for now, but I think the static
      "re-prepare" interface for packs was a mistake.  Creation of a
      new pack inside a process that needs to read objects in them
      back ought to be a rare event, so we are better off making the
      callers (such as receive-pack that calls "index-pack --stdin
      --fix-thin") explicitly call re-prepare.  That way we do not
      have to penalize ordinary users of read_sha1_file() and
      has_sha1_file().
      
      We would need to fix this someday.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c7740a94
  8. 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
  9. 14 9月, 2006 1 次提交
  10. 07 9月, 2006 1 次提交
    • A
      send-pack: switch to using git-rev-list --stdin · c727fe2a
      Andy Whitcroft 提交于
      When we are generating packs to update remote repositories we
      want to supply as much information as possible about the revisions
      that already exist to rev-list in order optimise the pack as much
      as possible.  We need to pass two revisions for each branch we are
      updating in the remote repository and one for each additional branch.
      Where the remote repository has numerous branches we can run out
      of command line space to pass them.
      
      Utilise the git-rev-list --stdin mode to allow unlimited numbers
      of revision constraints.  This allows us to move back to the much
      simpler unordered revision selection code.
      
      [jc: added some comments in the code to describe the pipe flow
       a bit.]
      Signed-off-by: NAndy Whitcroft <apw@shadowen.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c727fe2a
  11. 01 9月, 2006 1 次提交
  12. 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
  13. 18 8月, 2006 1 次提交
  14. 16 8月, 2006 1 次提交
  15. 15 8月, 2006 1 次提交
  16. 13 7月, 2006 1 次提交
  17. 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
  18. 18 6月, 2006 1 次提交
    • L
      Shrink "struct object" a bit · 885a86ab
      Linus Torvalds 提交于
      This shrinks "struct object" by a small amount, by getting rid of the
      "struct type *" pointer and replacing it with a 3-bit bitfield instead.
      
      In addition, we merge the bitfields and the "flags" field, which
      incidentally should also remove a useless 4-byte padding from the object
      when in 64-bit mode.
      
      Now, our "struct object" is still too damn large, but it's now less
      obviously bloated, and of the remaining fields, only the "util" (which is
      not used by most things) is clearly something that should be eventually
      discarded.
      
      This shrinks the "git-rev-list --all" memory use by about 2.5% on the
      kernel archive (and, perhaps more importantly, on the larger mozilla
      archive). That may not sound like much, but I suspect it's more on a
      64-bit platform.
      
      There are other remaining inefficiencies (the parent lists, for example,
      probably have horrible malloc overhead), but this was pretty obvious.
      
      Most of the patch is just changing the comparison of the "type" pointer
      from one of the constant string pointers to the appropriate new TYPE_xxx
      small integer constant.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      885a86ab
  19. 24 3月, 2006 1 次提交
  20. 05 3月, 2006 1 次提交
    • J
      Const tightening. · 9201c707
      Junio C Hamano 提交于
      Mark Wooding noticed there was a type mismatch warning in git.c; this
      patch does things slightly differently (mostly tightening const) and
      was what I was holding onto, waiting for the setup-revisions change
      to be merged into the master branch.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9201c707
  21. 22 2月, 2006 1 次提交
  22. 20 2月, 2006 1 次提交
  23. 14 1月, 2006 1 次提交
    • M
      Exec git programs without using PATH. · 77cb17e9
      Michal Ostrowski 提交于
      The git suite may not be in PATH (and thus programs such as
      git-send-pack could not exec git-rev-list).  Thus there is a need for
      logic that will locate these programs.  Modifying PATH is not
      desirable as it result in behavior differing from the user's
      intentions, as we may end up prepending "/usr/bin" to PATH.
      
      - git C programs will use exec*_git_cmd() APIs to exec sub-commands.
      - exec*_git_cmd() will execute a git program by searching for it in
        the following directories:
      	1. --exec-path (as used by "git")
      	2. The GIT_EXEC_PATH environment variable.
      	3. $(gitexecdir) as set in Makefile (default value $(bindir)).
      - git wrapper will modify PATH as before to enable shell scripts to
        invoke "git-foo" commands.
      
      Ideally, shell scripts should use the git wrapper to become independent
      of PATH, and then modifying PATH will not be necessary.
      
      [jc: with minor updates after a brief review.]
      Signed-off-by: NMichal Ostrowski <mostrows@watson.ibm.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      77cb17e9
  24. 28 12月, 2005 1 次提交
  25. 23 12月, 2005 1 次提交
    • J
      send-pack: reword non-fast-forward error message. · 69310a34
      Junio C Hamano 提交于
      Wnen refusing to push a head, we said cryptic "remote 'branch'
      object X does not exist on local" or "remote ref 'branch' is not
      a strict subset of local ref 'branch'".  That was gittish.
      
      Since the most likely reason this happens is because the pushed
      head was not up-to-date, clarify the error message to say that
      straight, and suggest pulling first.
      
      First noticed by Johannes and seconded by Andreas.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      69310a34
  26. 22 12月, 2005 1 次提交
  27. 21 12月, 2005 1 次提交
    • L
      Make "git-send-pack" less verbose by default · 41f93a2c
      Linus Torvalds 提交于
      It used to make sense to have git-send-pack talk about the things it sent
      when (a) it was a new program and (b) nobody had a lot of tags and
      branches.
      
      These days, it's just distracting to see tons of
      
      	'refs/tags/xyz': up-to-date
      	...
      
      when updating a remote repo.
      
      So shut it up by default, and add a "--verbose" flag for those who really
      want to see it.
      
      Also, since this makes he case of everything being up-to-date just totally
      silent, make it say "Everything up-to-date" if no refs needed updating.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      41f93a2c
  28. 14 12月, 2005 1 次提交
  29. 05 12月, 2005 1 次提交
  30. 29 11月, 2005 1 次提交
  31. 03 11月, 2005 1 次提交
    • J
      Be careful when dereferencing tags. · 9534f40b
      Junio C Hamano 提交于
      One caller of deref_tag() was not careful enough to make sure
      what deref_tag() returned was not NULL (i.e. we found a tag
      object that points at an object we do not have).  Fix it, and
      warn about refs that point at such an incomplete tag where
      needed.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9534f40b
  32. 16 10月, 2005 2 次提交
  33. 25 8月, 2005 1 次提交
  34. 06 8月, 2005 1 次提交
    • J
      Fix ref_newer() in send-pack. · 51b0fca0
      Junio C Hamano 提交于
      When more than two references need to be checked with
      ref_newer() function, the second and later calls did not work
      correctly.  This was because the later calls found commits
      retained by the "struct object" layer that still had smudges
      made by earlier calls.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      51b0fca0
  35. 05 8月, 2005 1 次提交
    • J
      Fix send-pack for non-commitish tags. · 37fde874
      Junio C Hamano 提交于
      Again I left the v2.6.11-tree tag behind.  My bad.
      
      This commit makes sure that we do not barf when pushing a ref
      that is a non-commitish tag.  You can update a remote ref under
      the following conditions:
      
       * You can always use --force.
       * Creating a brand new ref is OK.
       * If the remote ref is exactly the same as what you are
         pushing, it is OK (nothing is pushed).
       * You can replace a commitish with another commitish which is a
         descendant of it, if you can verify the ancestry between them;
         this and the above means you have to have what you are replacing.
       * Otherwise you cannot update; you need to use --force.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      37fde874
  36. 04 8月, 2005 2 次提交
    • J
      Renaming push. · f88395ac
      Junio C Hamano 提交于
      This allows git-send-pack to push local refs to a destination
      repository under different names.
      
      Here is the name mapping rules for refs.
      
      * If there is no ref mapping on the command line:
      
       - if '--all' is specified, it is equivalent to specifying
         <local> ":" <local> for all the existing local refs on the
         command line
       - otherwise, it is equivalent to specifying <ref> ":" <ref> for
         all the refs that exist on both sides.
      
      * <name> is just a shorthand for <name> ":" <name>
      
      * <src> ":" <dst>
      
        push ref that matches <src> to ref that matches <dst>.
      
        - It is an error if <src> does not match exactly one of local
          refs.
      
        - It is an error if <dst> matches more than one remote refs.
      
        - If <dst> does not match any remote refs, either
      
          - it has to start with "refs/"; <dst> is used as the
            destination literally in this case.
      
          - <src> == <dst> and the ref that matched the <src> must not
            exist in the set of remote refs; the ref matched <src>
            locally is used as the name of the destination.
      
      For example,
      
        - "git-send-pack --all <remote>" works exactly as before;
      
        - "git-send-pack <remote> master:upstream" pushes local master
          to remote ref that matches "upstream".  If there is no such
          ref, it is an error.
      
        - "git-send-pack <remote> master:refs/heads/upstream" pushes
          local master to remote refs/heads/upstream, even when
          refs/heads/upstream does not exist.
      
        - "git-send-pack <remote> master" into an empty remote
          repository pushes the local ref/heads/master to the remote
          ref/heads/master.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f88395ac
    • J
      send-pack: handle partial pushes correctly. · 40b64d47
      Junio C Hamano 提交于
      When pushing into multi-user repository, or when pushing to a
      repository from a local repository that has rebased branches
      that has been pruned, the destination repository can have head
      commits that are missing from the local repository.
      
      This should not matter as long as the local head of the branch
      being pushed is a proper superset of the destination branch, but
      we ended up trying to run rev-list telling it to exclude objects
      reachable from those heads missing from the local repository,
      causing it to barf.  Prune those heads from the rev-list
      parameter list, and make sure we do not try to push a branch
      whose remote head is something we lack.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      40b64d47
  37. 03 8月, 2005 1 次提交