From: Petr Baudis <pasky@suse.cz>
To: Shawn Pearce <spearce@spearce.org>
Cc: Alex Riesen <raa.lkml@gmail.com>, Junio C Hamano <junkio@cox.net>,
Anand Kumria <wildfire@progsoc.org>,
git@vger.kernel.org
Subject: Re: should git download missing objects?
Date: Mon, 13 Nov 2006 21:03:58 +0100 [thread overview]
Message-ID: <20061113200358.GF7201@pasky.or.cz> (raw)
In-Reply-To: <20061113195414.GD17244@spearce.org>
On Mon, Nov 13, 2006 at 08:54:14PM CET, Shawn Pearce wrote:
> Alex Riesen <fork0@t-online.de> wrote:
> > Junio C Hamano, Sun, Nov 12, 2006 20:41:23 +0100:
> > > Since this is not everyday anyway, a far easier way would be to
> > > clone-pack from the upstream into a new repository, take the
> > > pack you downloaded from that new repository and mv it into your
> > > corrupt repository. You can run fsck-objects to see if you got
> > > back everything you lost earlier.
> >
> > I get into such a situation annoyingly often, by using
> > "git clone -l -s from to" and doing some "cleanup" in the
> > origin repository. For example, it happens that I remove a tag,
> > or a branch, and do a repack or prune afterwards. The related
> > repositories, which had "accidentally" referenced the pruned
> > objects become "corrupt", as you put it.
> >
> > At the moment, if I run into the situation, I copy packs/objects from
> > all repos I have (objects/info/alternates are useful here too), run a
> > fsck-objects/repack and hope nothing is lost. It works, as I almost
> > always have "accidental" backups somewhere, but is kind of annoying to
> > setup. A tool to do this job more effectively will be very handy (at
> > least, it wont have to copy gigabytes of data over switched windows
> > network. Not often, I hope. Not _so_ many gigabytes, possibly).
cg-fetch -f locally or over HTTP should be able to fix that up, if used
cleverly.
> One of my coworkers recently lost a single loose tree object.
> We suspect his Windows virus scanner deleted the file. :-(
>
> Copying the one bad object from another repository immediately fixed
> the breakage caused, but it was very annoying to not be able to run a
> "git fetch --missing-objects" or some such. Fortunately it was just
> the one object and it was also still loose in another repository.
> scp was handy. :-)
If it's over ssh, this is still where the heavily dusty (and heavily
"plumby") git-ssh-fetch command is useful, since it can get passed an
undocumented --recover argument and then it will fetch _all_ the objects
you are missing, not assuming anything.
Perhaps I should reintroduce support for git-ssh-fetch to cg-fetch to be
used in case of -f over SSH. But it would be silly if I did that and
next Git would remove the command from its suite. Junio, what's its life
expectancy? I guess this usage scenario is something to take into
account when thinking about removing it, I know that I wanted to get rid
of it in the past but now my opinion is changing.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
next prev parent reply other threads:[~2006-11-13 20:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-12 15:44 should git download missing objects? Anand Kumria
2006-11-12 19:41 ` Junio C Hamano
2006-11-13 19:45 ` Alex Riesen
2006-11-13 19:54 ` Shawn Pearce
2006-11-13 20:03 ` Petr Baudis [this message]
2006-11-13 20:10 ` Shawn Pearce
2006-11-13 20:22 ` Junio C Hamano
2006-11-14 20:08 ` Petr Baudis
2006-11-13 20:05 ` Junio C Hamano
2006-11-13 22:52 ` Alex Riesen
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061113200358.GF7201@pasky.or.cz \
--to=pasky@suse.cz \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=raa.lkml@gmail.com \
--cc=spearce@spearce.org \
--cc=wildfire@progsoc.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).