git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Ignore trailing spaces in .gitignore
@ 2014-02-08  8:10 Nguyễn Thái Ngọc Duy
  2014-02-08  8:10 ` [PATCH 1/2] dir: warn about trailing spaces in exclude pattern Nguyễn Thái Ngọc Duy
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2014-02-08  8:10 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

Trailing spaces are invisible in most standard editors (*). "git diff"
does show trailing spaces by default. But that does not help newly
written .gitignore files. And trailing spaces are the source of
frustration when writing .gitignore.

So let's ignore them. Nobody sane would put a trailing space in file
names. But we could be careful and do it in two steps: warn first,
then ignore trailing spaces. Another option is merge two patches in
one and be done with it.

People can still quote trailing spaces, which will not be ignored (and
much more visible). Quoting comes with a cost of doing fnmatch(). But
I won't optimize it until I see someone shows me they have a use case
for it.

(*) either that or my coworkers keep pissing me off on purpose when
    they never clean trailing spaces.

Nguyễn Thái Ngọc Duy (2):
  dir: warn about trailing spaces in exclude pattern
  dir: ignore trailing spaces in exclude patterns

 Documentation/gitignore.txt | 3 +++
 dir.c                       | 9 +++++++++
 2 files changed, 12 insertions(+)

-- 
1.8.5.2.240.g8478abd

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-02-10  5:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-08  8:10 [PATCH 0/2] Ignore trailing spaces in .gitignore Nguyễn Thái Ngọc Duy
2014-02-08  8:10 ` [PATCH 1/2] dir: warn about trailing spaces in exclude pattern Nguyễn Thái Ngọc Duy
2014-02-08 14:33   ` Torsten Bögershausen
2014-02-08  8:10 ` [PATCH 2/2] dir: ignore trailing spaces in exclude patterns Nguyễn Thái Ngọc Duy
2014-02-08 16:45 ` [PATCH 0/2] Ignore trailing spaces in .gitignore Jeff King
2014-02-08 23:48   ` Duy Nguyen
2014-02-10  1:19     ` Jeff King
2014-02-09  0:26 ` [PATCH v2 " Nguyễn Thái Ngọc Duy
2014-02-09  0:26   ` [PATCH v2 1/2] dir: warn about trailing spaces in exclude patterns Nguyễn Thái Ngọc Duy
2014-02-09  0:26   ` [PATCH v2 2/2] dir: ignore " Nguyễn Thái Ngọc Duy
2014-02-10  4:07 ` [PATCH 0/2] Ignore trailing spaces in .gitignore Junio C Hamano
2014-02-10  4:29   ` Duy Nguyen
2014-02-10  5:04   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).