"Chris Zehner via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > 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).