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

[PATCH] worktree: accept -f as short for --force for removal

From
Stefan Beller <sbeller@google.com>
Date
Apr 16, 2018, 22:16 UTC
Message-ID
<20180416221654.49454-1-sbeller@google.com>

The force flag is very common in many commands and is commonly abbreviated with '-f', so add that to worktree removal, too

Signed-off-by: Stefan Beller <sbeller@google.com>
---
As a side note:
 $ git worktree add ../test HEAD^
 $ cd ../test
 $ make
 $ git worktree remove test
 fatal: working trees containing submodules cannot be moved or removed
 
 (This is on git.git, which does have submodules, but they should not 
 be relevant here? Instead we rather want to point out files left over.
 Not sure. I also plan on having worktrees and submodules to work well
 together eventually)
 builtin/worktree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 40a438ed6c..d734874d58 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -783,7 +783,7 @@ static int remove_worktree(int ac, const char **av, const char *prefix)
 {
 	int force = 0;
 	struct option options[] = {
-		OPT_BOOL(0, "force", &force,
+		OPT_BOOL('f', "force", &force,
 			 N_("force removing even if the worktree is dirty")),
 		OPT_END()
 	};
-- 
2.17.0.484.g0c8726318c-goog
Next: Eric Sunshine
Message 1 of 6 in “worktree: accept -f as short for --force for removal”
  1. worktree: accept -f as short for --force for removalStefan Beller, Apr 16, 2018
  2. Eric SunshineApr 17, 2018
  3. worktree: accept -f as short for --force for removalStefan Beller, Apr 17, 2018
  4. Eric SunshineApr 17, 2018
  5. Junio C HamanoApr 18, 2018
  6. Eric SunshineApr 18, 2018

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.