Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GitConfigParser misparses quotes in options #1923

Open
@cjwatson

Description

@cjwatson

My~/.gitconfig starts like this:

[user]        name = "Colin Watson"        email = "cjwatson@debian.org"

It's been like that for a long time, so I don't remember whether an old version ofgit config wrote it like that, or whether I put it there by hand. Anyway,git itself has always been fine with this. The relevant part of git-config(1) says:

A line that defines a value can be continued to the next line by ending it with a ; the backslash and the end-of-line are stripped. Leading whitespaces after name =, the remainder of the line after the first comment character # or ;, and trailing whitespaces of the line are discarded unless they are enclosed in double quotes. Internal whitespaces within the value are retained verbatim.

Inside double quotes, double quote " and backslash \ characters must be escaped: use " for " and \ for .

The following escape sequences (beside " and \) are recognized: \n for newline character (NL), \t for horizontal tabulation (HT, TAB) and \b for backspace (BS). Other char escape sequences (including octal escape sequences) are invalid.

But when I create a commit usingIndexFile.commit(), I get this in the commit metadata, which I'm pretty sure is malformed:

Author: "Colin Watson" <"cjwatson@debian.org">

I thinkGitConfigParser should match the parsing rules thatgit config follows.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp