From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: "Carlos Martín Nieto" <cmn@elego.de>
Cc: git@vger.kernel.org, git-owner@vger.kernel.org
Subject: Re: [PATCH] dir: allow a BOM at the beginning of exclude files
Date: Thu, 16 Apr 2015 17:03:05 +0200 [thread overview]
Message-ID: <13f82e720ac12a6bc12e8b9f566dd48e@www.dscho.org> (raw)
In-Reply-To: <1429193112-41184-1-git-send-email-cmn@elego.de>
Hi Carlos,
On 2015-04-16 16:05, Carlos Martín Nieto wrote:
> Some text editors like Notepad or LibreOffice write an UTF-8 BOM in
> order to indicate that the file is Unicode text rather than whatever the
> current locale would indicate.
>
> If someone uses such an editor to edit a gitignore file, we are left
> with those three bytes at the beginning of the file. If we do not skip
> them, we will attempt to match a filename with the BOM as prefix, which
> won't match the files the user is expecting.
>
> ---
>
> If you're wondering how I came up with LibreOffice, I was doing a
> workshop recently and one of the participants was not content with the
> choice of vim or nano, so he opened LibreOffice to edit the gitignore
> file with confusing consequences.
>
> This codepath doesn't go as far as the config code in validating that
> we do not have a partial BOM which would mean there's some invalid
> content, but we don't really have invalid content any other way, as
> we're just dealing with a list of paths in the file.
Yeah, users are entertaining!
I agree that this is a good patch. *Maybe* we would need the same handling in more places, in which case it might make sense to refactor the test into its own function.
In any case, though, the Git project requires a [Developer's Certificate of Origin](https://github.com/git/git/blob/v2.3.5/Documentation/SubmittingPatches#L234-L277); Would you mind adding that?
Thanks,
Dscho
next prev parent reply other threads:[~2015-04-16 15:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-16 14:05 [PATCH] dir: allow a BOM at the beginning of exclude files Carlos Martín Nieto
2015-04-16 15:03 ` Johannes Schindelin [this message]
2015-04-16 15:09 ` Carlos Martín Nieto
2015-04-16 15:10 ` Carlos Martín Nieto
2015-04-16 15:39 ` Junio C Hamano
2015-04-16 15:55 ` Jeff King
2015-04-16 17:16 ` Junio C Hamano
2015-04-16 17:52 ` [PATCH 0/3] UTF8 BOM follow-up Junio C Hamano
2015-04-16 17:52 ` [PATCH 1/3] utf8-bom: introduce skip_utf8_bom() helper Junio C Hamano
2015-04-16 18:14 ` Jeff King
2015-04-16 18:23 ` Junio C Hamano
2015-04-16 17:52 ` [PATCH 2/3] config: use utf8_bom[] from utf.[ch] in git_parse_source() Junio C Hamano
2015-04-16 17:52 ` [PATCH 3/3] attr: skip UTF8 BOM at the beginning of the input file Junio C Hamano
2015-04-16 18:27 ` [PATCH] dir: allow a BOM at the beginning of exclude files Carlos Martín Nieto
2015-04-16 18:39 ` [PATCH v2 0/4] UTF8 BOM follow-up Junio C Hamano
2015-04-16 18:39 ` [PATCH v2 1/4] add_excludes_from_file: clarify the bom skipping logic Junio C Hamano
2015-04-16 18:39 ` [PATCH v2 2/4] utf8-bom: introduce skip_utf8_bom() helper Junio C Hamano
2015-04-16 18:39 ` [PATCH v2 3/4] config: use utf8_bom[] from utf.[ch] in git_parse_source() Junio C Hamano
2015-04-16 18:39 ` [PATCH v2 4/4] attr: skip UTF8 BOM at the beginning of the input file Junio C Hamano
2015-04-16 19:26 ` [PATCH v2 0/4] UTF8 BOM follow-up Jeff King
2015-04-17 22:44 ` Karsten Blees
2015-04-20 21:50 ` Junio C Hamano
2015-04-16 16:08 ` [PATCH] dir: allow a BOM at the beginning of exclude files Johannes Schindelin
2015-04-16 16:10 ` Torsten Bögershausen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=13f82e720ac12a6bc12e8b9f566dd48e@www.dscho.org \
--to=johannes.schindelin@gmx.de \
--cc=cmn@elego.de \
--cc=git-owner@vger.kernel.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).