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

Re: [PATCH 1/1] worktree: delete branches auto-created by 'worktree add'

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Dec 18, 2019, 19:31 UTC
Message-ID
<20191218193129.hnvaetebih4y2slt@yadavpratyush.com>
In-Reply-To
<20191214161438.16157-2-me@yadavpratyush.com>
On 14/12/19 09:44PM, Pratyush Yadav wrote:
Show 17 quoted lines
> When no branch name is supplied to 'worktree add', it creates a new
> branch based on the name of the directory the new worktree is located
> in. But when the worktree is later removed, that created branch is left
> over.
> 
> Remove that branch when removing the worktree. To make sure no commits
> are lost, the branch won't be deleted if it has moved.
> 
> An example use case of when something like this is useful is when the
> user wants to check out a separate worktree to run and test on an older
> version, but don't want to touch the current worktree. So, they create a
> worktree, run some tests, and then remove it. But this leaves behind a
> branch the user never created in the first place.
> 
> So, remove the branch if nothing was done on it.
> 
> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Ping?
-- 
Regards,
Pratyush Yadav
Previous: Pratyush YadavNext: Eric Sunshine
Message 3 of 10 in “worktree: delete branches auto-created by 'worktree add'”
  1. 0/1 worktree: delete branches auto-created by 'worktree add'Pratyush Yadav, Dec 14, 2019
  2. 1/1 worktree: delete branches auto-created by 'worktree add'Pratyush Yadav, Dec 14, 2019
  3. Pratyush YadavDec 18, 2019
  4. Eric SunshineDec 18, 2019
  5. Eric SunshineDec 27, 2019
  6. Pratyush YadavJan 4, 2020
  7. Eric SunshineJan 5, 2020
  8. Eric SunshineJan 6, 2020
  9. Pratyush YadavJan 6, 2020
  10. Eric SunshineJan 9, 2020

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.