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

Re: [PATCH 2/2] checkout: die() on ambiguous tracking branches

From
AMAlexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Date
Nov 27, 2019, 16:42 UTC
Message-ID
<94480425-1827-48d6-b7d7-966acc536c6c@syntevo.com>
In-Reply-To
<b6963515-1f28-74ab-42bc-a14a07856118@gmail.com>
On 27.11.2019 15:46, Derrick Stolee wrote:
>> +	if (!remote && (num_matches > 1)) {
> 
> I believe the parentheses around "num_matched > 1" are not needed here.
Fixed in v2.
Show 6 quoted lines
> I like that you added a test for this non-obvious situation. One thing that
> would help ensure that your test is checking the right thing is to redirect
> stderr to a file and grep for the die() message you included. Something like:
> 
> 	test_must_fail git checkout ambiguous_branch_and_file 2>err &&
> 	test_i18ngrep "matched multiple (2) remote tracking branches" err &&
This is a good idea, thanks! Added in v2.
Previous: Derrick StoleeNext: Ævar Arnfjörð Bjarmason
Message 5 of 13 in “checkout: die() on ambiguous tracking branches”
  1. 0/2 checkout: die() on ambiguous tracking branchesAlexandr Miloslavskiy via GitGitGadget, Nov 27, 2019
  2. 1/2 parse_branchname_arg(): extract part as new functionAlexandr Miloslavskiy via GitGitGadget, Nov 27, 2019
  3. 2/2 checkout: die() on ambiguous tracking branchesAlexandr Miloslavskiy via GitGitGadget, Nov 27, 2019
  4. Derrick StoleeNov 27, 2019
  5. Alexandr MiloslavskiyNov 27, 2019
  6. Ævar Arnfjörð BjarmasonNov 27, 2019
  7. Alexandr MiloslavskiyNov 27, 2019
  8. Alexandr MiloslavskiyDec 5, 2019
  9. 0/2 checkout: die() on ambiguous tracking branchesAlexandr Miloslavskiy via GitGitGadget, Nov 27, 2019
  10. 2/2 checkout: die() on ambiguous tracking branchesAlexandr Miloslavskiy via GitGitGadget, Nov 27, 2019
  11. 1/2 parse_branchname_arg(): extract part as new functionAlexandr Miloslavskiy via GitGitGadget, Nov 27, 2019
  12. Junio C HamanoDec 1, 2019
  13. Alexandr MiloslavskiyDec 1, 2019

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.