Re: [PATCH 1/2] commit: Show committer if automatic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 3, 2008 at 8:33 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Santi Béjar <sbejar@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux