summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 36c79d2)
raw | patch | inline | side by side (parent: 36c79d2)
author | Dan McGee <dpmcgee@gmail.com> | |
Sat, 26 Apr 2008 20:14:28 +0000 (15:14 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 26 Apr 2008 21:06:17 +0000 (14:06 -0700) |
I often find myself pulling patches off of other peoples trees using
cherry-pick, and following it with an immediate 'git commit --amend -s'
command. Eliminate the need for a double commit by allowing signoff on a
cherry-pick or revert.
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cherry-pick, and following it with an immediate 'git commit --amend -s'
command. Eliminate the need for a double commit by allowing signoff on a
cherry-pick or revert.
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-cherry-pick.txt | patch | blob | history | |
Documentation/git-revert.txt | patch | blob | history | |
builtin-revert.c | patch | blob | history |
index f0beb412e655f0e188b8a1427b41f72b6cc61239..ca048f46f664a52eb5b0174ff4177eba5b20e702 100644 (file)
SYNOPSIS
--------
-'git-cherry-pick' [--edit] [-n] [-m parent-number] [-x] <commit>
+'git-cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] <commit>
DESCRIPTION
-----------
This is useful when cherry-picking more than one commits'
effect to your working tree in a row.
+-s|--signoff::
+ Add Signed-off-by line at the end of the commit message.
+
Author
------
index 93e20f7752f0d48faca153eef144845b2db9ce1d..13ceabbcc8851344e54e13773a2a553360f931c4 100644 (file)
SYNOPSIS
--------
-'git-revert' [--edit | --no-edit] [-n] [-m parent-number] <commit>
+'git-revert' [--edit | --no-edit] [-n] [-m parent-number] [-s] <commit>
DESCRIPTION
-----------
This is useful when reverting more than one commits'
effect to your working tree in a row.
+-s|--signoff::
+ Add Signed-off-by line at the end of the commit message.
+
Author
------
diff --git a/builtin-revert.c b/builtin-revert.c
index 607a2f0337c3d3f1fb8bdac7443e3a7f56e92305..2b57525d7234086bdf2022d13fa405e5007627fb 100644 (file)
--- a/builtin-revert.c
+++ b/builtin-revert.c
NULL
};
-static int edit, no_replay, no_commit, mainline;
+static int edit, no_replay, no_commit, mainline, signoff;
static enum { REVERT, CHERRY_PICK } action;
static struct commit *commit;
OPT_BOOLEAN('e', "edit", &edit, "edit the commit message"),
OPT_BOOLEAN('x', NULL, &no_replay, "append commit name when cherry-picking"),
OPT_BOOLEAN('r', NULL, &noop, "no-op (backward compatibility)"),
+ OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
OPT_INTEGER('m', "mainline", &mainline, "parent number"),
OPT_END(),
};
*/
if (!no_commit) {
- if (edit)
- return execl_git_cmd("commit", "-n", NULL);
- else
- return execl_git_cmd("commit", "-n", "-F", defmsg, NULL);
+ /* 6 is max possible length of our args array including NULL */
+ const char *args[6];
+ int i = 0;
+ args[i++] = "commit";
+ args[i++] = "-n";
+ if (signoff)
+ args[i++] = "-s";
+ if (!edit) {
+ args[i++] = "-F";
+ args[i++] = defmsg;
+ }
+ args[i] = NULL;
+ return execv_git_cmd(args);
}
free(reencoded_message);