summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: da06a80)
raw | patch | inline | side by side (parent: da06a80)
author | Miklos Vajna <vmiklos@frugalware.org> | |
Wed, 10 Sep 2008 20:10:31 +0000 (22:10 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 10 Sep 2008 22:25:46 +0000 (15:25 -0700) |
In case it's NULL, it is still determined automatically, but now you
have the ability to specify one yourself.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
have the ability to specify one yourself.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-commit-tree.c | patch | blob | history | |
builtin-merge.c | patch | blob | history | |
builtin.h | patch | blob | history |
diff --git a/builtin-commit-tree.c b/builtin-commit-tree.c
index f2684bb75e2319f2797bfe626e15bc27bd76f21a..0453425c471f1d6793bc7f5f59d17e9d285ddfc6 100644 (file)
--- a/builtin-commit-tree.c
+++ b/builtin-commit-tree.c
"variable i18n.commitencoding to the encoding your project uses.\n";
int commit_tree(const char *msg, unsigned char *tree,
- struct commit_list *parents, unsigned char *ret)
+ struct commit_list *parents, unsigned char *ret,
+ const char *author)
{
int result;
int encoding_is_utf8;
}
/* Person/date information */
- strbuf_addf(&buffer, "author %s\n", git_author_info(IDENT_ERROR_ON_NO_NAME));
+ if (!author)
+ author = git_author_info(IDENT_ERROR_ON_NO_NAME);
+ strbuf_addf(&buffer, "author %s\n", author);
strbuf_addf(&buffer, "committer %s\n", git_committer_info(IDENT_ERROR_ON_NO_NAME));
if (!encoding_is_utf8)
strbuf_addf(&buffer, "encoding %s\n", git_commit_encoding);
if (strbuf_read(&buffer, 0, 0) < 0)
die("git commit-tree: read returned %s", strerror(errno));
- if (!commit_tree(buffer.buf, tree_sha1, parents, commit_sha1)) {
+ if (!commit_tree(buffer.buf, tree_sha1, parents, commit_sha1, NULL)) {
printf("%s\n", sha1_to_hex(commit_sha1));
return 0;
}
diff --git a/builtin-merge.c b/builtin-merge.c
index 9ad9791068c9330f28413ac67315246989c8d96d..4a8ec604d390d0b600ee7a6b3d5b74975dbf87d3 100644 (file)
--- a/builtin-merge.c
+++ b/builtin-merge.c
parent->next = xmalloc(sizeof(struct commit_list *));
parent->next->item = remoteheads->item;
parent->next->next = NULL;
- commit_tree(merge_msg.buf, result_tree, parent, result_commit);
+ commit_tree(merge_msg.buf, result_tree, parent, result_commit, NULL);
finish(result_commit, "In-index merge");
drop_save();
return 0;
}
free_commit_list(remoteheads);
strbuf_addch(&merge_msg, '\n');
- commit_tree(merge_msg.buf, result_tree, parents, result_commit);
+ commit_tree(merge_msg.buf, result_tree, parents, result_commit, NULL);
strbuf_addf(&buf, "Merge made by %s.", wt_strategy);
finish(result_commit, buf.buf);
strbuf_release(&buf);
diff --git a/builtin.h b/builtin.h
index e67cb2090e8c111be4b137939953f3e006f31dfd..8893b3ca59e650f88384ddc19389cfe96088e654 100644 (file)
--- a/builtin.h
+++ b/builtin.h
extern int fmt_merge_msg(int merge_summary, struct strbuf *in,
struct strbuf *out);
extern int commit_tree(const char *msg, unsigned char *tree,
- struct commit_list *parents, unsigned char *ret);
+ struct commit_list *parents, unsigned char *ret,
+ const char *author);
extern int check_pager_config(const char *cmd);
extern int cmd_add(int argc, const char **argv, const char *prefix);