Re: [PATCH 0/1] gitignore: ignore comments on the same line as a pattern
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 2, 2019, 06:51 UTC
- Message-ID
- <xmqqtv8rej30.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <pull.370.git.gitgitgadget@gmail.com>
"Chris Zehner via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 16 quoted lines
> Why make this change? > ===================== > > Add the ability to use # to put comments after ignore patterns. This is > useful for documenting the reason for particular ignore patterns inclusion > and structure. > > Right now a common convention in .gitignore files is to group patterns by > similarity, using new lines beginning with one or more # characters as > headings to explain these groupings. This works well when clarifying why > broad classes of things are ignored, e.g. # build artifacts followed by > several patterns. > > When leaving comments about a particular pattern it can be difficult to > distinguish comments about a single patterns from comments used for file > organization.
Not a good enough justification to break backward compatibility, I would have to say. If a single line is so tricky to deserve its own comment, perhaps a group of lines can be separated with the next group by a handful of blank lines for clarity (or the project can adopt a convention that differentiates between comments on a group and comments on an individual rule).