1. 04 12月, 2012 1 次提交
  2. 02 12月, 2012 6 次提交
  3. 04 7月, 2012 1 次提交
    • J
      push: don't guess at qualifying remote refs on deletion · 5742c82b
      Jeff King 提交于
      When we try to push a ref and the right-hand side of the
      refspec does not find a match, we try to create it. If it is
      not fully qualified, we try to guess where it would go in
      the refs hierarchy based on the left-hand source side. If
      the source side is not a ref, then we give up and give a
      long explanatory message.
      
      For deletions, however, this doesn't make any sense. We
      would never want to create on the remote side, and if an
      unqualified ref can't be matched, it is simply an error. The
      current code handles this already because the left-hand side
      is empty, and therefore does not give us a hint as to where
      the right-hand side should go, and we properly error out.
      Unfortunately, the error message is the long "we tried to
      qualify this, but the source side didn't let us guess"
      message, which is quite confusing.
      
      Instead, we can just be more succinct and say "we can't
      delete this because we couldn't find it". So before:
      
        $ git push origin :bogus
        error: unable to push to unqualified destination: bogus
        The destination refspec neither matches an existing ref on the remote nor
        begins with refs/, and we are unable to guess a prefix based on the source ref.
        error: failed to push some refs to '$URL'
      
      and now:
      
        $ git push origin :bogus
        error: unable to delete 'bogus': remote ref does not exist
        error: failed to push some refs to '$URL'
      
      It is tempting to also catch a fully-qualified ref like
      "refs/heads/bogus" and generate the same error message.
      However, that currently does not error out at all, and
      instead gets sent to the remote side, which typically
      generates a warning:
      
        $ git push origin:refs/heads/bogus
        remote: warning: Deleting a non-existent ref.
        To $URL
         - [deleted]         bogus
      
      While it would be nice to catch this error early, a
      client-side error would mean aborting the push entirely and
      changing push's exit code. For example, right now you can
      do:
      
        $ git push origin refs/heads/foo refs/heads/bar
      
      and end up in a state where "foo" and "bar" are deleted,
      whether both of them currently exist or not (and see an
      error only if we actually failed to contact the server).
      Generating an error would cause a regression for this use
      case.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5742c82b
  4. 23 5月, 2012 1 次提交
  5. 23 2月, 2012 4 次提交
  6. 02 2月, 2012 1 次提交
  7. 14 12月, 2011 1 次提交
  8. 14 11月, 2011 1 次提交
  9. 16 10月, 2011 2 次提交
  10. 07 10月, 2011 1 次提交
    • B
      cleanup: use internal memory allocation wrapper functions everywhere · 040a6551
      Brandon Casey 提交于
      The "x"-prefixed versions of strdup, malloc, etc. will check whether the
      allocation was successful and terminate the process otherwise.
      
      A few uses of malloc were left alone since they already implemented a
      graceful path of failure or were in a quasi external library like xdiff.
      
      Additionally, the call to malloc in compat/win32/syslog.c was not modified
      since the syslog() implemented there is a die handler and a call to the
      x-wrappers within a die handler could result in recursion should memory
      allocation fail.  This will have to be addressed separately.
      Signed-off-by: NBrandon Casey <drafnel@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      040a6551
  11. 06 10月, 2011 2 次提交
  12. 13 9月, 2011 1 次提交
  13. 08 6月, 2011 1 次提交
  14. 06 6月, 2011 1 次提交
    • J
      consider only branches in guess_remote_head · 61adfd30
      Jeff King 提交于
      The guess_remote_head function tries to figure out where a
      remote's HEAD is pointing by comparing the sha1 of the
      remote's HEAD with the sha1 of various refs found on the
      remote. However, we were too liberal in matching refs, and
      would match tags or remote tracking branches, even though
      these things could not possibly be referenced by the HEAD
      symbolic ref (since git will detach when checking them out).
      
      As a result, a clone of a remote repository with a detached
      HEAD might write "refs/tags/*" into our local HEAD, which is
      bogus. The resulting HEAD should be detached.
      
      The other related code path is remote.c's get_head_names()
      (which is used for, among other things, "set-head -a"). This was
      not affected, however, as that function feeds only refs from
      refs/heads to guess_remote_head.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      61adfd30
  15. 04 11月, 2010 1 次提交
  16. 06 7月, 2010 1 次提交
  17. 28 6月, 2010 3 次提交
  18. 08 6月, 2010 1 次提交
  19. 01 6月, 2010 1 次提交
    • G
      Rewrite dynamic structure initializations to runtime assignment · 66dbfd55
      Gary V. Vaughan 提交于
      Unfortunately, there are still plenty of production systems with
      vendor compilers that choke unless all compound declarations can be
      determined statically at compile time, for example hpux10.20 (I can
      provide a comprehensive list of our supported platforms that exhibit
      this problem if necessary).
      
      This patch simply breaks apart any compound declarations with dynamic
      initialisation expressions, and moves the initialisation until after
      the last declaration in the same block, in all the places necessary to
      have the offending compilers accept the code.
      Signed-off-by: NGary V. Vaughan <gary@thewrittenword.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      66dbfd55
  20. 20 4月, 2010 1 次提交
  21. 10 1月, 2010 1 次提交
    • T
      refactor ref status logic for pushing · 20e8b465
      Tay Ray Chuan 提交于
      Move the logic that detects up-to-date and non-fast-forward refs to a
      new function in remote.[ch], set_ref_status_for_push().
      
      Make transport_push() invoke set_ref_status_for_push() before invoking
      the push_refs() implementation. (As a side-effect, the push_refs()
      implementation in transport-helper.c now knows of non-fast-forward
      pushes.)
      
      Removed logic for detecting up-to-date refs from the push_refs()
      implementation in transport-helper.c, as transport_push() has already
      done so for it.
      
      Make cmd_send_pack() invoke set_ref_status_for_push() before invoking
      send_pack(), as transport_push() can't do it for send_pack() here.
      
      Mark the test on the return status of non-fast-forward push to fail.
      Git now exits with success, as transport.c::transport_push() does not
      check for refs with status REF_STATUS_REJECT_NONFASTFORWARD nor does it
      indicate rejected pushes with its return value.
      
      Mark the test for ref status to succeed. As mentioned earlier, refs
      might be marked as non-fast-forwards, triggering the push status
      printing mechanism in transport.c.
      Signed-off-by: NTay Ray Chuan <rctay89@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      20e8b465
  22. 18 11月, 2009 3 次提交
  23. 15 11月, 2009 1 次提交
  24. 10 11月, 2009 2 次提交
  25. 28 10月, 2009 1 次提交