git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Aug 13, 2007, 01:51 UTC
Message-ID
<46BFB908.7050000@gmail.com>
In-Reply-To
<46BFAF8E.1000508@verizon.net>
Mark Levedahl wrote:
Show 8 quoted lines
> 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
Previous: Mark LevedahlNext: Paul Mackerras
Message 4 of 7 in “gitk - dont warn when deleting synonym for current head”
  1. gitk - dont warn when deleting synonym for current headMark Levedahl, Aug 12, 2007
  2. Paul MackerrasAug 12, 2007
  3. Mark LevedahlAug 13, 2007
  4. Mark LevedahlAug 13, 2007
  5. Paul MackerrasAug 13, 2007
  6. Mark LevedahlAug 13, 2007
  7. Mark LevedahlAug 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.