git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Santi Béjar" <sbejar@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/2] commit: Show committer if automatic
Date: Sat, 3 May 2008 22:28:52 +0200	[thread overview]
Message-ID: <8aa486160805031328o7dfae18fnac1bbea7420e0193@mail.gmail.com> (raw)
In-Reply-To: <7vmyn7tezi.fsf@gitster.siamese.dyndns.org>

On Sat, May 3, 2008 at 8:33 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Santi Béjar <sbejar@gmail.com> writes:

[...]

>
>  >  static int prepare_to_commit(const char *index_file, const char *prefix)
>  >  {
>  >       struct stat statbuf;
>  > @@ -448,6 +471,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
>  >       const char *hook_arg2 = NULL;
>  >       const char *author_ident;
>  >       const char *committer_ident;
>  > +     int showed_ident = 0;
>  >
>  >       if (!no_verify && run_hook(index_file, "pre-commit", NULL))
>  >               return 0;
>  > @@ -528,6 +552,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
>  >       strbuf_release(&sb);
>  >
>  >       determine_author_info();
>  > +     git_committer_info(0);
>
>  This call needs a comment to justify it, as it feels wrong to call a
>  function that usually is used for its return string and discard the return
>  value.

In the code or in the commit message.

/* To know if the committer ident is automatic */

I did it this way to have the knowledge about the automatic setting in
git_committer_info.

>
>
>  > @@ -558,11 +583,20 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
>  >                                        getenv("GIT_COMMITTER_EMAIL")));
>  >               if (strcmp(author_ident, committer_ident))
>  >                       fprintf(fp,
>  > -                             "#\n"
>  > -                             "# Author:    %s\n"
>  > -                             "#\n",
>  > +                             "%s"
>  > +                             "# Author:    %s\n",
>  > +                             showed_ident++ ? "" : "#\n",
>  >                               fmt_name(author_name, author_email));
>
>  This part should have been [0/2] as it has been agreed it is a good idea.

Sorry, I should have said to this series was on top of:

[PATCHv2 2/3] commit: Show author if different from committer

I'll send a series with this include and the corrections.

Santi

  reply	other threads:[~2008-05-03 20:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02 18:22 [PATCH 0/2] Show committer ident in some cases Santi Béjar
2008-05-02 18:22 ` [PATCH 1/2] commit: Show committer if automatic Santi Béjar
2008-05-03 18:33   ` Junio C Hamano
2008-05-03 20:28     ` Santi Béjar [this message]
2008-05-02 18:22 ` [PATCH 2/2] user.warnautomatic: add config to control if the committer ident is shown Santi Béjar
2008-05-02 21:44 ` [PATCH 0/2] Show committer ident in some cases Junio C Hamano
2008-05-02 22:07   ` Santi Béjar
2008-05-02 22:32     ` Junio C Hamano
2008-05-03 10:18       ` Santi Béjar
2008-05-05  3:30 ` Jeff King
2008-05-05  5:23   ` Junio C Hamano

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=8aa486160805031328o7dfae18fnac1bbea7420e0193@mail.gmail.com \
    --to=sbejar@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).