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

Re: [PATCH 1/1] pull --rebase=<type>: allow single-letter abbreviations for the type

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 8, 2018, 19:51 UTC
Message-ID
<xmqqmutwfxh0.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<87sh3qrn6d.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 22 quoted lines
>> -	else if (!strcmp(value, "preserve"))
>> +	else if (!strcmp(value, "preserve") || !strcmp(value, "p"))
>>  		return REBASE_PRESERVE;
>> -	else if (!strcmp(value, "merges"))
>> +	else if (!strcmp(value, "merges") || !strcmp(value, "m"))
>>  		return REBASE_MERGES;
>> -	else if (!strcmp(value, "interactive"))
>> +	else if (!strcmp(value, "interactive") || !strcmp(value, "i"))
>>  		return REBASE_INTERACTIVE;
>
> Here 3 special cases are added...
> ...
>> +test_expect_success 'pull --rebase=i' '
>> ...
>> +'
>> +
>>  test_expect_success 'pull.rebase=invalid fails' '
>>  	git reset --hard before-preserve-rebase &&
>>  	test_config pull.rebase invalid &&
>
> ...but this test is only for 1/3. I haven't run this, but it looks like
> the tests will still pass if we remove --rebase=p and --rebase=m.

Good eyes. It's not like that parsing these three is implemented with one thing; in other words, it is not hard to break one without breaking the other two.

Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 6 of 7 in “Support git pull --rebase=i <remote> <branch>”
  1. 0/1 Support git pull --rebase=i <remote> <branch>Johannes Schindelin via GitGitGadget, Aug 4, 2018
  2. 1/1 pull --rebase=<type>: allow single-letter abbreviations for the typeJohannes Schindelin via GitGitGadget, Aug 4, 2018
  3. Junio C HamanoAug 6, 2018
  4. Johannes SchindelinAug 7, 2018
  5. Ævar Arnfjörð BjarmasonAug 7, 2018
  6. Junio C HamanoAug 8, 2018
  7. Junio C HamanoAug 8, 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.