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

Can't pass environment variables to Git.execute #644

Closed
@AJMansfield

Description

@AJMansfield

This is needed for commands likegit-commit andgit-commit-tree in order to be able to specify author and committer information. Whilegit-commit does provide the--author and--date to specify author information, there are no options for specifying committer information, andgit-commit-tree is wholly dependent on environment variables.

For instance, the following code fails withTypeError: type object got multiple values for keyword argument 'env'.

def pipe_of(string):import osif type(string) is str:string = bytes(string, 'utf-8')r,w = os.pipe()os.write(w, string)os.close(w)return rgit = Repo('/path/ro/repo').gitblob = git.execute(['git', 'hash-object', '-w', '--stdin'], istream=pipe_of("my data"))tree = git.execute(['git', 'mktree'], istream=pipe_of("100644 blob {}\tmy-file\n".format(blob)))commit = git.execute(['git', 'commit-tree', tree], istream=None, env={'GIT_AUTHOR_NAME':'Author Name','GIT_AUTHOR_EMAIL':'author@example.com','GIT_AUTHOR_DATE':'1400000000+0000','GIT_COMMITTER_NAME':'Comitter Name','GIT_COMMITTER_EMAIL':'committer@example.com','GIT_COMMITTER_DATE':'1500000000+0000',})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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