From: Junio C Hamano <gitster@pobox.com>
To: "Arend van Spriel" <arend@broadcom.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC] git: make signoff header configurable
Date: Mon, 06 May 2013 21:53:31 -0700 [thread overview]
Message-ID: <7vehdjo0fo.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1367876032-6833-1-git-send-email-arend@broadcom.com> (Arend van Spriel's message of "Mon, 6 May 2013 23:33:52 +0200")
"Arend van Spriel" <arend@broadcom.com> writes:
> I had an itch to scratch. Like the -s command line parameter to
> get the signed-off message added, but not all projects use the
> same signature format. So let me know what you think about this
> idea. Never contributed to git before so decided to make it an
> RFC first as this solution may be a bit hack-ish.
It is customary to declare things like "char *get_signoff_header()"
that are meant to be available pretty much everywhere in cache.h
(look for /* Environment bits from configuration mechanism */) and
not in an unrelated header like sequencer.h (which builtin/commit.c
or config.c have no business including). Also, default-config may
be a bit too generic place to read this information; it is used by
many read-only commands like "log", "diff", etc. that have no reason
to know this custom trailer setting.
Other than these, I do not see anything glaringly "hack-ish" in the
implementation itself. Of course, a non-RFC patch would come with
documentation and test script updates.
By the way, what you are adding is a trailer, not a header, as it
comes at the very end ;-).
To projects that adopt the S-o-b convention from the kernel, the act
of signing off has a very specific legal meaning (I know it is not
an electronic signature, but the intention counts in court); I am
not sure if it is even a good idea to make "-s" mean something
different depending on the configuration in the first place, though.
Wouldn't a commit template a better alternative for appending a
random stuff in the log message, I wonder.
> builtin/commit.c | 5 +++--
> config.c | 12 ++++++++++++
> sequencer.c | 15 +++++++++++++--
> sequencer.h | 3 ++-
> 4 files changed, 30 insertions(+), 5 deletions(-)
> diff --git a/sequencer.h b/sequencer.h
> index 1fc22dc..5a91105 100644
> --- a/sequencer.h
> +++ b/sequencer.h
> @@ -48,8 +48,9 @@ struct replay_opts {
>
> int sequencer_pick_revisions(struct replay_opts *opts);
>
> -extern const char sign_off_header[];
> +extern char* sign_off_header;
The asterisk sticks to the identifier, not type, i.e.
extern char *signoff_label;
But I suspect you do not need to make this extern (for the same
reason we can keep def_signoff_header[] a static), as long as the
public facing API "get-signoff-header" is extern.
> +char *get_signoff_header(void);
> void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag);
>
> #endif
prev parent reply other threads:[~2013-05-07 4:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 21:33 [RFC] git: make signoff header configurable Arend van Spriel
2013-05-07 4:53 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vehdjo0fo.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=arend@broadcom.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).