Merge branch 'bk/sob-dco'

Document that the meaning of a Signed-off-by trailer can vary from
project to project in the end-user documentation, and clarify what
it means to this project.

* bk/sob-dco:
  Documentation: stylistically normalize references to Signed-off-by:
  SubmittingPatches: clarify DCO is our --signoff rule
  Documentation: clarify and expand description of --signoff
  doc: preparatory clean-up of description on the sign-off option
This commit is contained in:
Junio C Hamano 2020-11-02 13:17:39 -08:00
commit 761a4e9ab1
22 changed files with 60 additions and 54 deletions

View File

@ -249,7 +249,7 @@ component you're working on, followed by a blank line (always required) and then
the body of your commit message, which should provide the bulk of the context. the body of your commit message, which should provide the bulk of the context.
Remember to be explicit and provide the "Why" of your change, especially if it Remember to be explicit and provide the "Why" of your change, especially if it
couldn't easily be understood from your diff. When editing your commit message, couldn't easily be understood from your diff. When editing your commit message,
don't remove the Signed-off-by line which was added by `-s` above. don't remove the `Signed-off-by` trailer which was added by `-s` above.
---- ----
psuh: add a built-in by popular demand psuh: add a built-in by popular demand

View File

@ -209,7 +209,7 @@ send them as replies to either an additional "cover letter" message
(see below), the first patch, or the respective preceding patch. (see below), the first patch, or the respective preceding patch.
If your log message (including your name on the If your log message (including your name on the
Signed-off-by line) is not writable in ASCII, make sure that `Signed-off-by` trailer) is not writable in ASCII, make sure that
you send off a message in the correct encoding. you send off a message in the correct encoding.
WARNING: Be wary of your MUAs word-wrap WARNING: Be wary of your MUAs word-wrap
@ -229,7 +229,7 @@ previously sent.
The `git format-patch` command follows the best current practice to The `git format-patch` command follows the best current practice to
format the body of an e-mail message. At the beginning of the format the body of an e-mail message. At the beginning of the
patch should come your commit message, ending with the patch should come your commit message, ending with the
Signed-off-by: lines, and a line that consists of three dashes, `Signed-off-by` trailers, and a line that consists of three dashes,
followed by the diffstat information and the patch itself. If followed by the diffstat information and the patch itself. If
you are forwarding a patch from somebody else, optionally, at you are forwarding a patch from somebody else, optionally, at
the beginning of the e-mail message just before the commit the beginning of the e-mail message just before the commit
@ -298,17 +298,14 @@ Do not forget to add trailers such as `Acked-by:`, `Reviewed-by:` and
patch. patch.
[[sign-off]] [[sign-off]]
=== Certify your work by adding your "Signed-off-by: " line === Certify your work by adding your `Signed-off-by` trailer
To improve tracking of who did what, we've borrowed the To improve tracking of who did what, we ask you to certify that you
"sign-off" procedure from the Linux kernel project on patches wrote the patch or have the right to pass it on under the same license
that are being emailed around. Although core Git is a lot as ours, by "signing off" your patch. Without sign-off, we cannot
smaller project it is a good discipline to follow it. accept your patches.
The sign-off is a simple line at the end of the explanation for If you can certify the below D-C-O:
the patch, which certifies that you wrote it or otherwise have
the right to pass it on as an open-source patch. The rules are
pretty simple: if you can certify the below D-C-O:
[[dco]] [[dco]]
.Developer's Certificate of Origin 1.1 .Developer's Certificate of Origin 1.1
@ -338,23 +335,29 @@ d. I understand and agree that this project and the contribution
this project or the open source license(s) involved. this project or the open source license(s) involved.
____ ____
then you just add a line saying you add a "Signed-off-by" trailer to your commit, that looks like
this:
.... ....
Signed-off-by: Random J Developer <random@developer.example.org> Signed-off-by: Random J Developer <random@developer.example.org>
.... ....
This line can be automatically added by Git if you run the git-commit This line can be added by Git if you run the git-commit command with
command with the -s option. the -s option.
Notice that you can place your own Signed-off-by: line when Notice that you can place your own `Signed-off-by` trailer when
forwarding somebody else's patch with the above rules for forwarding somebody else's patch with the above rules for
D-C-O. Indeed you are encouraged to do so. Do not forget to D-C-O. Indeed you are encouraged to do so. Do not forget to
place an in-body "From: " line at the beginning to properly attribute place an in-body "From: " line at the beginning to properly attribute
the change to its true author (see (2) above). the change to its true author (see (2) above).
This procedure originally came from the Linux kernel project, so our
rule is quite similar to theirs, but what exactly it means to sign-off
your patch differs from project to project, so it may be different
from that of the project you are accustomed to.
[[real-name]] [[real-name]]
Also notice that a real name is used in the Signed-off-by: line. Please Also notice that a real name is used in the `Signed-off-by` trailer. Please
don't hide your real name. don't hide your real name.
[[commit-trailers]] [[commit-trailers]]

