Re: [PATCH] gitk - dont warn when deleting synonym for current head

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mark Levedahl wrote:
current checked out branch = master
HEAD contains ref: refs/heads/master
foo points to the same commit as master
I attempted to delete foo.

Note: the context menu does not allow deleting the currently checked out branch, so the referenced check is irrelevant to that.

By the way, I'm not sure how gitk can usefully do the implied check without loading the full repository DAG. The check requires finding that the referenced commit is not reachable by anything in .git/refs/* except the branch head in question, yet in general gitk has not explored all of those refs, only those explicitly given on the command line (or HEAD by default). So, unless "delete branch" is going to require a variant of "git-rev-list --all", I think the choices are either a) do what the user requested, or b) offer a "Are you sure you want to do this?" dialog followed by doing what the user asked.

git-branch -d is similarly challenged: it complains unless the branch to delete is reachable from the current HEAD, and requires -D to delete anything else. It does not check to see if the commit is otherwise reachable from .git/refs/*.

Mark
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux