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

Re: [PATCH] merge: allow to pretend a merge into detached HEAD is made into a branch

From
Derrick Stolee <stolee@gmail.com>
Date
Dec 20, 2021, 15:36 UTC
Message-ID
<b52be977-f03c-7915-68c8-f1842e920184@gmail.com>
In-Reply-To
<211218.86sfuqw6ii.gmgdl@evledraar.gmail.com>
On 12/18/2021 5:27 AM, Ævar Arnfjörð Bjarmason wrote:
Show 11 quoted lines
> 
> On Fri, Dec 17 2021, Junio C Hamano wrote:
> 
>> +		OPT_STRING(0, "detached", &detached_head_name, N_("name"),
>> +			   N_("use <name> instead of detached HEAD")),
>> [...]
>> +	OPT_STRING(0, "detached", &detached_head_name, N_("name"),
>> +		   N_("use <name> instead of detached HEAD")),
> 
> Maybe OPT_STRING_F and PARSE_OPT_NONEG, or does --no-detached make
> sense?

While sometimes undocumented, these "--no-" options allows calling an alias that might have the positive version included while disabling the option.

	git alias merge-main merge <lots-of-custom-things> --detached-head-name=main
	git merge-main --no-detached-head-name
So, I think using the standard OPT_STRING here is fine.

Thanks, -Stolee

Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 7 of 8 in “merge: allow to pretend a merge into detached HEAD is made into a branch”
  1. merge: allow to pretend a merge into detached HEAD is made into a branchJunio C Hamano, Dec 18, 2021
  2. Sergey OrganovDec 18, 2021
  3. Junio C HamanoDec 20, 2021
  4. merge: allow to pretend a merge is made into a different branchJunio C Hamano, Dec 20, 2021
  5. Derrick StoleeDec 21, 2021
  6. Ævar Arnfjörð BjarmasonDec 18, 2021
  7. Derrick StoleeDec 20, 2021
  8. Junio C HamanoDec 20, 2021

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.