Re: [PATCH] [RFC] Design for pathname encoding gitattribute [RESEND]
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 22, 2008, 06:26 UTC
- Message-ID
- <7vlk6iv0ik.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080122050215.DE198200A2@wilber.wgtn.cat-it.co.nz>
Sam Vilain <sam.vilain@catalyst.net.nz> writes:
Show 7 quoted lines
> Some projects may like to enforce a particular encoding is used for > all filenames in the repository. Within the UTF-8 encoding, there are > four normal forms (see http://unicode.org/reports/tr15/), any of which > may be a reasonable repository format choice. Additionally, some > filesystems may have a single encoding that they support when writing > local filenames. To support this, iconv and a normalization library > must have the information they need to perform the correct conversion.
Isn't there a chicken-and-egg problem? The attributes are by nature per-path, and you need to match the pathname string with a pattern to decide which attribute definition to apply to a given path. Before knowing what encoding the pathname you have just read from readdir(3), how would you match that pathname with the pattern in the gitattributes file?
I can buy the .git/config (and an in-tree .git-encoding, perhaps), though.