View File

@ -79,7 +79,7 @@ format.thread::
format.signOff:: format.signOff::
A boolean value which lets you enable the `-s/--signoff` option of A boolean value which lets you enable the `-s/--signoff` option of
format-patch by default. *Note:* Adding the Signed-off-by: line to a format-patch by default. *Note:* Adding the `Signed-off-by` trailer to a
patch should be a conscious act and means that you certify you have patch should be a conscious act and means that you certify you have
the rights to submit this work under the same open source license. the rights to submit this work under the same open source license.
Please see the 'SubmittingPatches' document for further discussion. Please see the 'SubmittingPatches' document for further discussion.

View File

@ -33,7 +33,7 @@ OPTIONS
-s:: -s::
--signoff:: --signoff::
Add a `Signed-off-by:` line to the commit message, using Add a `Signed-off-by` trailer to the commit message, using
the committer identity of yourself. the committer identity of yourself.
See the signoff option in linkgit:git-commit[1] for more information. See the signoff option in linkgit:git-commit[1] for more information.

View File

@ -104,7 +104,7 @@ effect to your index in a row.
-s:: -s::
--signoff:: --signoff::
Add Signed-off-by line at the end of the commit message. Add a `Signed-off-by` trailer at the end of the commit message.
See the signoff option in linkgit:git-commit[1] for more information. See the signoff option in linkgit:git-commit[1] for more information.
-S[<keyid>]:: -S[<keyid>]::

View File

