All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Introduce git-mirror, a tool for exactly mirroring another repository.
Date: Wed, 1 Nov 2006 15:18:59 +0300	[thread overview]
Message-ID: <20061101151859.0e984d3f.vsu@altlinux.ru> (raw)
In-Reply-To: <ei8s19$e04$1@sea.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]

On Wed, 01 Nov 2006 02:08:08 +0100 Jakub Narebski wrote:

> Junio C Hamano wrote:
> > Sergey Vlasov <vsu@altlinux.ru> writes:
> >> BTW, I was thinking about the possibility to save removed refs under,
> >> e.g., refs/old/`date -I`/; maybe even non-fast-forward refs could be
> >> saved there - this will ensure that no object will ever disappear from
> >> the mirror, no matter what is done on the master side.  Obviously, in
> >> this case remote refs like refs/old/* should be filtered.
> >
> > I do not think that belongs to git-mirror.  It might be better to
> > have that option in update-ref machinery so that you would even
> > be protected from a `git branch -d` ran by mistake.

I agree - this would be even better.

What name format should be used for such saved refs?  refs/old/`date -I`
is not unique enough; probably `date --utc +%Y.%m.%d-%H.%M.%S`?  And it
would be good if multiple refs which were deleted or modified in a
non-fast-forward way during a single operation (like git-mirror) would
be saved together - which may be tricky if they are saved at the lower
level (in update-ref).

Adding the fast-forward check into update-ref also does not look nice,
but this check is required for full safety.

> Perhaps just don't remove log when branch is deleted. I tend for example
> to be careful when reordering commits on a branch, and use git branch -f
> instead of deleting and recreating branch to not lose reflog.

Keeping the reflog does not help - reflog entries are not refs, and do
not keep the referenced objects live in the repository.  Therefore old
objects will be lost when the repository is repacked and pruned.

Also, the reflog really must be deleted together with the ref itself -
otherwise it may cause a file/directory conflict when another ref is
created.  Of course, if the ref is renamed instead of deleting, the
corresponding reflog may be renamed too.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-11-01 12:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-25  4:46 [PATCH] Introduce git-mirror, a tool for exactly mirroring another repository Shawn Pearce
2006-09-26  4:45 ` Junio C Hamano
2006-09-26 21:57   ` Shawn Pearce
2006-10-31 14:42 ` Sergey Vlasov
2006-10-31 14:55   ` Shawn Pearce
2006-11-01  0:32   ` Junio C Hamano
2006-11-01  1:08     ` Jakub Narebski
2006-11-01 12:18       ` Sergey Vlasov [this message]
2006-11-01 12:23         ` Jakub Narebski
2006-11-01 16:15         ` Junio C Hamano

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=20061101151859.0e984d3f.vsu@altlinux.ru \
    --to=vsu@altlinux.ru \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.