Re: [PATCH] Remove branch by putting a null sha1 into the ref file.

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Remove branch by putting a null sha1 into the ref file.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:41

Christian Couder [off-list ref] writes:
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.
I am not sure if that would be workable.  I suspect that you
would need to do quite an involved sequence in "git branch" to
make this sequence to work with .git/deleted-refs/ scheme:

	git branch frotz/nitfol
        git pack-refs --prune
        git branch -d frotz/nitfol
        git branch frotz
        git pack-refs
        git branch -d frotz

After deleting frotz/nitfol you would create frotz/nitfol in
deleted hierarchy.  Then when you delete frotz you would need to
create frotz in deleted hierarchy, but you cannot, without
losing frotz/nitfol.

Re: [PATCH] Remove branch by putting a null sha1 into the ref file.

From: Christian Couder <hidden>
Date: 2016-06-15 22:42:41

Junio C Hamano wrote:
Christian Couder [off-list ref] writes:
quoted
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.
I am not sure if that would be workable.  I suspect that you
would need to do quite an involved sequence in "git branch" to
make this sequence to work with .git/deleted-refs/ scheme:

	git branch frotz/nitfol
        git pack-refs --prune
        git branch -d frotz/nitfol
        git branch frotz
        git pack-refs
        git branch -d frotz

After deleting frotz/nitfol you would create frotz/nitfol in
deleted hierarchy.  Then when you delete frotz you would need to
create frotz in deleted hierarchy, but you cannot, without
losing frotz/nitfol.
You are right, so what about moving ".git/refs/heads/frotz" 
to ".git/deleted-refs/heads/frotz.ref" 
or ".git/deleted-refs/heads/frotz~ref" (because "~" is forbidden in ref 
names).

Christian. 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help