@ -59,6 +59,7 @@ commit by giving the same set of parameters (options and paths).
If you make a commit and then find a mistake immediately after If you make a commit and then find a mistake immediately after
that, you can recover from it with 'git reset'. that, you can recover from it with 'git reset'.
:git-commit: 1
OPTIONS OPTIONS
------- -------
@ -163,14 +164,7 @@ The `-m` option is mutually exclusive with `-c`, `-C`, and `-F`.
message, the commit is aborted. This has no effect when a message message, the commit is aborted. This has no effect when a message
is given by other means, e.g. with the `-m` or `-F` options. is given by other means, e.g. with the `-m` or `-F` options.
-s:: include::signoff-option.txt[]
--signoff::
Add Signed-off-by line by the committer at the end of the commit
log message. The meaning of a signoff depends on the project,
but it typically certifies that committer has
the rights to submit this work under the same license and
agrees to a Developer Certificate of Origin
(see http://developercertificate.org/ for more information).
-n:: -n::
--no-verify:: --no-verify::

View File

@ -119,7 +119,7 @@ include::diff-options.txt[]
-s:: -s::
--signoff:: --signoff::
Add `Signed-off-by:` line to the commit message, using Add a `Signed-off-by` trailer to the commit message, using
the committer identity of yourself. the committer identity of yourself.
See the signoff option in linkgit:git-commit[1] for more information. See the signoff option in linkgit:git-commit[1] for more information.

View File

@ -496,7 +496,7 @@ See also INCOMPATIBLE OPTIONS below.
See also INCOMPATIBLE OPTIONS below. See also INCOMPATIBLE OPTIONS below.
--signoff:: --signoff::
Add a Signed-off-by: trailer to all the rebased commits. Note Add a `Signed-off-by` trailer to all the rebased commits. Note
that if `--interactive` is given then only commits marked to be that if `--interactive` is given then only commits marked to be
picked, edited or reworded will have the trailer added. picked, edited or reworded will have the trailer added.
+ +

View File

@ -99,7 +99,7 @@ effect to your index in a row.
-s:: -s::
--signoff:: --signoff::
Add Signed-off-by line at the end of the commit message. Add a `Signed-off-by` trailer at the end of the commit message.
See the signoff option in linkgit:git-commit[1] for more information. See the signoff option in linkgit:git-commit[1] for more information.
--strategy=<strategy>:: --strategy=<strategy>::

View File

@ -313,7 +313,7 @@ Automating
the value of `sendemail.identity`. the value of `sendemail.identity`.
--[no-]signed-off-by-cc:: --[no-]signed-off-by-cc::
If this is set, add emails found in Signed-off-by: or Cc: lines to the If this is set, add emails found in the `Signed-off-by` trailer or Cc: lines to the
cc list. Default is the value of `sendemail.signedoffbycc` configuration cc list. Default is the value of `sendemail.signedoffbycc` configuration
value; if that is unspecified, default to --signed-off-by-cc. value; if that is unspecified, default to --signed-off-by-cc.
@ -340,7 +340,7 @@ Automating
except for self (use 'self' for that). except for self (use 'self' for that).
- 'bodycc' will avoid including anyone mentioned in Cc lines in the - 'bodycc' will avoid including anyone mentioned in Cc lines in the
patch body (commit message) except for self (use 'self' for that). patch body (commit message) except for self (use 'self' for that).
- 'sob' will avoid including anyone mentioned in Signed-off-by lines except - 'sob' will avoid including anyone mentioned in the Signed-off-by trailers except
for self (use 'self' for that). for self (use 'self' for that).
- 'misc-by' will avoid including anyone mentioned in Acked-by, - 'misc-by' will avoid including anyone mentioned in Acked-by,
Reviewed-by, Tested-by and other "-by" lines in the patch body, Reviewed-by, Tested-by and other "-by" lines in the patch body,

View File

@ -701,7 +701,7 @@ creating the branch or tag.
--use-log-author:: --use-log-author::
When retrieving svn commits into Git (as part of 'fetch', 'rebase', or When retrieving svn commits into Git (as part of 'fetch', 'rebase', or
'dcommit' operations), look for the first `From:` or `Signed-off-by:` line 'dcommit' operations), look for the first `From:` line or `Signed-off-by` trailer
in the log message and use that as the author string. in the log message and use that as the author string.
+ +
[verse] [verse]
@ -710,7 +710,7 @@ config key: svn.useLogAuthor
--add-author-from:: --add-author-from::
When committing to svn from Git (as part of 'set-tree' or 'dcommit' When committing to svn from Git (as part of 'set-tree' or 'dcommit'
operations), if the existing log message doesn't already have a operations), if the existing log message doesn't already have a
`From:` or `Signed-off-by:` line, append a `From:` line based on the `From:` or `Signed-off-by` trailer, append a `From:` line based on the
Git commit's author string. If you use this, then `--use-log-author` Git commit's author string. If you use this, then `--use-log-author`
will retrieve a valid author string for all commits. will retrieve a valid author string for all commits.
+ +

View File

@ -164,7 +164,7 @@ can also be used to refuse the commit after inspecting the message
file. file.
The default 'commit-msg' hook, when enabled, detects duplicate The default 'commit-msg' hook, when enabled, detects duplicate
"Signed-off-by" lines, and aborts the commit if one is found. `Signed-off-by` trailers, and aborts the commit if one is found.
post-commit post-commit
~~~~~~~~~~~ ~~~~~~~~~~~

View File

@ -77,16 +77,7 @@ When not possible, refuse to merge and exit with a non-zero status.
With --no-log do not list one-line descriptions from the With --no-log do not list one-line descriptions from the
actual commits being merged. actual commits being merged.
--signoff:: include::signoff-option.txt[]
--no-signoff::
Add Signed-off-by line by the committer at the end of the commit
log message. The meaning of a signoff depends on the project,
but it typically certifies that committer has
the rights to submit this work under the same license and
agrees to a Developer Certificate of Origin
(see http://developercertificate.org/ for more information).
+
With --no-signoff do not add a Signed-off-by line.
--stat:: --stat::
-n:: -n::

View File

@ -0,0 +1,18 @@
ifdef::git-commit[]
-s::
endif::git-commit[]
--signoff::
--no-signoff::
Add a `Signed-off-by` trailer by the committer at the end of the commit
log message. The meaning of a signoff depends on the project
to which you're committing. For example, it may certify that
the committer has the rights to submit the work under the
project's license or agrees to some contributor representation,
such as a Developer Certificate of Origin.
(See http://developercertificate.org for the one used by the
Linux kernel and Git projects.) Consult the documentation or
leadership of the project to which you're contributing to
understand how the signoffs are used in that project.
+
The --no-signoff option can be used to countermand an earlier --signoff
option on the command line.

View File

@ -2237,7 +2237,7 @@ int cmd_am(int argc, const char **argv, const char *prefix)
N_("allow fall back on 3way merging if needed")), N_("allow fall back on 3way merging if needed")),
OPT__QUIET(&state.quiet, N_("be quiet")), OPT__QUIET(&state.quiet, N_("be quiet")),
OPT_SET_INT('s', "signoff", &state.signoff, OPT_SET_INT('s', "signoff", &state.signoff,
N_("add a Signed-off-by line to the commit message"), N_("add a Signed-off-by trailer to the commit message"),
SIGNOFF_EXPLICIT), SIGNOFF_EXPLICIT),
OPT_BOOL('u', "utf8", &state.utf8, OPT_BOOL('u', "utf8", &state.utf8,
N_("recode into utf8 (default)")), N_("recode into utf8 (default)")),

View File

@ -1507,7 +1507,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
OPT_STRING(0, "fixup", &fixup_message, N_("commit"), N_("use autosquash formatted message to fixup specified commit")), OPT_STRING(0, "fixup", &fixup_message, N_("commit"), N_("use autosquash formatted message to fixup specified commit")),
OPT_STRING(0, "squash", &squash_message, N_("commit"), N_("use autosquash formatted message to squash specified commit")), OPT_STRING(0, "squash", &squash_message, N_("commit"), N_("use autosquash formatted message to squash specified commit")),
OPT_BOOL(0, "reset-author", &renew_authorship, N_("the commit is authored by me now (used with -C/-c/--amend)")), OPT_BOOL(0, "reset-author", &renew_authorship, N_("the commit is authored by me now (used with -C/-c/--amend)")),
OPT_BOOL('s', "signoff", &signoff, N_("add Signed-off-by:")), OPT_BOOL('s', "signoff", &signoff, N_("add a Signed-off-by trailer")),
OPT_FILENAME('t', "template", &template_file, N_("use specified template file")), OPT_FILENAME('t', "template", &template_file, N_("use specified template file")),
OPT_BOOL('e', "edit", &edit_flag, N_("force edit of commit")), OPT_BOOL('e', "edit", &edit_flag, N_("force edit of commit")),
OPT_CLEANUP(&cleanup_arg), OPT_CLEANUP(&cleanup_arg),

View File

@ -1738,7 +1738,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
OPT_CALLBACK_F('N', "no-numbered", &numbered, NULL, OPT_CALLBACK_F('N', "no-numbered", &numbered, NULL,
N_("use [PATCH] even with multiple patches"), N_("use [PATCH] even with multiple patches"),
PARSE_OPT_NOARG | PARSE_OPT_NONEG, no_numbered_callback), PARSE_OPT_NOARG | PARSE_OPT_NONEG, no_numbered_callback),
OPT_BOOL('s', "signoff", &do_signoff, N_("add Signed-off-by:")), OPT_BOOL('s', "signoff", &do_signoff, N_("add a Signed-off-by trailer")),
OPT_BOOL(0, "stdout", &use_stdout, OPT_BOOL(0, "stdout", &use_stdout,
N_("print patches to standard out")), N_("print patches to standard out")),
OPT_BOOL(0, "cover-letter", &cover_letter, OPT_BOOL(0, "cover-letter", &cover_letter,

View File

@ -289,7 +289,7 @@ static struct option builtin_merge_options[] = {
N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" }, N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
OPT_AUTOSTASH(&autostash), OPT_AUTOSTASH(&autostash),
OPT_BOOL(0, "overwrite-ignore", &overwrite_ignore, N_("update ignored files (default)")), OPT_BOOL(0, "overwrite-ignore", &overwrite_ignore, N_("update ignored files (default)")),
OPT_BOOL(0, "signoff", &signoff, N_("add Signed-off-by:")), OPT_BOOL(0, "signoff", &signoff, N_("add a Signed-off-by trailer")),
OPT_BOOL(0, "no-verify", &no_verify, N_("bypass pre-merge-commit and commit-msg hooks")), OPT_BOOL(0, "no-verify", &no_verify, N_("bypass pre-merge-commit and commit-msg hooks")),
OPT_END() OPT_END()
}; };

View File

@ -142,7 +142,7 @@ static struct option pull_options[] = {
N_("add (at most <n>) entries from shortlog to merge commit message"), N_("add (at most <n>) entries from shortlog to merge commit message"),
PARSE_OPT_OPTARG), PARSE_OPT_OPTARG),
OPT_PASSTHRU(0, "signoff", &opt_signoff, NULL, OPT_PASSTHRU(0, "signoff", &opt_signoff, NULL,
N_("add Signed-off-by:"), N_("add a Signed-off-by trailer"),
PARSE_OPT_OPTARG), PARSE_OPT_OPTARG),
OPT_PASSTHRU(0, "squash", &opt_squash, NULL, OPT_PASSTHRU(0, "squash", &opt_squash, NULL,
N_("create a single commit instead of doing a merge"), N_("create a single commit instead of doing a merge"),

View File

@ -1324,7 +1324,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
N_("do not show diffstat of what changed upstream"), N_("do not show diffstat of what changed upstream"),
PARSE_OPT_NOARG, NULL, REBASE_DIFFSTAT }, PARSE_OPT_NOARG, NULL, REBASE_DIFFSTAT },
OPT_BOOL(0, "signoff", &options.signoff, OPT_BOOL(0, "signoff", &options.signoff,
N_("add a Signed-off-by: line to each commit")), N_("add a Signed-off-by trailer to each commit")),
OPT_BOOL(0, "committer-date-is-author-date", OPT_BOOL(0, "committer-date-is-author-date",
&options.committer_date_is_author_date, &options.committer_date_is_author_date,
N_("make committer date match author date")), N_("make committer date match author date")),

View File

@ -107,7 +107,7 @@ static int run_sequencer(int argc, const char **argv, struct replay_opts *opts)
OPT_BOOL('n', "no-commit", &opts->no_commit, N_("don't automatically commit")), OPT_BOOL('n', "no-commit", &opts->no_commit, N_("don't automatically commit")),
OPT_BOOL('e', "edit", &opts->edit, N_("edit the commit message")), OPT_BOOL('e', "edit", &opts->edit, N_("edit the commit message")),
OPT_NOOP_NOARG('r', NULL), OPT_NOOP_NOARG('r', NULL),
OPT_BOOL('s', "signoff", &opts->signoff, N_("add Signed-off-by:")), OPT_BOOL('s', "signoff", &opts->signoff, N_("add a Signed-off-by trailer")),
OPT_CALLBACK('m', "mainline", opts, N_("parent-number"), OPT_CALLBACK('m', "mainline", opts, N_("parent-number"),
N_("select mainline parent"), option_parse_m), N_("select mainline parent"), option_parse_m),
OPT_RERERE_AUTOUPDATE(&opts->allow_rerere_auto), OPT_RERERE_AUTOUPDATE(&opts->allow_rerere_auto),

View File

@ -1586,7 +1586,7 @@ const char *find_commit_header(const char *msg, const char *key, size_t *out_len
/* /*
* Inspect the given string and determine the true "end" of the log message, in * Inspect the given string and determine the true "end" of the log message, in
* order to find where to put a new Signed-off-by: line. Ignored are * order to find where to put a new Signed-off-by trailer. Ignored are
* trailing comment lines and blank lines. To support "git commit -s * trailing comment lines and blank lines. To support "git commit -s
* --amend" on an existing commit, we also ignore "Conflicts:". To * --amend" on an existing commit, we also ignore "Conflicts:". To
* support "git commit -v", we truncate at cut lines. * support "git commit -v", we truncate at cut lines.