Article View: linux.kernel.git
Article #4236[PATCH v2] doc: gitignore: rejoin related paragraphs
From: Matt Hunter
Date: Tue, 01 Dec 2026 23:49
Date: Tue, 01 Dec 2026 23:49
103 lines
12526 bytes
12526 bytes
Commit 0f0ce0762503 (doc: gitignore: clarify pattern base for
info/exclude and core.excludesFile, 2026-03-28) added an explanation for
interpreting patterns found in ignore files outside the working tree.
This bullet is somewhat complementary to the preceding one. A reader
may use them to better understand when patterns are interpreted relative
to the repository root. However, by inserting the bullet here, it
breaks up a sequence of a few more-closely related ones, added in
1a58bad0144d (gitignore.txt: make slash-rules more readable,
2019-06-04).
Move this bullet down below the "For example..." text, to restore the
original sequence from 1a58bad0144d while keeping the bullet after the
"If there is a separator at the beginning or middle (or both)..."
text that it builds from.
Signed-off-by: Matt Hunter <m@lfurio.us>
---
Changes in v2:
- Only move the "exclude sources" bullet (below the example), and
preserve the original order from commit 1a58bad0144d
- Link to v1: https://patch.msgid.link/20261128071613.3386188-1-m@lfurio.us
Documentation/gitignore.adoc | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc
index 7979e50f187e..a4f32f76acc9 100644
--- a/Documentation/gitignore.adoc
+++ b/Documentation/gitignore.adoc
@@ -96,11 +96,6 @@ PATTERN FORMAT
particular `.gitignore` file itself. Otherwise the pattern may also
match at any level below the `.gitignore` level.
- - Patterns read from exclude sources that are outside the working tree,
- such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
- they are specified at the root of the working tree, i.e. a leading "/"
- in such patterns anchors the match at the root of the repository.
-
- If there is a separator at the end of the pattern then the pattern
will only match directories, otherwise the pattern can match both
files and directories.
@@ -110,6 +105,11 @@ PATTERN FORMAT
and `a/frotz` that is a directory (all paths are relative from
the `.gitignore` file).
+ - Patterns read from exclude sources that are outside the working tree,
+ such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
+ they are specified at the root of the working tree, i.e. a leading "/"
+ in such patterns anchors the match at the root of the repository.
+
- An asterisk "`*`" matches anything except a slash.
The character "`?`" matches any one character except "`/`".
The range notation, e.g. `[a-zA-Z]`, can be used to match
Interdiff against v1:
diff --git a/Documentation/gitignore.adoc b/Documentation/gitignore.adoc
index 662632bdefc9..a4f32f76acc9 100644
--- a/Documentation/gitignore.adoc
+++ b/Documentation/gitignore.adoc
@@ -91,25 +91,25 @@ PATTERN FORMAT
- The slash "`/`" is used as the directory separator. Separators may
occur at the beginning, middle or end of the `.gitignore` search pattern.
- - Patterns read from exclude sources that are outside the working tree,
- such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
- they are specified at the root of the working tree, i.e. a leading "/"
- in such patterns anchors the match at the root of the repository.
-
- - If there is a separator at the end of the pattern then the pattern
- will only match directories, otherwise the pattern can match both
- files and directories.
-
- If there is a separator at the beginning or middle (or both) of the
pattern, then the pattern is relative to the directory level of the
particular `.gitignore` file itself. Otherwise the pattern may also
match at any level below the `.gitignore` level.
+ - If there is a separator at the end of the pattern then the pattern
+ will only match directories, otherwise the pattern can match both
+ files and directories.
+
- For example, a pattern `doc/frotz/` matches `doc/frotz` directory,
but not `a/doc/frotz` directory; however `frotz/` matches `frotz`
and `a/frotz` that is a directory (all paths are relative from
the `.gitignore` file).
+ - Patterns read from exclude sources that are outside the working tree,
+ such as $GIT_COMMON_DIR/info/exclude and core.excludesFile, are treated as if
+ they are specified at the root of the working tree, i.e. a leading "/"
+ in such patterns anchors the match at the root of the repository.
+
- An asterisk "`*`" matches anything except a slash.
The character "`?`" matches any one character except "`/`".
The range notation, e.g. `[a-zA-Z]`, can be used to match
base-commit: a018953688f1b10bddf91bff8747068f5f4746a4
--
2.98.0.rc0.260.g8fecd35053
Technical Details
Message-ID:
<20261201235723.1920134-1-m@lfurio.us>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76832-linux-kernel-git=dewy.ruReferences:
<20261128071613.3386188-1-m@lfurio.us>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76832-linux-kernel-git=dewy.ru From: m@lfurio.us (Matt Hunter) Newsgroups: linux.kernel.git Subject: [PATCH v2] doc: gitignore: rejoin related paragraphs Date: Tue, 1 Dec 2026 18:49:52 -0500 Organization: Usenet Network Message-ID: <20261201235723.1920134-1-m@lfurio.us> References: <20261128071613.3386188-1-m@lfurio.us> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1846503"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:IQfEQvtdsVIOyhMmzL5/1PsRIDI= sha256:RV7UYXYfAZ4WZsWCwQl77onIOIFaX/+69ZENwH+p9pk= sha1:LS0v3YlyBKDKXtBR41ic+/7qZiU= sha256:BDfkyrhBz8x0eSUbstrEUTgaOapiPS86zlA70bQcqYk= List-ID: <git.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id F18211174F3; Wed, 2 Dec 2026 02:58:24 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.951 X-Spam-Status: No, score=-1.951 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lfurio.us X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OX4hS6mJdC9K; Wed, 2 Dec 2026 02:58:21 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-76832-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lfurio.us X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id A86111174E7; Wed, 2 Dec 2026 02:58:12 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 6229F26D97; Tue, 1 Dec 2026 23:58:11 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796169490; b=nt2zG6kySu4jggSmsrrotjZdRr/NsmhXBGECEQcw75lmUDFWf0dukWZcktDJOKjla8Wa 26uQrMC8/eyaOqDbu4ilm4EK44I+ohCBG7Kt0F425jZNu5OVIXrJha/qKG1zXL5xd9MJ0 aC2xDdybWqohj7AR4qmorbW73bzH5UlFbk+bjGZ36FJdikW06jXALOo36bFesFyE2AEFf dArzB/3NXLDtsmZJwZ3CVzceTZdTmXR71Tp5NydfaLx9TNCJjw6haGPvm/AF45REB9qqk nIJN9CDiW1w0FvUCj5TQS0xDVJO0xEj8EFZ3JaErEr6suIcNoYRUXinoBzAHWNpvgaA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796169490; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=kC7cudhThE5O0PE2E5jsCe5aTSQ5DQhpUq6Ebw2rqKM=; b=cwve+sbEU6PpnCtohqFG+JNRh/sQfDdSIihyVT2zNqOnVqPoLz4kjFa4xzphudHNQ0Jv NiyMoRFssmimKGS6zPPQWyKCpLAbOsQFxX3nr3mpsqZaSgccm9zC+lfH9fsxygKm0z4s3 EKMfY6b//MZQnz2XhdDDM7/bPYVi8ZUBxo5vN7BKJmb5d+Ck4qzqmhBSpZwy9uLiSKGKP W1xdKm0jizPE+PJomYhtspzGrw+6OgrOfPEZLijFoHkM2fAb0mVCoj2GPfAri6aPI5pbu B3NGyZdNo3PlBEIrGDR7hV2VvIgj05fZOVMM0Pvw3phROyAijVuYDADQSLP2ZtU1PyA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lfurio.us header.i=@lfurio.us header.a=rsa-sha256 header.s=default header.b="f7/Beo5J"; dmarc=pass header.from=lfurio.us; spf=pass smtp.mailfrom=lfurio.us; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6ED9606A329; Tue, 1 Dec 2026 23:58:10 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lfurio.us header.i=@lfurio.us header.a=rsa-sha256 header.s=default header.b=f7/Beo5J X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=157.230.60.252 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796169489; b=vYnISc72UDWirCrjsuF44cO/qNmaJFjmLrR//y4MzQG4uKKAI2e6UKVmnVVzun6PAOMS oiqkTOGYMSXcaijW3GPcHvbCUvB1UTO2JI2rZnNMSKbluTd8VwpQqMNbph33xkeA+M/mW I1XfX0aSRTsOYFf0xzj1NlB/9uXEryDqsOEeeU72MXjF71a+uw4T2w7ViPS4SFONxRwle 3Smh4RX3xy2X7SP9d9e5SpBZVvdPOZUBVQo0v6UZ4EOOSmRvwYlvEgKOjWln1m2y0IZfk F95fbAMrIQ9Fc7YTM2GYDQPyUfV5v5HFAuIXVXQrOdpmUYoqgGYLpeIjMFtZFYY6cpg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796169489; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=kC7cudhThE5O0PE2E5jsCe5aTSQ5DQhpUq6Ebw2rqKM=; b=gUyflC4UQ8RHPuiy0bUyhE6iN5nbB80nrHNecugxzQPRa6NTgHAr7RbHiz9rFY8tbVLX 2VijZSOalqalnJs/dpH81ceTGFbNKlsWtWG2kqyI92nuTZrxIUdsqOcNS4ePPpbX+cR8E 3EXwv5XNkl2MiWzFcX5aUYpAKnF864Xlqkh3bq3WIUgaVxEFLQDUzDbr+f4mgz2Hf1/yo w4WGCITzFTWNzoTawBIEUEOGKPQmiPQNMLnZJTDzu4qTLwbkODnjilktCq+q3vd6n66fI WvvEyBqnsrgE28QZlJcOT6OEitKKBZGW+acn37/v2++A3CYnMpqgVO8L6R36JY3Zzpw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lfurio.us; spf=pass smtp.mailfrom=lfurio.us; dkim=pass header.d=lfurio.us header.i=@lfurio.us header.a=rsa-sha256 header.s=default header.b="f7/Beo5J"; arc=none smtp.remote-ip=157.230.60.252 X-Received: from mail.normalmode.org (h01.normalmode.org [157.230.60.252]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20E37606A31A for <git@vger.kernel.org>; Tue, 1 Dec 2026 23:58:08 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 20E37606A31A X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lfurio.us X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lfurio.us X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lfurio.us; s=default; t=1796169488; bh=wyzEu3zDG0Oi2quYcCOt/oUczMu38FqSOD5ol+81p6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7/Beo5JyHPjCMQDrLQtluduA19nmTmFkA7Kxo3jjlVCIJftxSI//+8k9rAZoUf2p JXZV8oVA2h6vlMx50e4l341pvmLBWlEJoS7uQKWQZ/No6y69uHifpC3GgUc/tQwEL9 QMghzdb4GNgBHv0KKqLlHtkXhQg2gF7D+gpOWEWI= X-Received: by mail.normalmode.org (Postfix) with ESMTPSA id D4B32640AA; Tue, 1 Dec 2026 23:58:07 +0000 (UTC) X-Cc: Junio C Hamano <gitster@pobox.com> X-Mailer: git-send-email 2.98.0.rc0.260.g8fecd35053 X-In-Reply-To: <20261128071613.3386188-1-m@lfurio.us> X-Mailing-List: git@vger.kernel.org X-List-Post: <mailto:git@vger.kernel.org> X-List-Help: <mailto:git+help@vger.kernel.org> X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:git+owner@vger.kernel.org> X-Precedence: list