Git development
 help / color / mirror / Atom feed
From: Martin Langhoff <martin.langhoff@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: cg-clone, tag objects and cg-push/git-push don't play nice
Date: Wed, 19 Oct 2005 21:10:26 +1300	[thread overview]
Message-ID: <46a038f90510190110g53c90c5t419ad6065292269e@mail.gmail.com> (raw)
In-Reply-To: <7vzmp6dlii.fsf@assigned-by-dhcp.cox.net>

On 10/19/05, Junio C Hamano <junkio@cox.net> wrote:
> Martin Langhoff <martin.langhoff@gmail.com> writes:
>
> >  + git-push is trying to walk all the refs it knows about when it does
> > the "what do I have that the repo doesn't" part, and it breaks on
> > those incomplete tag fetches.
>
> That is expected.

Hmmm. I was under the impression that if I call git-push naming a
particular head, it could restrict itself to the stuff needed for that
head only. Just to clarify, I'm running

  git-push locke.catalyst.net.nz:/var/git/moodle-test.git master:mdl-topnz-prod

> Although I do not follow Cogito development closely, I seem to
> recall that it fetched tags without making them complete at some
> point in the past; I hope it is now fixed but I am not sure.

It isn't fixed, but I'm trying to address that one :-p

> I do not understand why removing .git/refs/tags/* did not help,
> and that is the biggest thing that disturbs me in this whole
> problem report

I can't understand that either, but I manually removed all the
refs/tags, and the only heads I have are origin and master. git-push
won't let me do it until the exact point where I have removed the
object from the repo. And that's only possible on unpacked repos.

> Maybe there are some other files
> under .git/refs/ directory that had copies of them?

No. I run a test again, to make sure. Removing .git/refs/tags is not
enough, and the only refs available are origin and master.

I've come up with this awful script to resolve it, while I try to fix cg-fetch:

#usr/bin/perl -w

use strict;

my @refs = `ls .git/refs/tags`;

foreach my $ref (@refs) {
  chomp $ref;
  print "testing for a commit linked from $ref\n";
  my $commit = `git-rev-parse --verify "$ref"^{commit} 2>/dev/null`;
  if ($?) {
    # this one didn't even have a tag ref pointing to a commit!
    #unlink ".git/refs/tags/$ref"
    #  or die "cannot remove .git/refs/tags/$ref";
    #next;
  }

  # thest that we actually have the commit object...
  chomp $commit;
  my $file = `git-cat-file commit $commit  2>/dev/null`;
  if ($?) {
    # could not find the commit object, we better get rid of the
    # tagref and tagobj
    my $tagsha = `git-rev-parse --verify "$ref"  2>/dev/null`;

    chomp $tagsha;
    if ($tagsha) {
      # doublecheck it is a tag
      my $type = `git-cat-file -t $tagsha  2>/dev/null`;
      chomp $type;
      if ($type eq 'tag') {
        my $fileobj = ".git/objects/" . substr($tagsha,0,2) . '/' .
substr($tagsha,2);
        print " removing $fileobj for ref $ref tagsha $tagsha \n";
        `rm -f $fileobj`;
        unlink  ".git/refs/tags/$ref";
      }
    }
  }
}

cheers,


m

  reply	other threads:[~2005-10-19  8:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-19  6:38 cg-clone, tag objects and cg-push/git-push don't play nice Martin Langhoff
2005-10-19  7:16 ` Junio C Hamano
2005-10-19  8:10   ` Martin Langhoff [this message]
2005-10-19  8:52     ` Junio C Hamano
2005-10-19  9:06       ` Martin Langhoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46a038f90510190110g53c90c5t419ad6065292269e@mail.gmail.com \
    --to=martin.langhoff@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox