From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.69 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796055732; b=svoyAmXs84O+rh6jJ1KfcSJh5suCVQgE7JWVYfmncqGzhSK4QKNdvEK47DN5EZKtq61w r1XzuLVk2KIpfDsgJcZsigO+xGY3ndqieWPn8RpfJgntj9PVuaItGLpItPHX3R778bXly J7gXeSi3AFGM88HMroKLbSlLeNuaH5J8Vwn1pJv+NFIx8Tex/+o/Dib3hgUkZX2UKGhaL RuK2zXzmC2DsCbN/vgZ4rtzIVNvPQk92MsqrB/oUiDl2QuiWR7Zia6gKGei9At4GK+tO4 ZomcY9CesWQGtq8tqjI6B4UDpA4ipeCMaiDjkQ4iE2s6HN/q4jJtKfZwPyFd4TYdcnQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796055732; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=Cg2baBCY+3Ljm4MA+Ri1AApDLLrwiT8L3AdOLrRCFgM=; b=pVNp2/2yRIDuoeoOc1my2c9MyiBoVztdgQCG1VwfsScZAsd0v2l7eAWW9Lyk6MvAegSg IUl1DxTeH8f01Eb5l943q0zjY6DDfM/RxeWWkTOSuWEjEAMg3RnNyuNWws/lNvEOJndp2 cdMBfi7A7L19k6kx7ltEF4fEaNtSLvoCeavkM9RTDrt18C/a4/DpuVkCLR4SLsWu3uTMz PxXRsCcLfGTTsUseQ2ZlEssbQAVigo4//ZhfpQYzm/udMN/njxNoqN4Bo5BSFzcSzgbuh KFurBt0hbKyko9ZVm7vf4TVRIB+CEfVzBDrKl6hhnP9eJPxE3g42KQ43vpr0fNbl6rQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--dmnk.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=oNoNsewx; arc=none smtp.remote-ip=209.85.221.69 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEC49606A330 for ; Mon, 30 Nov 2026 16:22:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BEC49606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--dmnk.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=oNoNsewx Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-4923b9fdd43so7145468f8f.3 for ; Mon, 30 Nov 2026 08:22:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796055730; x=1796660530; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Cg2baBCY+3Ljm4MA+Ri1AApDLLrwiT8L3AdOLrRCFgM=; b=oNoNsewxb5T4Isf//zNHafQusJq+o4BmZCeN39mCIOKROVBA5kwSce5+2DiT4zlmlY QXmOgDY7gF3LrRCuRqzX9TvNIXwJNRlqczwYzgIN2eyEmV60/GSP8Bxj9L2L8VqAS1Og V2NeOGh9dHdlDO5fQi2PQyn7h1KU8qMRxyyYUfzPCyCssKRix396keVF0cA9KrJxSaTw 2bKsKIkLxhs/Tz4+SdTvInUtgm0K3FVgdSr2III1SBFYhvafaNAmzRL1RQvwiQTtWhfX jVT6gysYQlUdm6Juz2LkwFFa1oaeQUKLf3sfQB61DXLtsPxkOuuLNR/mYIAjpFsul/DW Jvkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796055730; x=1796660530; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Cg2baBCY+3Ljm4MA+Ri1AApDLLrwiT8L3AdOLrRCFgM=; b=lD9PaF/QdR5V3iRWW0+J4GZxHO2TU0TCR5/kLs9ZsqwG8qClXEBxJFsy2xXOhQwTHK obVN2Cnurxkbgegq9L3xQw4UN+gdRx0O+efzkG5OrtVdj0lEC5q1k0PKO8tnC0JmI9zY 7eem7gnwSl8iGXK4BcxEKBU/dxCAvJ1dWLI5e8p1EMbvtuuVD+7myD/rJMEq+/YMQvvZ I+XCEavaB0KN6CtNY+tGrPDYohSUqYKpo8Z3lc83E10N22Wu5asZuVA3NIIcEYYLLe5d ctDL2gW6bY0+RGSkZWNouK+kcv+FxHd6/sTOBnRt1ZKlIumh5FlSlHg7kaLUwGvmiIq+ 5RVg== X-Forwarded-Encrypted: i=1; AL+hErHZja8mIHKGjq1srDNHCYe+b+ehgAQ8jAo7v6rdWwrjco93+4byveSdtByer25dVn/7dWI=@vger.kernel.org X-Gm-Message-State: APuU4Z/SMhjYOWj1wr5dZwucmtC74Tysjx3bwHgYYE9jxKCykZhMU1PY sGw7mhaUDahfRlAHBiBx/I48ZtqaC+poVH2qTNO6jPudlkpFaTrXdnJwQBbpGKx9KBaeMT34vw= = X-Received: from wrbdj18.prod.google.com ([2002:a05:6000:b12:b0:490:34df:197f]) (user=dmnk job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:4b17:b0:48e:7508:bc20 with SMTP id ffacd0b85a97d-4abaa9769c4mr66310561f8f.2.1796055729829; Mon, 30 Nov 2026 08:22:09 -0800 (PST) Date: Mon, 30 Nov 2026 17:22:08 +0100 In-Reply-To: X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261119192307.2683812-1-dmnk@google.com> <20261124180556.69724-1-dmnk@google.com> X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog Message-ID: <20261130162208.3367274-1-dmnk@google.com> Subject: Re: [PATCH v2] config: skip continued lines when matching section From: Dominik Maier To: Junio C Hamano Cc: Dominik Maier , git@vger.kernel.org, Phillip Wood , Chris Torek , dmnk+artist@google.com Content-Type: text/plain; charset="UTF-8" On Thu, Nov 26, 2026 at 02:37:38AM -0800, Junio C Hamano wrote: > We return when at the end of line, or not at '['. Otherwise we go to > the next loop. Wait...why check eol? '\r' or '\n' are certainly not > '[' so wouldn't it be the same as "if (end <= p || *p != '[')"? Wnat am > I missing? Nothing missed, "if (end <= p || *p != '[')" is strictly simpler since '*p != '['' already rejects '\r' and '\n'. > The proposed commit log message does not make it clear why we want to > reject an empty "[]". Or what should happen to say "[ ]" for that > matter. In git_parse_source(), "[]" returns 0 from get_base_var() with an empty strbuf and then stops at "var->len < 1", while "[ ]" enters get_extended_base_var(), skips whitespace, sees ']' instead of '"', and returns -1. Because git_parse_source() aborts on both rather than treating the rest of the line as a key=value that could continue onto the next line, skip_section_header() rejects both as well. Sending v3 simplifying that guard, spelling out "[]" and "[ ]" in the commit message, adding a "[ ]" test case, and rebasing cleanly onto current master. Best Dominik