Re: [PATCH] builtin-branch - allow deleting a fully specified branch-name

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

Re: [PATCH] builtin-branch - allow deleting a fully specified branch-name

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:35

Mark Levedahl [off-list ref] writes:
This change allows, for instance
	git branch -d refs/heads/foo
to succeed. Without this patch, the code just assumes that the
given branch name should be appended to "refs/heads" or
"refs/remotes", thus attempting (and failing) in the above case
to delete "refs/heads/refs/heads/foo"
Your logic is broken.

Why doesn't the user simply say "git branch -d foo"?  The command takes
"the branch name", not "arbitrary ref name".

Re: [PATCH] builtin-branch - allow deleting a fully specified branch-name

From: Mark Levedahl <hidden>
Date: 2016-06-15 22:46:35

On Thursday 09 April 2009 20:39:46 Junio C Hamano wrote:
Mark Levedahl [off-list ref] writes:
quoted
This change allows, for instance
	git branch -d refs/heads/foo
to succeed. Without this patch, the code just assumes that the
given branch name should be appended to "refs/heads" or
"refs/remotes", thus attempting (and failing) in the above case
to delete "refs/heads/refs/heads/foo"
Your logic is broken.

Why doesn't the user simply say "git branch -d foo"?  The command takes
"the branch name", not "arbitrary ref name".
1) git branch -d refs/<whatever> used to work,  I haven't bisected to find 
when this stopped working, but the change broke one of my scripts, so this is 
not new behavior, it is restoration of previous behavior.
2) If I create branch  refs/frotz/bar , how do I ever delete it?

Also, the following all work
3) git branch refs/heads/foo
4) git branch -m refs/heads/foo refs/heads/bar 
5) git  [checkout|pull|push|fetch|show] refs/heads/foo

So, why is "git branch -d" so special?

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