Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitter character in the log result #985

Open
adamsol opened this issue Mar 24, 2024 · 1 comment
Open

Splitter character in the log result #985

adamsol opened this issue Mar 24, 2024 · 1 comment

Comments

@adamsol
Copy link

adamsol commented Mar 24, 2024

When I run the following git log command with a custom format:

simpleGit().log({
    format: {
        subject: '%s',
        body: '%b',
    },
});

I'm getting the splitter character at the end of the subject, like this:

{
    "subject": "Initial commit ò",
    "body": "",
}

It happens only when the body is empty. When I swap the order of attributes in the format dictionary, the character is displayed at the beginning instead. Everything seems to work fine if there's at least one attribute in the format dictionary both before and after body.

Git version: 2.37.2.windows.2

@adamsol
Copy link
Author

adamsol commented Mar 24, 2024

Another use case -- I wanted to get the commit hash and parent hash:

simpleGit().log({
    format: {
        hash: '%H',
        parents: '%P',
    },
});

Seemed to work fine, but not for the initial commit, which also got the additional ò character at the end, as parents is empty in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant