Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork940
Closed
Description
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
Labels
No labels