git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Linus Torvalds <torvalds@osdl.org>, git@vger.kernel.org
Subject: Re: [PATCH] Remove branch by putting a null sha1 into the ref file.
Date: Sat, 23 Sep 2006 06:45:36 +0200	[thread overview]
Message-ID: <200609230645.37773.chriscool@tuxfamily.org> (raw)
In-Reply-To: <7v3baj365g.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:
> Linus Torvalds <torvalds@osdl.org> writes:
> > It's entirely possible that the proper way to do branch deletion with
> > packed branches is to simply re-pack without the old branch, rather
> > than the negative branch model. I couldn't really decide.
>
> After playing with branch deletion issues for some time, I
> started to think it would be a lot simpler if we do not mark
> a deleted branch with 0{40}.

I also came to the same conclusion and I wonder if we could delete a branch 
by moving the file ".git/refs/heads/frotz" 
to ".git/deleted-refs/heads/frotz".
If the branch is packed we could perhaps just create 
".git/deleted-refs/heads/frotz". 

It means everytime we are looking up a ref we have to check 
in ".git/deleted-refs/" first to see if it exists.

> But the latter falls apart if we use 0{40} convention to mark a
> deleted branch. Removing .git/refs/heads/frotz/nitfol file which
> has 0{40} and creating .git/refs/heads/frotz file resurrects
> frotz/nitfol branch that is still packed.

If we move ".git/refs/heads/frotz/nitfol" 
to ".git/deleted-refs/heads/frotz/nitfol" when we remove this ref, we only 
need to try to rmdir all subdirectories under ".git/refs/heads/frotz/" and 
then ".git/refs/heads/frotz/" to see if we can 
create ".git/refs/heads/frotz", and if we can, we won't 
resurect "frotz/nitfol" because ".git/deleted-refs/heads/frotz/nitfol" 
still exists.

> Not allowing frotz 
> branch to be created only because we had deleted frotz/nitfol
> previously is not what we want either, so at that point we need
> to repack without frotz/nitfol anyway.
>
> Which makes me think that we would better repack when removing
> any existing ref.

Yes but it may not be fast and may be corruption prone.

Christian.

  reply	other threads:[~2006-09-23  4:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-18  4:54 [PATCH] Remove branch by putting a null sha1 into the ref file Christian Couder
2006-09-18  5:47 ` Junio C Hamano
2006-09-18 16:31 ` Linus Torvalds
2006-09-18 18:43   ` Junio C Hamano
2006-09-20  2:56   ` Christian Couder
2006-09-22 22:09   ` Junio C Hamano
2006-09-23  4:45     ` Christian Couder [this message]
2006-09-23  8:04       ` Junio C Hamano
2006-09-23 11:22         ` Christian Couder
2006-09-23 21:49           ` Junio C Hamano
2006-09-24  4:45             ` Christian Couder
2006-09-25  9:26               ` On ref locking Junio C Hamano
2006-09-25 17:05                 ` Daniel Barkalow
2006-09-26  4:11                   ` Junio C Hamano
2006-09-26  4:13                 ` [PATCH 1/3] Clean-up lock-ref implementation Junio C Hamano
2006-09-26  4:13                 ` [PATCH 2/3] update-ref: -d flag and ref creation safety Junio C Hamano
2006-09-26 18:05                 ` [PATCH 3/3] update a few Porcelain-ish for ref lock safety Junio C Hamano
2006-09-26 18:08                   ` Andy Whitcroft
2006-09-27  7:25                     ` 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=200609230645.37773.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=torvalds@osdl.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.
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 NNTP newsgroup(s).