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

Re: [PATCH] prevent checkout from creating branches that start with a dash

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Jul 2, 2008, 15:22 UTC
Message-ID
<3B740C23-95C7-44AD-8A36-9EFA2EEF0E8A@silverinsanity.com>
In-Reply-To
<20080702150128.GH26300@jukie.net>
On Jul 2, 2008, at 11:01 AM, Bart Trojanowski wrote:
Show 6 quoted lines
> +	if (opts.new_branch && validate_branch_name(opts.new_branch))
> +		die("git checkout: '%s' does not look like a valid branch name",
> +				opts.new_branch);
> +
> 	if (argc) {
> 		const char **pathspec = get_pathspec(prefix, argv);

Perhaps this should have !opts.force in that if? That way if someone needs something like "-mm" branch, they can have it.

And that way, if people really want to shoot themselves in the foot with a -f branch, they can? "git branch -f -b -f"?

~~ Brian
Previous: Bart TrojanowskiNext: Johannes Sixt
Message 2 of 4 in “prevent checkout from creating branches that start with a dash”
  1. prevent checkout from creating branches that start with a dashBart Trojanowski, Jul 2, 2008
  2. Brian GernhardtJul 2, 2008
  3. Johannes SixtJul 2, 2008
  4. Bart TrojanowskiJul 2, 2008

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.