1. 03 4月, 2013 8 次提交
  2. 28 3月, 2013 4 次提交
  3. 26 3月, 2013 8 次提交
  4. 22 3月, 2013 1 次提交
  5. 18 3月, 2013 5 次提交
    • M
      pack-refs: add fully-peeled trait · c29c46fa
      Michael Haggerty 提交于
      Older versions of pack-refs did not write peel lines for
      refs outside of refs/tags. This meant that on reading the
      pack-refs file, we might set the REF_KNOWS_PEELED flag for
      such a ref, even though we do not know anything about its
      peeled value.
      
      The previous commit updated the writer to always peel, no
      matter what the ref is. That means that packed-refs files
      written by newer versions of git are fine to be read by both
      old and new versions of git. However, we still have the
      problem of reading packed-refs files written by older
      versions of git, or by other implementations which have not
      yet learned the same trick.
      
      The simplest fix would be to always unset the
      REF_KNOWS_PEELED flag for refs outside of refs/tags that do
      not have a peel line (if it has a peel line, we know it is
      valid, but we cannot assume a missing peel line means
      anything). But that loses an important optimization, as
      upload-pack should not need to load the object pointed to by
      refs/heads/foo to determine that it is not a tag.
      
      Instead, we add a "fully-peeled" trait to the packed-refs
      file. If it is set, we know that we can trust a missing peel
      line to mean that a ref cannot be peeled. Otherwise, we fall
      back to assuming nothing.
      
      [commit message and tests by Jeff King <peff@peff.net>]
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c29c46fa
    • K
      t1507: Test that branchname@{upstream} is interpreted as branch · 617cf931
      Kacper Kornet 提交于
      Syntax branchname@{upstream} should interpret its argument as a name of
      a branch. Add the test to check that it doesn't try to interpret it as a
      refname if the branch in question does not exist.
      Signed-off-by: NKacper Kornet <draenog@pld-linux.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      617cf931
    • J
      pack-refs: write peeled entry for non-tags · 03a8eddf
      Jeff King 提交于
      When we pack an annotated tag ref, we write not only the
      sha1 of the tag object along with the ref, but also the sha1
      obtained by peeling the tag. This lets readers of the
      pack-refs file know the peeled value without having to
      actually load the object, speeding up upload-pack's ref
      advertisement.
      
      The writer marks a packed-refs file with peeled refs using
      the "peeled" trait at the top of the file. When the reader
      sees this trait, it knows that each ref is either followed
      by its peeled value, or it is not an annotated tag.
      
      However, there is a mismatch between the assumptions of the
      reader and writer. The writer will only peel refs under
      refs/tags, but the reader does not know this; it will assume
      a ref without a peeled value must not be a tag object. Thus
      an annotated tag object placed outside of the refs/tags
      hierarchy will not have its peeled value printed by
      upload-pack.
      
      The simplest way to fix this is to start writing peel values
      for all refs. This matches what the reader expects for both
      new and old versions of git.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      03a8eddf
    • J
      use parse_object_or_die instead of die("bad object") · f7892d18
      Jeff King 提交于
      Some call-sites do:
      
        o = parse_object(sha1);
        if (!o)
      	  die("bad object %s", some_name);
      
      We can now handle that as a one-liner, and get more
      consistent output.
      
      In the third case of this patch, it looks like we are losing
      information, as the existing message also outputs the sha1
      hex; however, parse_object will already have written a more
      specific complaint about the sha1, so there is no point in
      repeating it here.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f7892d18
    • J
      avoid segfaults on parse_object failure · 75a95490
      Jeff King 提交于
      Many call-sites of parse_object assume that they will get a
      non-NULL return value; this is not the case if we encounter
      an error while parsing the object.
      
      This patch adds a wrapper function around parse_object that
      handles dying automatically, and uses it anywhere we
      immediately try to access the return value as a non-NULL
      pointer (i.e., anywhere that we would currently segfault).
      
      This wrapper may also be useful in other places. The most
      obvious one is code like:
      
        o = parse_object(sha1);
        if (!o)
      	  die(...);
      
      However, these should not be mechanically converted to
      parse_object_or_die, as the die message is sometimes
      customized. Later patches can address these sites on a
      case-by-case basis.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      75a95490
  6. 17 3月, 2013 4 次提交
  7. 12 3月, 2013 1 次提交
  8. 11 3月, 2013 1 次提交
  9. 10 3月, 2013 1 次提交
  10. 09 3月, 2013 1 次提交
  11. 08 3月, 2013 3 次提交
  12. 07 3月, 2013 1 次提交
  13. 02 3月, 2013 2 次提交
    • J
      Git 1.8.1.5 · e6363a49
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e6363a49
    • T
      Make !pattern in .gitattributes non-fatal · 8b1bd024
      Thomas Rast 提交于
      Before 82dce998 (attr: more matching optimizations from .gitignore,
      2012-10-15), .gitattributes did not have any special treatment of a
      leading '!'.  The docs, however, always said
      
        The rules how the pattern matches paths are the same as in
        `.gitignore` files; see linkgit:gitignore[5].
      
      By those rules, leading '!' means pattern negation.  So 82dce998
      correctly determined that this kind of line makes no sense and should
      be disallowed.
      
      However, users who actually had a rule for files starting with a '!'
      are in a bad position: before 82dce998 '!' matched that literal
      character, so it is conceivable that users have .gitattributes with
      such lines in them.  After 82dce998 the unescaped version was
      disallowed in such a way that git outright refuses to run(!) most
      commands in the presence of such a .gitattributes.  It therefore
      becomes very hard to fix, let alone work with, such repositories.
      
      Let's at least allow the users to fix their repos: change the fatal
      error into a warning.
      
      Reported-by: mathstuf@gmail.com
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8b1bd024